# Makefile.MSVC: MSVC Makefile for LAME # # 2000-2010 Robert Hegemann # dedicated to the LAME project http://www.mp3dev.org ############################################################################### #__ 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= -> use MS compiler # WARN= -> give verbose compiler warnings # ASM= -> no NASM nor MMX # MMX= -> do not assemble MMX code # CFG= -> 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= -> use double instead of single float # SNDFILE= -> 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 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