#	Makefile.MSVC: MSVC Makefile for LAME
#
#	2000-2010 Robert Hegemann
#	dedicated to the LAME project https://lame.sourceforge.io/
###############################################################################



#__ readme ____________________________________________________________________
#	nmake -f Makefile.MSVC
#		-> build lame, but not mp3x
#		-> use Robert's code modifications
#		-> assume MSVC 6.0 compiler available
#		-> assume NASM available
#		-> assemble MMX code with NASM
#		-> no compiler warnings
#       -> use single precision float
#
#	passing arguments, one can modify the default behaviour:
#	COMP=<not INTEL or BCC>    ->  use MS compiler
#	WARN=<anything but OFF>    ->  give verbose compiler warnings
#	ASM=<anything but YES>     ->  no NASM nor MMX
#	MMX=<anything but YES>     ->  do not assemble MMX code
#	CFG=<anything but RH>      ->  disable Robert's modifications
#	CPU=P1                     ->  optimize for Pentium instead of P II/III
#	CPU=P2                     ->  optimize for Pentium II/III, you need a PII or better
#	CPU=P3                     ->  optimize for Pentium III, you need a PIII or better
#	GTK=YES                    ->  have GTK, adds mp3x to default targets
#	PREC=<anything but SINGLE> ->  use double instead of single float
#	SNDFILE=<anything but YES> ->  do not use LibSndfile for reading input files
#
#	Example:
#	nmake -f Makefile.MSVC CPU=P1 GTK=YES
#____________________________________________________________________ readme __



#	targets <-> DOS filenames

T_LAME = lame.exe
T_MP3X = mp3x.exe
T_MP3RTP = mp3rtp.exe
T_DLL = libmp3lame.dll
T_LIB_DYNAMIC = libmp3lame.lib
T_LIB_STATIC = libmp3lame-static.lib
T_LEGACY_DLL = lame_enc.dll

TARGET_DIR = .\output\ 

#	default targets

PGM = $(T_LAME)

#	some default settings

!	IF "$(MSVCVER)" != ""
COMP = MS
!	IF "$(MSVCVER)" == "Win64"
!	IF "$(ASM)" == ""
ASM = NO # or it could be ML64 if we want to use it...
GTK = NO
!	ENDIF
!	ENDIF
!	ELSE
!	IF "$(COMP)" == ""
COMP = MSVC
!	ENDIF
!	ENDIF

!	IF "$(ASM)" == ""
ASM = YES
!	ENDIF

!	IF "$(MMX)" == ""
MMX = YES
!	ENDIF

!	IF "$(CFG)" == ""
CFG = RH
!	ENDIF

!	IF "$(CPU)" == ""
CPU = P2auto
!if "$(PROCESSOR_LEVEL)"=="6"
CPU = P6
!endif
!	ENDIF

!	IF "$(WARN)" == ""
WARN = OFF
!	ENDIF

!	IF "$(PREC)" == ""
PREC = SINGLE
!	ENDIF

!	IF "$(SNDFILE)" == ""
SNDFILE = NO
!	ENDIF

OFF = win32
MACHINE = /machine:I386
LIB_OPTS = /nologo $(MACHINE) 

!	MESSAGE ----------------------------------------------------------------------
!	IF "$(CFG)" == ""
!	 MESSAGE building LAME
!	ELSE
!	 MESSAGE building LAME featuring $(CFG)
!	ENDIF
!	IF "$(ASM)" == "YES"
!	 MESSAGE + ASM
!	 IF "$(MMX)" == "YES"
!	  MESSAGE + MMX
!	 ENDIF
!	ENDIF
!	IF "$(GTK)" == "YES"
!	 MESSAGE + GTK
!	ENDIF
!	IF "$(COMP)" == "INTEL"
!	 MESSAGE using INTEL COMPILER
!	 IF "$(CPU)" == "P1"
!	  MESSAGE + optimizing for Pentium (MMX)
!	 ELSE
!	  IF "$(CPU)" == "P2"
!	   MESSAGE + you need a Pentium II or better
!	  ELSE
!	   IF "$(CPU)" == "P3"
!	    MESSAGE + you need a Pentium III or better
!	   ELSE
!	    MESSAGE + optimizing for Pentium II/III
!	   ENDIF
!	  ENDIF
!	 ENDIF
!	ELSE
!	 IF "$(MSVCVER)" == "6.0"
!	  MESSAGE + using MSVC 6.0 32-Bit Compiler
!	  IF "$(CPU)" == "P1"
!	   MESSAGE + optimizing for Pentium (MMX) (may slow down PIII a few percent)
!	  ELSE
!	   MESSAGE + optimizing for Pentium II/III
!	  ENDIF
!	 ELSEIF "$(MSVCVER)" == "8.0"
!	  MESSAGE + using MSVC 8.0 32-Bit Compiler
!	  IF "$(CPU)" == "P1"
!	   MESSAGE + optimizing for Pentium (MMX) (may slow down PIII a few percent)
!	  ELSE
!	   MESSAGE + optimizing for Pentium II/III
!	  ENDIF
!	 ELSE
!	  IF "$(MSVCVER)" == "Win64"
!	   MESSAGE + using MS 64-Bit Compiler
!	  ELSE
!	   MESSAGE using MS COMPILER
!	   IF "$(CPU)" == "P1"
!	    MESSAGE + optimizing for Pentium (MMX) (may slow down PIII a few percent)
!	   ELSE
!	    MESSAGE + optimizing for Pentium II/III
!	   ENDIF
!	  ENDIF
!	 ENDIF
!	ENDIF
!	IF "$(PREC)" == "SINGLE"
!	 MESSAGE + using Single precision
!	ENDIF
!	IF "$(SNDFILE)" == "YES"
!	 MESSAGE + using LibSndfile reading input files
!	ENDIF
!	MESSAGE ----------------------------------------------------------------------

!	IF "$(COMP)" != "INTEL"
!	IF "$(COMP)" != "BCC"

#__ Microsoft C options _______________________________________________________
#
#	/O2     maximize speed
#	/Ob<n>  inline expansion
#	/Og     enable global optimizations
#	/Oi     enable intrinsic functions
#	/Ot     favor code speed
#	/Oy     enable frame pointer omission
#	/G5     Pentium optimization
#	/G6     Pentium II/III optimization
#	/GA     optimize for Windows Application
#	/GF     enable read-only string pooling
#	/Gf     enable string spooling
#	/Gs     disable stack checking calls
#	/Gy     separate functions for linker
#	/QIfdiv generate code for Pentium FDIV fix
#	/QI0f   generate code for Pentium 0x0f erratum fix
#
#	remarks:
#	 - aliasing options seem to break code
#	 - try to get the Intel compiler demonstration code!
#	   ICL produces faster code.

# debugging options
# CC_OPTS = /nologo /Zi /Ge /GZ
# LN_OPTS = /nologo /debug:full /debugtype:cv /fixed:no

# profiling options
# CC_OPTS = /nologo /Zi /O2b2gity /G6As /DNDEBUG
# LN_OPTS = /nologo /debug:full /debugtype:cv /fixed:no /profile

# release options
!	IF "$(MSVCVER)" == "Win64"
CC_OPTS = /nologo /DWin64 /O2b2ity /GAy /Gs1024 /Zp8 /GL /GS- /Zi
!	ELSEIF "$(MSVCVER)" == "8.0"
CC_OPTS = /nologo /O2 /Wp64 /Oi /GL /arch:SSE /fp:precise
!	ELSEif "$(CPU)"=="P6"
CC_OPTS = /nologo /O2 /Ob2 /GAy /Gs1024 /Zp8 /Zi
!else
CC_OPTS = /nologo /O2 /Ob2 /GAy /Gs1024 /QIfdiv /QI0f /YX
!	ENDIF

!	IF "$(MSVCVER)" == "6.0"
!	IF "$(CPU)" == "P1"
CC_OPTS = $(CC_OPTS) /G5
!	ELSE
CC_OPTS = $(CC_OPTS) /G6
!	ENDIF
!	ENDIF

!	IF "$(WARN)" == "OFF"
CC_OPTS = $(CC_OPTS) /w
!	ELSE
CC_OPTS = $(CC_OPTS) /W$(WARN)
!	ENDIF

!	IF "$(PREC)" == "SINGLE"
CC_OPTS = $(CC_OPTS) /DFLOAT8=float /DREAL_IS_FLOAT=1
!	ENDIF

# temporary remove NDEBUG, see configure.in
#CC_OPTS = $(CC_OPTS) /DNDEBUG /MT
CC_OPTS = $(CC_OPTS) /MT

LN_OPTS = /nologo /pdb:none
LN_DLL = /nologo /DLL

CC_OUT = /Fo
LN_OUT = /OUT:

CC = cl
LN = link

#_______________________________________________________ Microsoft C options __


!	ELSE

#__ Borland BCC options _______________________________________________________
#
#	first draft, DLL not working, generates very slow code!
BCCINST = C:/Borland/BCC55

CC_OPTS = -pc -q -ff -fp -jb -j1 -tWC -tWM -O2 -OS -I$(BCCINST)/include -DNDEBUG -DWIN32
# dll >> -tWD
LN_OPTS = -lGn -lGi -lap -lx -L$(BCCINST)/lib
# dll >> -Tpd
!	IF "$(CPU)" == "P1"
CC_OPTS = $(CC_OPTS) -5
!	ELSE
CC_OPTS = $(CC_OPTS) -6
!	ENDIF

!	IF "$(WARN)" == "OFF"
CC_OPTS = $(CC_OPTS) -w-
!	ELSE
CC_OPTS = $(CC_OPTS)
!	ENDIF

LN_DLL =
#$(CCINST)/lib/cw32R.lib
LN_OUT = -e
CC_OUT = -o

CC = bcc32
LN = bcc32

OFF = obj

!	ENDIF
#_______________________________________________________ Borland BCC options __


!	ELSE

#__ Intel 4.5 options _________________________________________________________
#
#	/YX         enable automatic precompiled header file creation/usage
#	/Ox         maximum optimization same as /O2 without /Gfy
#	/O2         same as /Gfsy /Ob1gyti
#	/Gd      1) make cdecl the default calling convention
#	/G5      2) optimized for Pentium
#	/G6      3) optimized for Pentium II/III
#	/GA         assume single threaded
#	/Gs[n]      disable stack checks for functions with <n bytes of locals
#	/GF         read-only string pooling optimization
#	/Gy         separate functions for the linker
#	/Qunroll    unroll loops with default heuristic
#	/QIfist     enable fast float to int conversion
#	/QIfdiv     enable patch for Pentium with FDIV erratum
#	/QI0f       enable patch for Pentium with 0f erratum
#	/Qip     2) enable single-file IP optimizations (within files)
#	/Qipo       enable multi-file IP optimizations (between files)
#	/Qipo_wp 4) enable entire program multi-file IP optimizations
#	/QaxiMK     automatic use of specialized code for PII/III, MMX, SIMD
#
#	remarks:
#	1) slows speed down, not using
#	2) faster compared to 3) or 4) on Pentium MMX at 200 MHz

!	IF "$(CPU)" == "P1"
CC_OPTS = /G5 /QaxiMK /QIfdiv /QI0f
!	ELSE
!	IF "$(CPU)" == "P2"
CC_OPTS = /G6 /Qxi /QaxMK
!	ELSE
!	IF "$(CPU)" == "P3"
CC_OPTS = /G6 /QxiMK
!	ELSE
CC_OPTS = /G6 /QaxiMK /QIfdiv /QI0f
!	ENDIF
!	ENDIF
!	ENDIF

!	IF "$(WARN)" == "OFF"
CC_OPTS = $(CC_OPTS) /w
!	ELSE
CC_OPTS = $(CC_OPTS) /W2 /Wport
!	ENDIF

!	IF "$(PREC)" == "SINGLE"
CC_OPTS = $(CC_OPTS) /DFLOAT8=float /DREAL_IS_FLOAT=1
!	ENDIF

CC_OPTS = /nologo /DNDEBUG /YX /GA /Ox /Ob2 \
          /Qunroll /Qsox- /Qip $(CC_OPTS)


LN_OPTS = $(CC_OPTS)
LN_DLL = /LD
LN_OUT = /Fe
CC_OUT = /Fo

CC = icl
LN = icl
#_________________________________________________________ Intel 4.5 options __

!	ENDIF



#__ LIBSNDFILE ________________________________________________________________
#
#	uncomment the following if you want LibSndfile for input
#	It's always a good idea to compile it in!
#
!	IF "$(SNDFILE)" == "YES"
SNDFILE_OPTS = /DLIBSNDFILE
LIBSNDFILE = $(SNDFILE_DIR)libsndfile.lib
!   ENDIF
#________________________________________________________________ LIBSNDFILE __



#-- MISC --
CPP_OPTS = /DHAVE_CONFIG_H -I.



#__ FRAME ANALYZER SUPPORT ____________________________________________________
#
#	Assuming you have "glib-dev" and "gtk+-dev" installed and the system
#	DLLs "glib-1.3.dll", "gdk-1.3.dll" and "gtk-1.3.dll" copied into the
#	"Win\System" folder
#
#	To compile in the frame analyzer support, you need the above mentioned
#	libraries. You can pass the appropriate path to them in GTK_DIRS.
#
!	IF "$(GTK)" == "YES"
!	IF "$(GTK_DIRS)" == ""
GTK_DIRS = ../3rdparty
!	ENDIF
GTK_OPTS = -I$(GTK_DIRS)/glib     \
           -I$(GTK_DIRS)/gtk+     \
           -I$(GTK_DIRS)/gtk+/gtk \
           -I$(GTK_DIRS)/gtk+/gdk
GTK_LIBS = $(GTK_DIRS)/gtk+/gtk/gtk-1.3.lib \
           $(GTK_DIRS)/gtk+/gdk/gdk-1.3.lib \
           $(GTK_DIRS)/glib/glib-1.3.lib

PGM = $(T_MP3X) $(PGM)
!	ELSE
!	IF "$(GTK)" == ""
!	MESSAGE Pass GTK=YES to build the frame analyzer. (requires installed GTK)
!	ENDIF
!	ENDIF
#____________________________________________________ FRAME ANALYZER SUPPORT __



#__ HIP DECODING ______________________________________________________________
#
#	uncomment the following if you want decoding support
#	It's always a good idea to compile it in!
#
CPP_OPTS = $(CPP_OPTS) /DHAVE_MPGLIB
#___________________________________________________________ HIP DECODING _____



#__ Takehiro's IEEE hack ______________________________________________________
#
#	uncomment the following to enable Takehiro's IEEE hack
#	You'll want it on a x86 machine with i387 FPU
#
CPP_OPTS = $(CPP_OPTS) /DTAKEHIRO_IEEE754_HACK
#______________________________________________________ Takehiro's IEEE hack __



#__ Robert's alternate code ___________________________________________________
!	IF "$(CFG)" == "RH"
!	IF "$(MSVCVER)" == "8.0"
LIB_OPTS = $(LIB_OPTS) /LTCG
LN_OPTS = $(LN_OPTS) /LTCG
!   ENDIF
!	ENDIF
#___________________________________________________ Robert's alternate code __



CC_SWITCHES = $(CC_OPTS) $(SNDFILE_OPTS) \
              $(GTK_OPTS) /DBS_FORMAT=BINARY

LN_SWITCHES = $(LN_OPTS)

lame_sources = \
	frontend/lame_main.c

mpx_sources = \
	frontend/gpkplotting.c \
	frontend/gtkanal.c \
	frontend/mp3x.c

mp3rtp_sources = \
	frontend/rtp.c \
	frontend/mp3rtp.c

dll_sources = \
	dll/BladeMP3EncDll.c

common_sources = \
	frontend/main.c \
	frontend/get_audio.c \
	frontend/parse.c \
	frontend/timestatus.c \
	frontend/lametime.c \
	frontend/console.c \
	frontend/brhist.c

lamelib_sources = \
	libmp3lame/bitstream.c \
	libmp3lame/encoder.c \
	libmp3lame/fft.c \
	libmp3lame/gain_analysis.c \
	libmp3lame/id3tag.c \
	libmp3lame/lame.c \
	libmp3lame/newmdct.c \
	libmp3lame/psymodel.c \
	libmp3lame/quantize.c \
	libmp3lame/quantize_pvt.c \
	libmp3lame/vector/xmm_quantize_sub.c \
	libmp3lame/set_get.c \
	libmp3lame/vbrquantize.c \
	libmp3lame/reservoir.c \
	libmp3lame/tables.c \
	libmp3lame/takehiro.c \
	libmp3lame/util.c \
	libmp3lame/mpglib_interface.c \
	libmp3lame/VbrTag.c \
	libmp3lame/presets.c \
	libmp3lame/version.c

mpglib_sources = \
	mpglib/common.c \
	mpglib/dct64_i386.c \
	mpglib/decode_i386.c \
	mpglib/layer1.c \
	mpglib/layer2.c \
	mpglib/layer3.c \
	mpglib/tabinit.c \
	mpglib/interface.c


!IF "$(MSVCVER)" == "Win64"
ADDL_OBJ = bufferoverflowU.lib
!ENDIF

LIB_OBJ = $(lamelib_sources:.c=.obj)
HIP_OBJ = $(mpglib_sources:.c=.obj)
CMMN_OBJ = $(common_sources:.c=.obj)
LAME_OBJ = $(lame_sources:.c=.obj)
MPX_OBJ = $(mpx_sources:.c=.obj)
MPRTP_OBJ = $(mp3rtp_sources:.c=.obj)
DLL_OBJ = $(dll_sources:.c=.obj)

.c.obj:
	@$(CC) $(CPP_OPTS) $(CC_SWITCHES) -Iinclude -Ilibmp3lame -Impglib \
	       $(CC_OUT)$@  -c $<


#__ MASM ______________________________________________________________________
#
#	MASM: Microsoft Assembler
#
!	IF "$(ASM)" == "ML64"
#
.SUFFIXES : .nas
.nas.obj:
	@echo $<
	@ml64 -Ilibmp3lame\i386 -Sf -DWIN32 -DWIN64 $< -Fo$@

CC_SWITCHES = $(CC_SWITCHES) -DHAVE_NASM
ASM_OBJ = $(ASM_OBJ) \
	libmp3lame\i386\cpu_feat.obj \
	libmp3lame\i386\fft3dn.obj \
	libmp3lame\i386\fftsse.obj

#	not yet coded
#CC_SWITCHES = $(CC_SWITCHES) -DUSE_FFTFPU
#ASM_OBJ = $(ASM_OBJ) libmp3lame\i386\fftfpu.obj
#______________________________________________________________________ MASM __


#__ NASM ______________________________________________________________________
#
#	NASM: Netwide Assembler
#
!	ELSEIF "$(ASM)" == "YES"
#
.SUFFIXES : .nas
.nas.obj:
	@echo $<
	@nasmw -f $(OFF) -i libmp3lame/i386/ -DWIN32 $< -o $@

CC_SWITCHES = $(CC_SWITCHES) /DHAVE_NASM
ASM_OBJ = $(ASM_OBJ) \
	libmp3lame\i386\cpu_feat.obj \
	libmp3lame\i386\fft3dn.obj \
	libmp3lame\i386\fftsse.obj

#	not yet coded
#CC_SWITCHES = $(CC_SWITCHES) /DUSE_FFTFPU
#ASM_OBJ = $(ASM_OBJ) libmp3lame/i386/fftfpu.obj
#______________________________________________________________________ NASM __

!	ELSE
!	MESSAGE Pass ASM=YES to build the assembler optimizations
!	ENDIF


#__ MMX _______________________________________________________________________
#
#	you need NASM but *not necessarily* a processor with MMX
#	The above CPU feature detection code allows to run the same
#	binary on a CPU without MMX too!
#
!	IF "$(ASM)" == "YES"
!	IF "$(MMX)" == "YES"
CC_SWITCHES = $(CC_SWITCHES) /DMMX_choose_table
ASM_OBJ = $(ASM_OBJ) libmp3lame/i386/choose_table.obj
!	ENDIF
!	ENDIF
#_______________________________________________________________________ MMX __

!	MESSAGE

no_target_specified :	$(PGM)
	@echo.
	@echo --=*  $(PGM) uptodate  *=--
	@echo.

target_directory :
	@if not exist $(TARGET_DIR) mkdir $(TARGET_DIR)
	
common:	$(CMMN_OBJ)
	@echo.
	@echo --- COMMON FRONTEND STUFF UPTODATE ---
	@echo.

libA:	$(LIB_OBJ)
	@echo.
	@echo --- LAME MP3 ENCODING LIBRARY UPTODATE ---
	@echo.

libB:	$(HIP_OBJ)
	@echo.
	@echo --- HIP DECODING LIBRARY UPTODATE ---
	@echo.

lib: $(ASM_OBJ) libA libB

lame.res: ./libmp3lame/lame.rc
	@rc.exe /d "NDEBUG" /d "_APP=lame.exe" /l 0x409 /fo"./frontend/lame.res" "./libmp3lame/lame.rc"

mp3rtp.res: ./libmp3lame/lame.rc
	@rc.exe /d "NDEBUG" /d "_APP=mp3rtp.exe" /l 0x409 /fo"./frontend/mp3rtp.res" "./libmp3lame/lame.rc"

mp3x.res: ./libmp3lame/lame.rc
	@rc.exe /d "NDEBUG" /d "_APP=mp3x.exe" /l 0x409 /fo"./frontend/mp3x.res" "./libmp3lame/lame.rc"

lame_enc.res: ./libmp3lame/lame.rc
	@rc.exe /d "NDEBUG" /d "_DLL=lame_enc.dll" /l 0x409 /fo"./frontend/lame_enc.res" "./libmp3lame/lame.rc"

$(T_LAME) : target_directory config.h $(T_LIB_STATIC) common $(LAME_OBJ) lame.res
	@$(LN) $(LN_OUT)$(TARGET_DIR)$@ $(LN_SWITCHES) $(LIBSNDFILE) \
	       $(TARGET_DIR)$(T_LIB_STATIC) $(CMMN_OBJ) $(LAME_OBJ) $(ADDL_OBJ) \
	       ./frontend/lame.res
	@echo.
	@echo --=*  $(TARGET_DIR)$@ ready  *=--
	@echo.

$(T_MP3X) : target_directory config.h lib common $(MPX_OBJ) mp3x.res
	@$(LN) $(LN_OUT)$(TARGET_DIR)$@ $(LN_SWITCHES) $(GTK_LIBS) $(LIBSNDFILE) \
	       $(TARGET_DIR)$(T_LIB_STATIC) $(CMMN_OBJ) $(MPX_OBJ) $(ADDL_OBJ) \
	       ./frontend/mp3x.res
	@echo.
	@echo --=*  $(TARGET_DIR)$@ ready  *=--
	@echo.

$(T_MP3RTP) : target_directory config.h lib common $(MPRTP_OBJ) mp3rtp.res
	@$(LN) $(LN_OUT)$(TARGET_DIR)$@ $(LN_SWITCHES) $(LIBSNDFILE) \
	       $(TARGET_DIR)$(T_LIB_STATIC) $(CMMN_OBJ) $(MPRTP_OBJ) $(ADDL_OBJ) \
	       ./frontend/mp3rtp.res wsock32.lib
	@echo.
	@echo --=*  $(TARGET_DIR)$@ ready  *=--
	@echo.

$(T_LEGACY_DLL) : target_directory config.h $(DLL_OBJ) lame_enc.res
	@$(LN) $(LN_OUT)$(TARGET_DIR)$@ $(LN_SWITCHES) \
	       $(TARGET_DIR)$(T_LIB_STATIC) $(LN_DLL) \
	       $(DLL_OBJ) $(ADDL_OBJ) ./frontend/lame_enc.res user32.lib
	@echo.
	@echo --=*  $(TARGET_DIR)$@ ready  *=--
	@echo.

$(T_DLL) : target_directory config.h $(T_LIB_STATIC) 
	@$(LN) $(LN_DLL) $(MACHINE) \
		/DEF:"include\lame.def" \
		$(ADDL_OBJ) \
		$(LN_OUT)"$(TARGET_DIR)$@" \
		$(TARGET_DIR)$(T_LIB_STATIC) libmp3lame\version.obj 
	@echo.
	@echo --=*  $(TARGET_DIR)$@ ready  *=--
	@echo.

$(T_LIB_STATIC) : target_directory lib
	@lib $(LIB_OPTS) \
		/OUT:"$(TARGET_DIR)$@" \
		$(ASM_OBJ) $(LIB_OBJ) $(HIP_OBJ)
	@echo.
	@echo --=*  $(TARGET_DIR)$@ ready  *=--
	@echo.
		
config.h : configMS.h
	@-copy configMS.h config.h

clean:
	@-del $(TARGET_DIR)$(T_LAME)
	@-del $(TARGET_DIR)$(T_MP3X)
	@-del $(TARGET_DIR)$(T_MP3RTP)
	@-del $(TARGET_DIR)$(T_DLL)
	@-del $(TARGET_DIR)$(T_LIB_STATIC)
	@-del $(TARGET_DIR)$(T_LIB_DYNAMIC)
	@-del $(TARGET_DIR)$(T_LEGACY_DLL)
	@-del lame.pdb
	@-del icl.pch
	@-del $(TARGET_DIR)lame_enc.*
	@-del frontend\*.obj
	@-del dll\*.obj
	@-del mpglib\*.obj
	@-del libmp3lame\*.obj
	@-del libmp3lame\i386\*.obj
	@-del libmp3lame\vector\*.obj
	@-del libmp3lame\*.res
	@-del frontend\*.res


rebuild: clean all


lame	:	$(T_LAME)
lame_enc:	$(T_LEGACY_DLL)
dll 	:	$(T_DLL) $(T_LEGACY_DLL) 
mp3x	:	$(T_MP3X)
mp3rtp	:	$(T_MP3RTP)


all :	$(PGM) mp3rtp dll lame_enc 
	@echo.
	@echo --=*  all uptodate  *=--
	@echo.
