#--------------------------------------------------------------------------------------------
# makefile to build MPXPLAY program with OpenWatcom 1.9 for DOS and Win32 console
#      (mpxp_dos32.lnk, mpxp_dos4g.lnk and mpxp_win.lnk are also required)
#--------------------------------------------------------------------------------------------

# project root defs
PROJECT_ROOTDIR = .
PROJECT_LIBDIR = $(PROJECT_ROOTDIR)
EXTLIBS_DIR = $(PROJECT_ROOTDIR)\EXTLIBS
BUILDDIR = $(PROJECT_ROOTDIR)\build
EXE_MPXPLAY = $(PROJECT_ROOTDIR)\mpxplay.exe

# tool/compiler defs
TOOLDIR = D:\CPP\WC
BINDIR = $(TOOLDIR)\binnt

AR = @$(BINDIR)\wlib
CC = $(BINDIR)\wcc386
RM = @del
WASM = $(BINDIR)\wasm
WLINK = $(BINDIR)\wlink

INCDIRS = -i.\ -i$(TOOLDIR)\h
LIBDIRS = $(TOOLDIR)\lib386

CFLAGS = -zq -bt=$(BUILD_TARGET) -w3 -mf -oims -s -5r -fp3 -fpi87 $(INCDIRS)
#CFLAGS = -zq -bt=$(BUILD_TARGET) -w3 -mf -oims -s -5r -fp3 -fpi87 -zro $(INCDIRS)
CCOUT  = -fo=
LFLAGS = -q
AFLAGS = -q -w2
ARFLAGS = -q

#DEL_LIB_OBJS = echo $<
DEL_LIB_OBJS = $(RM) $<

!ifdef BUILD_DOS4G
BUILD_TARGET = DOS
LINK_DESCRIPTOR = mpxp_dos4g.lnk
CFLAGS += -i$(EXTLIBS_DIR)\SWS\INCLUDE
LIBDIRS += -L$(TOOLDIR)\lib386\dos
!else
!ifdef BUILD_DOS32
BUILD_TARGET = DOS
LINK_DESCRIPTOR = mpxp_dos32.lnk
CFLAGS += -i$(EXTLIBS_DIR)\SWS\INCLUDE
LIBDIRS += -L$(TOOLDIR)\lib386\dos
CFLAGS += -DMPXPLAY_LINK_DISABLE_DLLS
!else
BUILD_TARGET = nt
LINK_DESCRIPTOR = mpxp_win.lnk
LIBDIRS += -L$(TOOLDIR)\lib386\nt
!endif
!endif

#--- main lib---- ------------------------------------------------------------
DIR_MAIN = $(PROJECT_ROOTDIR)
OBJS_MAIN = $(DIR_MAIN)\MPXPLAY.OBJ $(DIR_MAIN)\IN_FILE.OBJ $(DIR_MAIN)\MPXINBUF.OBJ

#--- AU_CARDS lib ------------------------------------------------------------
LIB_AUCARDS = $(BUILDDIR)\au_cards.LIB
DIR_AUCARDS = $(PROJECT_LIBDIR)\AU_CARDS
OBJS_AUCARDS = $(DIR_AUCARDS)\AU_CARDS.OBJ $(DIR_AUCARDS)\DMAIRQ.OBJ $(DIR_AUCARDS)\SC_WAV.OBJ $(DIR_AUCARDS)\SC_NULL.OBJ
OBJS_AUCARDS_DOS  = $(DIR_AUCARDS)\PCIBIOS.OBJ $(DIR_AUCARDS)\AC97_DEF.OBJ $(DIR_AUCARDS)\SC_ESS.OBJ $(DIR_AUCARDS)\SC_GUS.OBJ 
OBJS_AUCARDS_DOS += $(DIR_AUCARDS)\SC_SB16.OBJ $(DIR_AUCARDS)\SC_SBPRO.OBJ $(DIR_AUCARDS)\SC_WSS.OBJ $(DIR_AUCARDS)\SC_CMI.OBJ 
OBJS_AUCARDS_DOS += $(DIR_AUCARDS)\SC_E1371.OBJ $(DIR_AUCARDS)\SC_ICH.OBJ $(DIR_AUCARDS)\SC_INTHD.OBJ $(DIR_AUCARDS)\SC_SBLIV.OBJ 
OBJS_AUCARDS_DOS += $(DIR_AUCARDS)\SC_SBL24.OBJ $(DIR_AUCARDS)\SC_VIA82.OBJ $(DIR_AUCARDS)\SC_MIDAS.OBJ
!ifdef BUILD_DOS4G
OBJS_AUCARDS += $(OBJS_AUCARDS_DOS)
!else
!ifdef BUILD_DOS32
OBJS_AUCARDS += $(OBJS_AUCARDS_DOS)
!else
OBJS_AUCARDS += $(DIR_AUCARDS)\SC_WINDS.OBJ $(DIR_AUCARDS)\SC_WINWO.OBJ
!endif
!endif
LIBS_MPXPLAY = $(LIB_AUCARDS)

#--- AU_MIXER lib -------------------------------------------------------------
LIB_AUMIXER = $(BUILDDIR)\au_mixer.LIB
DIR_AUMIXER = $(PROJECT_LIBDIR)\AU_MIXER
OBJS_AUMIXER = $(DIR_AUMIXER)\ANALISER.OBJ $(DIR_AUMIXER)\AU_MIXER.OBJ $(DIR_AUMIXER)\CUTSILEN.OBJ $(DIR_AUMIXER)\CV_BITS.OBJ $(DIR_AUMIXER)\CV_CHAN.OBJ 
OBJS_AUMIXER+= $(DIR_AUMIXER)\CV_FREQ.OBJ $(DIR_AUMIXER)\FX_SURR.OBJ $(DIR_AUMIXER)\FX_TONE.OBJ $(DIR_AUMIXER)\MX_AVOL.OBJ $(DIR_AUMIXER)\MX_CROSF.OBJ $(DIR_AUMIXER)\MX_VOLUM.OBJ
LIBS_MPXPLAY += $(LIB_AUMIXER)

#--- DISPLAY lib --------------------------------------------------------------
LIB_DISPLAY = $(BUILDDIR)\display.LIB
DIR_DISPLAY = $(PROJECT_LIBDIR)\DISPLAY
OBJS_DISPLAY = $(DIR_DISPLAY)\DISPLAY.OBJ $(DIR_DISPLAY)\BUTTONS.OBJ $(DIR_DISPLAY)\LCD.OBJ $(DIR_DISPLAY)\TEXTWIN.OBJ $(DIR_DISPLAY)\VISUALPI.OBJ
LIBS_MPXPLAY += $(LIB_DISPLAY)

#--- CONTROL lib ---------------------------------------------------------------
LIB_CONTROL = $(BUILDDIR)\control.LIB
DIR_CONTROL = $(PROJECT_LIBDIR)\CONTROL
OBJS_CONTROL = $(DIR_CONTROL)\CONTROL.OBJ $(DIR_CONTROL)\FASTLIST.OBJ $(DIR_CONTROL)\JOY.OBJ $(DIR_CONTROL)\KEYCTRL.OBJ $(DIR_CONTROL)\KEYGROUP.OBJ 
OBJS_CONTROL+= $(DIR_CONTROL)\MOUSE.OBJ $(DIR_CONTROL)\SERIAL.OBJ $(DIR_CONTROL)\STARTUP.OBJ
LIBS_MPXPLAY += $(LIB_CONTROL)

#--- DECODERS lib --------------------------------------------------------------
LIB_DECODERS = $(BUILDDIR)\decoders.LIB
DIR_DECODERS = $(PROJECT_LIBDIR)\DECODERS
OBJS_DECODERS = $(DIR_DECODERS)\DECODERS.OBJ $(DIR_DECODERS)\AD_AAC.OBJ $(DIR_DECODERS)\AD_AC3.OBJ $(DIR_DECODERS)\AD_ALAC.OBJ $(DIR_DECODERS)\AD_MP3.OBJ 
OBJS_DECODERS+= $(DIR_DECODERS)\AD_PCM.OBJ $(DIR_DECODERS)\AD_FFMPG.OBJ $(DIR_DECODERS)\AD_VORBI.OBJ
LIBS_MPXPLAY += $(LIB_DECODERS)

#--- DEMUXERS lib --------------------------------------------------------------
LIB_DEMUXERS = $(BUILDDIR)\demuxers.LIB
DIR_DEMUXERS = $(PROJECT_LIBDIR)\DEMUXERS
OBJS_DEMUXERS =  $(DIR_DEMUXERS)\IN_ASF.OBJ $(DIR_DEMUXERS)\IN_AVI.OBJ $(DIR_DEMUXERS)\IN_MP4.OBJ $(DIR_DEMUXERS)\IN_OGG.OBJ $(DIR_DEMUXERS)\IN_WAV.OBJ $(DIR_DEMUXERS)\IN_FFMPG.OBJ
OBJS_DEMUXERS+= $(DIR_DEMUXERS)\FFUTILS.OBJ $(DIR_DEMUXERS)\FF_FLV.OBJ $(DIR_DEMUXERS)\FF_MKV.OBJ $(DIR_DEMUXERS)\FF_MPG.OBJ $(DIR_DEMUXERS)\FF_TS.OBJ
LIBS_MPXPLAY += $(LIB_DEMUXERS)

#--- DEPARSER lib --------------------------------------------------------------
LIB_DEPARSER = $(BUILDDIR)\deparser.LIB
DIR_DEPARSER = $(PROJECT_LIBDIR)\DEPARSER
OBJS_DEPARSER = $(DIR_DEPARSER)\IN_AAC.OBJ $(DIR_DEPARSER)\IN_AC3.OBJ $(DIR_DEPARSER)\IN_APE.OBJ $(DIR_DEPARSER)\IN_FLAC.OBJ $(DIR_DEPARSER)\IN_MP3.OBJ
OBJS_DEPARSER+= $(DIR_DEPARSER)\IN_MPC.OBJ $(DIR_DEPARSER)\IN_WAVPA.OBJ $(DIR_DEPARSER)\IN_RAWAU.OBJ $(DIR_DEPARSER)\TAGGING.OBJ
LIBS_MPXPLAY += $(LIB_DEPARSER)

#--- DISKDRIV lib --------------------------------------------------------------
LIB_DISKDRIV = $(BUILDDIR)\diskdriv.LIB
DIR_DISKDRIV = $(PROJECT_LIBDIR)\DISKDRIV
OBJS_DISKDRIV = $(DIR_DISKDRIV)\DISKDRIV.OBJ $(DIR_DISKDRIV)\DRV_CD.OBJ $(DIR_DISKDRIV)\DRV_HD.OBJ $(DIR_DISKDRIV)\DRV_FTP.OBJ $(DIR_DISKDRIV)\DRV_HTTP.OBJ
OBJS_DISKDRIV+= $(DIR_DISKDRIV)\DRV_ICE.OBJ $(DIR_DISKDRIV)\CD_ASPI.OBJ $(DIR_DISKDRIV)\CD_MSCD.OBJ $(DIR_DISKDRIV)\OPEN_FTP.OBJ $(DIR_DISKDRIV)\TCPCOMON.OBJ
LIBS_MPXPLAY += $(LIB_DISKDRIV)

#--- NEWFUNC lib --------------------------------------------------------------
LIB_NEWFUNC = $(BUILDDIR)\newfunc.LIB
DIR_NEWFUNC = $(PROJECT_LIBDIR)\NEWFUNC
OBJS_NEWFUNC = $(DIR_NEWFUNC)\NEWFUNC.OBJ $(DIR_NEWFUNC)\BITSTRM.OBJ $(DIR_NEWFUNC)\CPU.OBJ $(DIR_NEWFUNC)\DLL_LOAD.OBJ 
OBJS_NEWFUNC+= $(DIR_NEWFUNC)\DPMI.OBJ $(DIR_NEWFUNC)\DRIVEHND.OBJ $(DIR_NEWFUNC)\ERRORHND.OBJ $(DIR_NEWFUNC)\FILEHAND.OBJ $(DIR_NEWFUNC)\FPU.OBJ
OBJS_NEWFUNC+= $(DIR_NEWFUNC)\KEYBOARD.OBJ $(DIR_NEWFUNC)\MEMORY.OBJ $(DIR_NEWFUNC)\MIXED.OBJ $(DIR_NEWFUNC)\STRING.OBJ $(DIR_NEWFUNC)\TEXTDISP.OBJ 
OBJS_NEWFUNC+= $(DIR_NEWFUNC)\TIME.OBJ $(DIR_NEWFUNC)\THREADS.OBJ $(DIR_NEWFUNC)\TIMER.OBJ
LIBS_MPXPLAY += $(LIB_NEWFUNC)

#--- PLAYLIST lib --------------------------------------------------------------
LIB_PLAYLIST = $(BUILDDIR)\playlist.LIB
DIR_PLAYLIST = $(PROJECT_LIBDIR)\PLAYLIST
OBJS_PLAYLIST = $(DIR_PLAYLIST)\PLAYLIST.OBJ $(DIR_PLAYLIST)\CHKENTRY.OBJ $(DIR_PLAYLIST)\DISKFILE.OBJ $(DIR_PLAYLIST)\EDITLIST.OBJ 
OBJS_PLAYLIST+= $(DIR_PLAYLIST)\FILEINFO.OBJ $(DIR_PLAYLIST)\ID3LIST.OBJ $(DIR_PLAYLIST)\JUKEBOX.OBJ $(DIR_PLAYLIST)\LOADDIR.OBJ
OBJS_PLAYLIST+= $(DIR_PLAYLIST)\LOADLIST.OBJ $(DIR_PLAYLIST)\LOADSUB.OBJ $(DIR_PLAYLIST)\RANDLIST.OBJ $(DIR_PLAYLIST)\SAVELIST.OBJ 
OBJS_PLAYLIST+= $(DIR_PLAYLIST)\SKIPLIST.OBJ $(DIR_PLAYLIST)\SORTLIST.OBJ $(DIR_PLAYLIST)\TEXTCONV.OBJ
LIBS_MPXPLAY += $(LIB_PLAYLIST)

#--- VIDEOOUT lib --------------------------------------------------------------
LIB_VIDEOOUT = $(BUILDDIR)\videoout.LIB
DIR_VIDEOOUT = $(PROJECT_LIBDIR)\VIDEOOUT
OBJS_VIDEOOUT = $(DIR_VIDEOOUT)\VIDEOOUT.OBJ $(DIR_VIDEOOUT)\VO_VESA.OBJ
LIBS_MPXPLAY += $(LIB_VIDEOOUT)

#################################################################################
#--- AD_AAC lib --------------------------------------------------------------
LIB_AD_AAC = $(BUILDDIR)\ad_aac.LIB
DIR_AD_AAC = $(DIR_DECODERS)\AD_AAC
OBJS_AD_AAC  = $(DIR_AD_AAC)\BITS.OBJ $(DIR_AD_AAC)\CFFT.OBJ $(DIR_AD_AAC)\COMMON.OBJ $(DIR_AD_AAC)\DECODER.OBJ $(DIR_AD_AAC)\DRC.OBJ 
OBJS_AD_AAC += $(DIR_AD_AAC)\FILTBANK.OBJ $(DIR_AD_AAC)\HCR.OBJ $(DIR_AD_AAC)\HUFFMAN.OBJ $(DIR_AD_AAC)\IC_PREDI.OBJ
OBJS_AD_AAC += $(DIR_AD_AAC)\LT_PREDI.OBJ $(DIR_AD_AAC)\MDCT.OBJ $(DIR_AD_AAC)\MP4.OBJ $(DIR_AD_AAC)\MS_IS.OBJ $(DIR_AD_AAC)\OUTPUT.OBJ 
OBJS_AD_AAC += $(DIR_AD_AAC)\PNS.OBJ $(DIR_AD_AAC)\PULSE.OBJ $(DIR_AD_AAC)\RVLC.OBJ $(DIR_AD_AAC)\SBR_DCT.OBJ $(DIR_AD_AAC)\SBR_DEC.OBJ
OBJS_AD_AAC += $(DIR_AD_AAC)\SBR_E_NF.OBJ $(DIR_AD_AAC)\SBR_FBT.OBJ $(DIR_AD_AAC)\SBR_HFAD.OBJ $(DIR_AD_AAC)\SBR_HFGE.OBJ 
OBJS_AD_AAC += $(DIR_AD_AAC)\SBR_QMF.OBJ $(DIR_AD_AAC)\SBR_SYNT.OBJ $(DIR_AD_AAC)\SBR_TF_G.OBJ $(DIR_AD_AAC)\SPECREC.OBJ
OBJS_AD_AAC += $(DIR_AD_AAC)\SYNTAX.OBJ $(DIR_AD_AAC)\TNS.OBJ
LIBS_MPXPLAY += $(LIB_AD_AAC)

#--- AD_AC3 lib --------------------------------------------------------------
LIB_AD_AC3 = $(BUILDDIR)\ad_ac3.LIB
DIR_AD_AC3 = $(DIR_DECODERS)\AD_AC3
OBJS_AD_AC3 = $(DIR_AD_AC3)\BIT_ALLO.OBJ $(DIR_AD_AC3)\BITSTREA.OBJ $(DIR_AD_AC3)\CRC.OBJ $(DIR_AD_AC3)\IMDCT.OBJ $(DIR_AD_AC3)\PARSE.OBJ
LIBS_MPXPLAY += $(LIB_AD_AC3)

#--- AD_APE lib --------------------------------------------------------------
LIB_AD_APE = $(BUILDDIR)\ad_ape.LIB
DIR_AD_APE = $(DIR_DECODERS)\AD_APE
OBJS_AD_APE  = $(DIR_AD_APE)\APEINFO.OBJ $(DIR_AD_APE)\DEC_NEW.OBJ $(DIR_AD_APE)\DEC_OLD.OBJ $(DIR_AD_APE)\MACLIB.OBJ $(DIR_AD_APE)\PRED_NEW.OBJ 
OBJS_AD_APE += $(DIR_AD_APE)\PRED_OLD.OBJ $(DIR_AD_APE)\PREPARE.OBJ $(DIR_AD_APE)\UNBITBAS.OBJ $(DIR_AD_APE)\UNBITNEW.OBJ $(DIR_AD_APE)\UNBITOLD.OBJ
LIBS_MPXPLAY += $(LIB_AD_APE)

#--- AD_MP3 lib --------------------------------------------------------------
LIB_AD_MP3 = $(BUILDDIR)\ad_mp3.LIB
DIR_AD_MP3 = $(DIR_DECODERS)\AD_MP3
OBJS_AD_MP3  = $(DIR_AD_MP3)\LAYER2.OBJ $(DIR_AD_MP3)\LAYER3.OBJ
LIBS_MPXPLAY += $(LIB_AD_MP3)

#--- AD_MPC lib --------------------------------------------------------------
LIB_AD_MPC = $(BUILDDIR)\ad_mpc.LIB
DIR_AD_MPC = $(DIR_DECODERS)\AD_MPC
OBJS_AD_MPC  = $(DIR_AD_MPC)\BITS_MPC.OBJ $(DIR_AD_MPC)\HUFF_NEW.OBJ $(DIR_AD_MPC)\MPCDEC.OBJ $(DIR_AD_MPC)\REQUANT.OBJ
LIBS_MPXPLAY += $(LIB_AD_MPC)

#--- AD_VORBI lib --------------------------------------------------------------
LIB_AD_VORBI = $(BUILDDIR)\ad_vorbi.LIB
DIR_AD_VORBI = $(DIR_DECODERS)\AD_VORBI
OBJS_AD_VORBI = $(DIR_AD_VORBI)\BITWISE.OBJ $(DIR_AD_VORBI)\BLOCK.OBJ $(DIR_AD_VORBI)\CODEBOOK.OBJ $(DIR_AD_VORBI)\FLOOR0.OBJ $(DIR_AD_VORBI)\FLOOR1.OBJ 
OBJS_AD_VORBI+= $(DIR_AD_VORBI)\FRAMING.OBJ $(DIR_AD_VORBI)\INFO.OBJ $(DIR_AD_VORBI)\MAPPING0.OBJ $(DIR_AD_VORBI)\RES0.OBJ $(DIR_AD_VORBI)\SHARBOOK.OBJ 
OBJS_AD_VORBI+= $(DIR_AD_VORBI)\SYNTHESI.OBJ $(DIR_AD_VORBI)\WINDOW.OBJ $(DIR_AD_VORBI)\LSP.OBJ $(DIR_AD_VORBI)\MDCT_VOR.OBJ
LIBS_MPXPLAY += $(LIB_AD_VORBI)

#--- AD_WAVPA lib --------------------------------------------------------------
LIB_AD_WAVPA = $(BUILDDIR)\ad_wavpa.LIB
DIR_AD_WAVPA = $(DIR_DECODERS)\AD_WAVPA
OBJS_AD_WAVPA  = $(DIR_AD_WAVPA)\BITS_WP.OBJ $(DIR_AD_WAVPA)\FLOAT.OBJ $(DIR_AD_WAVPA)\METADATA.OBJ $(DIR_AD_WAVPA)\UNPACK.OBJ $(DIR_AD_WAVPA)\WORDS.OBJ $(DIR_AD_WAVPA)\WPUTILS.OBJ
LIBS_MPXPLAY += $(LIB_AD_WAVPA)

#--- FFMPEGAC lib --------------------------------------------------------------
LIB_FFMPEGAC = $(BUILDDIR)\ffmpegac.LIB
DIR_FFMPEGAC = $(DIR_DECODERS)\FFMPEGAC
OBJS_FFMPEGAC  = $(DIR_FFMPEGAC)\BITS_FFM.OBJ $(DIR_FFMPEGAC)\CRC_FFMP.OBJ $(DIR_FFMPEGAC)\FLAC.OBJ $(DIR_FFMPEGAC)\GOLOMB.OBJ 
OBJS_FFMPEGAC += $(DIR_FFMPEGAC)\MEM.OBJ $(DIR_FFMPEGAC)\UTILS.OBJ $(DIR_FFMPEGAC)\WMADEC.OBJ $(DIR_FFMPEGAC)\FFT.OBJ $(DIR_FFMPEGAC)\MDCT_FFM.OBJ
LIBS_MPXPLAY += $(LIB_FFMPEGAC)

#################################################################################

all: $(EXE_MPXPLAY)

.C : $(DIR_MAIN);$(DIR_AUCARDS);$(DIR_AUMIXER);$(DIR_DISPLAY);$(DIR_CONTROL);$(DIR_DECODERS);$(DIR_DEMUXERS);$(DIR_DEPARSER);
.C : $(DIR_DISKDRIV);$(DIR_NEWFUNC);$(DIR_PLAYLIST);$(DIR_VIDEOOUT);$(DIR_AD_AAC);$(DIR_AD_AC3);$(DIR_AD_APE);$(DIR_AD_MP3);
.C : $(DIR_AD_MPC);$(DIR_AD_VORBI);$(DIR_AD_WAVPA);$(DIR_FFMPEGAC);

$(LIB_AUCARDS): $(OBJS_AUCARDS)
	$(AR) $(ARFLAGS) $@ $(OBJS_AUCARDS)
	$(DEL_LIB_OBJS)

$(LIB_AUMIXER): $(OBJS_AUMIXER)
	$(WASM) $(AFLAGS) $(DIR_AUMIXER)\ANALIASM.ASM $(CCOUT)$(DIR_AUMIXER)\ANALIASM.obj
	$(AR) $(ARFLAGS) $@ $(OBJS_AUMIXER) $(DIR_AUMIXER)\ANALIASM.obj
	$(RM) $(DIR_AUMIXER)\ANALIASM.obj
	$(DEL_LIB_OBJS)

$(LIB_CONTROL): $(OBJS_CONTROL)
	$(AR) $(ARFLAGS) $@ $(OBJS_CONTROL)
	$(DEL_LIB_OBJS)

$(LIB_DECODERS): $(OBJS_DECODERS)
	$(AR) $(ARFLAGS) $@ $(OBJS_DECODERS)
	$(DEL_LIB_OBJS)

$(LIB_DEMUXERS): $(OBJS_DEMUXERS)
	$(AR) $(ARFLAGS) $@ $(OBJS_DEMUXERS)
	$(DEL_LIB_OBJS)

$(LIB_DEPARSER): $(OBJS_DEPARSER)
	$(AR) $(ARFLAGS) $@ $(OBJS_DEPARSER)
	$(DEL_LIB_OBJS)

$(LIB_DISKDRIV): $(OBJS_DISKDRIV)
	$(AR) $(ARFLAGS) $@ $(OBJS_DISKDRIV)
	$(DEL_LIB_OBJS)

$(LIB_DISPLAY): $(OBJS_DISPLAY)
	$(AR) $(ARFLAGS) $@ $(OBJS_DISPLAY)
	$(DEL_LIB_OBJS)

$(LIB_NEWFUNC): $(OBJS_NEWFUNC)
	$(AR) $(ARFLAGS) $@ $(OBJS_NEWFUNC)
	$(DEL_LIB_OBJS)

$(LIB_PLAYLIST): $(OBJS_PLAYLIST)
	$(AR) $(ARFLAGS) $@ $(OBJS_PLAYLIST)
	$(DEL_LIB_OBJS)

$(LIB_VIDEOOUT): $(OBJS_VIDEOOUT)
	$(AR) $(ARFLAGS) $@ $(OBJS_VIDEOOUT)
	$(DEL_LIB_OBJS)

#---------------------------------------------------------------------------------
$(LIB_AD_AAC): $(OBJS_AD_AAC)
	$(AR) $(ARFLAGS) $@ $(OBJS_AD_AAC)
	$(DEL_LIB_OBJS)

$(LIB_AD_AC3): $(OBJS_AD_AC3)
	$(AR) $(ARFLAGS) $@ $(OBJS_AD_AC3)
	$(DEL_LIB_OBJS)

$(LIB_AD_APE): $(OBJS_AD_APE)
	$(WASM) $(AFLAGS) $(DIR_AD_APE)\APEMMX.ASM $(CCOUT)$(DIR_AD_APE)\APEMMX.obj
	$(AR) $(ARFLAGS) $@ $(OBJS_AD_APE) $(DIR_AD_APE)\APEMMX.obj
	$(RM) $(DIR_AD_APE)\APEMMX.obj
	$(DEL_LIB_OBJS)

$(LIB_AD_MP3): $(OBJS_AD_MP3)
	$(WASM) $(AFLAGS) -dOW $(DIR_AD_MP3)\L3_DEQ.ASM $(CCOUT)$(DIR_AD_MP3)\L3_DEQ.obj
	$(WASM) $(AFLAGS) $(DIR_AD_MP3)\L3_MDCT.ASM $(CCOUT)$(DIR_AD_MP3)\L3_MDCT.obj
	$(WASM) $(AFLAGS) $(DIR_AD_MP3)\SYNTH.ASM $(CCOUT)$(DIR_AD_MP3)\SYNTH.obj
	$(AR) $(ARFLAGS) $@ $(OBJS_AD_MP3) $(DIR_AD_MP3)\L3_DEQ.obj $(DIR_AD_MP3)\L3_MDCT.obj $(DIR_AD_MP3)\SYNTH.obj
	$(RM) $(DIR_AD_MP3)\L3_DEQ.obj
	$(RM) $(DIR_AD_MP3)\L3_MDCT.obj
	$(RM) $(DIR_AD_MP3)\SYNTH.obj
	$(DEL_LIB_OBJS)

$(LIB_AD_MPC): $(OBJS_AD_MPC)
	$(AR) $(ARFLAGS) $@ $(OBJS_AD_MPC)
	$(DEL_LIB_OBJS)

$(LIB_AD_VORBI): $(OBJS_AD_VORBI)
	$(AR) $(ARFLAGS) $@ $(OBJS_AD_VORBI)
	$(DEL_LIB_OBJS)

$(LIB_AD_WAVPA): $(OBJS_AD_WAVPA)
	$(AR) $(ARFLAGS) $@ $(OBJS_AD_WAVPA)
	$(DEL_LIB_OBJS)

$(LIB_FFMPEGAC): $(OBJS_FFMPEGAC)
	$(AR) $(ARFLAGS) $@ $(OBJS_FFMPEGAC)
	$(DEL_LIB_OBJS)

#------------------------------------------------------------------------------------
.C.OBJ: .AUTODEPEND
	$(CC) $(CFLAGS) $(CCOUT)$@ $<

$(EXE_MPXPLAY): $(OBJS_MAIN) $(LIBS_MPXPLAY) MAKEWC $(LINK_DESCRIPTOR)
	$(WLINK) @$(LINK_DESCRIPTOR)
	$(RM) *.obj

clean : .symbolic
	$(RM) $(BUILDDIR)\*.LIB
