home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Sound / LAME / src / Makefile.DJGPP < prev    next >
Makefile  |  2000-07-31  |  5KB  |  182 lines

  1. # Makefile for LAME 3.xx using DJGPP (DJ Delorie's DOS port of GCC)
  2. # based on the original lame makefile
  3. #
  4. # Hints:
  5. #
  6. # To compile, use: make -f Makefile.djgpp
  7. #
  8. # Make sure that you have the DJGPP make utility installed (get it from where you got DJGPP)
  9. #
  10. # Use UPX to compress the exe to less half the original size.
  11. #
  12. ## Some of the changes (things that don't work with DOS/DJGPP)
  13. ## removed VBR histogram capability
  14. ## removed references to GTK 
  15. ## removed references to rtp
  16. ## make clean is a hack because the dos prompt doesn't like really long command lines
  17. ## removed -pipe from CC_OPTS
  18.  
  19. # generic defaults. OS specific options go in versious sections below
  20. PGM = lame
  21. CC = gcc
  22. CC_OPTS =  -O
  23. SNDLIB = -DLAMESNDFILE
  24. LIBSNDFILE =  
  25. LIBS = -lm 
  26. MAKEDEP = -M
  27.  
  28.  
  29. ##########################################################################
  30. # -DHAVEMPGLIB compiles the mpglib *decoding* library into libmp3lame
  31. ##########################################################################
  32. CPP_OPTS += -DHAVEMPGLIB 
  33.  
  34. ##########################################################################
  35. # -DFLOAT8_is_float will FLOAT8 as float
  36. # -DFLOAT8_is_double  will FLOAT8 as double (default)
  37. #  NOTE: RH: 7/00:  if FLOAT8=float, it breaks resampling and VBR code 
  38. ##########################################################################
  39. CPP_OPTS += -DFLOAT8_is_double
  40.  
  41.  
  42. ##########################################################################
  43. # Define these in the OS specific sections below to compile in support
  44. # for the Ogg Vorbis audio format (both decoding and encoding)
  45. # VORBIS = -DHAVEVORBIS  -I ../vorbis/include
  46. # VORBIS_LIB = -L ../vorbis/lib -lvorbis
  47. ##########################################################################
  48.  
  49.  
  50. ##########################################################################
  51. # Define these in the section below to compile in code for:
  52. #
  53. # SNDLIB =                no file i/o 
  54. # SNDLIB = -DLAMESNDFILE  to use internal LAME soundfile routines 
  55. # SNDLIB = -DLIBSNDFILE   to use Erik de Castro Lopo's libsndfile 
  56. # http://www.zip.com.au/~erikd/libsndfile/
  57. #
  58. # Note: at present, libsndfile does not support input from stdin.  
  59. #
  60. # for example:
  61. #  SNDLIB = -DLIBSNDFILE
  62. #  LIBSNDFILE=-lsndfile 
  63. #  if sndfile.lib is in a custom location, try:
  64. #  LIBSNDFILE=-L $(LIBSNDHOME) -lsndfile  -I $(LIBSNDHOME)
  65. ##########################################################################
  66.  
  67.  
  68. ##########################################################################
  69. # DJGPP   
  70. ##########################################################################
  71.  
  72. # Generic, safe options:
  73. CC_OPTS = -O2
  74.  
  75. # other possibilities:
  76. #CC_OPTS = -s  -O3 -fomit-frame-pointer -funroll-loops -ffast-math  -finline-functions -Wall
  77.  
  78. #CC_OPTS =  -s -O9 -fomit-frame-pointer -fno-strength-reduce -mpentiumpro -ffast-math -finline-functions -funroll-loops -Wall -malign-double -g -march=pentiumpro -mfancy-math-387
  79.  
  80. #CC_OPTS = -s -O2 -march=i686 -fomit-frame-pointer -ffast-math -funroll-loops  -funroll-all-loops -malign-double -fstrict-aliasing 
  81.  
  82. #CC_OPTS = -s -Wall -O9 -fomit-frame-pointer -march=pentiumpro -finline-functions -fexpensive-optimizations -funroll-loops -funroll-all-loops -fschedule-insns2 -fstrength-reduce -malign-double -mfancy-math-387 -ffast-math 
  83.  
  84. #  for debugging:
  85. #   CC_OPTS =  -UNDEBUG -O -Wall -g -DABORTFP
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92. # 10/99 added -D__NO_MATH_INLINES to fix a bug in *all* versions of
  93. # gcc 2.8+ as of 10/99.  
  94.  
  95. CC_SWITCHES = -DNDEBUG -D__NO_MATH_INLINES $(CC_OPTS) $(SNDLIB)  \
  96. $(VORBIS) 
  97. c_sources = \
  98.     brhist.c \
  99.     bitstream.c \
  100.     fft.c \
  101.     get_audio.c \
  102.     id3tag.c \
  103.     ieeefloat.c \
  104.     lame.c \
  105.     newmdct.c \
  106.     parse.c \
  107.     portableio.c \
  108.     psymodel.c \
  109.     quantize.c \
  110.     quantize-pvt.c \
  111.     vbrquantize.c \
  112.     reservoir.c \
  113.     tables.c \
  114.     takehiro.c \
  115.     timestatus.c \
  116.     util.c \
  117.     vorbis_interface.c \
  118.     VbrTag.c \
  119.     version.c \
  120.     mpglib/common.c \
  121.     mpglib/dct64_i386.c \
  122.     mpglib/decode_i386.c \
  123.     mpglib/layer3.c \
  124.     mpglib/tabinit.c \
  125.     mpglib/interface.c \
  126.     mpglib/main.c 
  127.  
  128. OBJ = $(c_sources:.c=.o)
  129. DEP = $(c_sources:.c=.d)
  130.  
  131.  
  132. NASM = nasm
  133. ASFLAGS=-f elf -i i386/
  134. %.o: %.nas
  135.     $(NASM) $(ASFLAGS) $< -o $@
  136. %.o: %.s
  137.     gcc -c $< -o $@
  138.  
  139. ## use MMX extension. you need nasm and MMX supported CPU.
  140. #CC_SWITCCH += -DMMX_choose_table
  141. #OBJ += i386/choose_table.o
  142.  
  143. %.o: %.c 
  144.     $(CC) $(CPP_OPTS) $(CC_SWITCHES) -c $< -o $@
  145.  
  146. #%.d: %.c
  147. #    $(SHELL) -ec '$(CC) $(MAKEDEP)  $(CPP_OPTS) $(CC_SWITCHES)  $< | sed '\''s;$*.o;& $@;g'\'' > $@'
  148.  
  149. all: $(PGM)
  150.  
  151. $(PGM):    main.o $(OBJ)
  152.     $(CC) $(CC_OPTS) -o $(PGM)  main.o  $(OBJ) $(LIBS) $(LIBSNDFILE) $(VORBIS_LIB)
  153.  
  154. libmp3lame.a:  $(OBJ) Makefile
  155. #    cd libmp3lame
  156. #    make libmp3lame
  157.     ar cr libmp3lame.a  $(OBJ) 
  158.  
  159. clean:
  160.     del *.o 
  161.     del mpglib\*.o 
  162.     del lame.exe
  163.     del libmp3lame.a 
  164.  
  165.  
  166. #
  167. #  testcase.mp3 is a 2926 byte file.  The first number output by
  168. #  wc is the number of bytes which differ between new output
  169. #  and 'official' results.  
  170. #
  171. #  Because of compilier options and effects of roundoff, the 
  172. #  number of bytes which are different may not be zero, but
  173. #  should be at most 30.
  174. #
  175. test: $(PGM)
  176.     ./lame  --nores -h testcase.wav testcase.new.mp3
  177.     cmp -l testcase.new.mp3 testcase.mp3 | wc
  178.  
  179. testg: $(PGM)
  180.     ./lame -g -h ../test/castanets.wav
  181.