Newer
Older
monitord / lame-3.97 / .svn / text-base / Makefile.unix.svn-base
@root root on 23 Jan 2012 18 KB Migration from SVN revision 455
  1. # Makefile for LAME 3.xx
  2. #
  3. # LAME is reported to work under:
  4. # Linux (i86), NetBSD 1.3.2 (StrongARM), FreeBSD (i86)
  5. # Compaq Alpha(OSF, Linux, Tru64 Unix), Sun Solaris, SGI IRIX,
  6. # OS2 Warp, Macintosh PPC, BeOS, Amiga and even VC++
  7. #
  8.  
  9. # these variables are available on command line:
  10. #
  11. # make UNAME=xxxxx ARCH=xxxxx - specify a type of host
  12. # make PGM=lame_exp - specify a name of an executable file
  13. #
  14. # if you have mingw32-gcc, try:
  15. # make -fMakefile.unix UNAME=MSDOS
  16. # or if you get the error
  17. # "process_begin: CreateProcess((null), copy configMS.h config.h, ...)":
  18. # make -fMakefile.unix UNAME=MSDOS NOUNIXCMD=NO
  19. # or if you have NASM:
  20. # make -fMakefile.unix UNAME=MSDOS HAVE_NASM=YES
  21. #
  22.  
  23. ifeq ($(UNAME),MSDOS)
  24. UNAME ?= UNKNOWN
  25. ARCH = x86
  26. NOUNIXCMD = YES
  27. else
  28. UNAME = $(shell uname)
  29. ARCH = $(shell uname -m)
  30. iARCH = $(patsubst i%86,x86,$(ARCH))
  31. endif
  32.  
  33. HAVE_NASM = NO
  34. HAVE_NEWER_GLIBC = NO
  35.  
  36. # generic defaults. OS specific options go in versious sections below
  37. PGM = lame
  38. CC = gcc
  39. CC_OPTS = -O
  40. CPP_OPTS = -Iinclude -Impglib -Ifrontend -Ilibmp3lame
  41. AR = ar
  42. RANLIB = ranlib
  43. GTK =
  44. GTKLIBS =
  45. LIBSNDFILE =
  46. LIBS = -lm
  47. MP3LIB = libmp3lame/libmp3lame.a
  48. MP3LIB_SHARED = libmp3lame/libmp3lame.so
  49. MAKEDEP = -M
  50. BRHIST_SWITCH =
  51. LIBTERMCAP =
  52. RM = rm -f
  53.  
  54. CPP_OPTS += -DHAVE_CONFIG_H -I.
  55. ##########################################################################
  56. # -DHAVEMPGLIB compiles the mpglib *decoding* library into libmp3lame
  57. ##########################################################################
  58. CPP_OPTS += -DHAVE_MPGLIB
  59.  
  60. ##########################################################################
  61. # -DUSE_LAYER_1/2 enables Layer1 or Layer2 *decoding* abilities
  62. ##########################################################################
  63. CPP_OPTS += -DUSE_LAYER_1 -DUSE_LAYER_2
  64.  
  65. ##########################################################################
  66. # -DTAKEHIRO_IEEE754_HACK enables Takehiro's IEEE hack
  67. ##########################################################################
  68. ifeq ($(iARCH),x86)
  69. CPP_OPTS += -DTAKEHIRO_IEEE754_HACK
  70. endif
  71.  
  72. ##########################################################################
  73. # Define these in the OS specific sections below to compile in code
  74. # for the optional VBR bitrate histogram.
  75. # Requires ncurses, but libtermcap also works.
  76. # If you have any trouble, just dont define these
  77. #
  78. # BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_{NCURSES_}TERMCAP_H
  79. # LIBTERMCAP = -lncurses
  80. # LIBTERMCAP = -ltermcap
  81. #
  82. # or, to try and simulate TERMCAP (ANSI), use:
  83. # BRHIST_SWITCH = -DBRHIST
  84. #
  85. ##########################################################################
  86.  
  87.  
  88. ##########################################################################
  89. # Define these in the OS specific sections below to compile in code for:
  90. #
  91. # SNDLIB = -DLIBSNDFILE to use Erik de Castro Lopo's libsndfile
  92. # http://www.zip.com.au/~erikd/libsndfile/ instead of LAME's internal
  93. # routines. Also set:
  94. #
  95. # LIBSNDFILE = -lsndfile
  96. # or
  97. # LIBSNDFILE = -L/location_of_libsndfile -lsndfile
  98. #
  99. ##########################################################################
  100.  
  101.  
  102. ##########################################################################
  103. # Define these in the OS specific sections below to compile in code for
  104. # the GTK mp3 frame analyzer
  105. #
  106. # Requires -DHAVE_MPGLIB
  107. #
  108. # GTK = -DHAVE_GTK `gtk-config --cflags`
  109. # GTKLIBS = `gtk-config --libs`
  110. #
  111. ##########################################################################
  112.  
  113.  
  114.  
  115.  
  116. ##########################################################################
  117. # LINUX
  118. ##########################################################################
  119. ifeq ($(UNAME),Linux)
  120. # remove these lines if you dont have GTK, or dont want the GTK frame analyzer
  121. GTK = -DHAVE_GTK `gtk-config --cflags`
  122. GTKLIBS = `gtk-config --libs`
  123. # Comment out next 2 lines if you want to remove VBR histogram capability
  124. BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  125. LIBTERMCAP = -lncurses
  126. # uncomment to use LIBSNDFILE
  127. # SNDLIB = -DLIBSNDFILE
  128. # LIBSNDFILE=-lsndfile
  129.  
  130. # suggested for gcc-2.7.x
  131. # CC_OPTS = -O3 -fomit-frame-pointer -funroll-loops -ffast-math -finline-functions -Wall -pedantic
  132. # CC_OPTS = -O9 -fomit-frame-pointer -fno-strength-reduce -mpentiumpro -ffast-math -finline-functions -funroll-loops -Wall -malign-double -g -march=pentiumpro -mfancy-math-387 -pipe -pedantic
  133.  
  134. # for debugging:
  135. CC_OPTS = -UNDEBUG -O -Wall -pedantic -ggdb -DABORTFP
  136.  
  137. # for lots of debugging:
  138. # CC_OPTS = -DDEBUG -UNDEBUG -O -Wall -pedantic -g -DABORTFP
  139.  
  140.  
  141. ifeq ($(CFG),RH)
  142. CPP_OPTS += -DFLOAT8=float -DREAL_IS_FLOAT=1
  143. # these options for gcc-3.2 & AthlonXP
  144. CC_OPTS = \
  145. -pipe -O3 \
  146. -Wall -W -Wmissing-declarations -Wfloat-equal \
  147. -Wcast-qual -Wcast-align -Wdisabled-optimization -Wshadow \
  148. -march=athlon-xp \
  149. -malign-double \
  150. -maccumulate-outgoing-args
  151. # -Wconversion -Wunreachable-code \
  152. HAVE_NEWER_GLIBC = YES
  153. HAVE_NASM = YES
  154. endif
  155.  
  156. ifeq ($(CFG),PFK)
  157. CPP_OPTS += -DKLEMM -DKLEMM_00 -DKLEMM_01 -DKLEMM_02 -DKLEMM_03 -DKLEMM_04 -DKLEMM_05 -DKLEMM_06 -DKLEMM_07 -DKLEMM_08 -DKLEMM_09 -DKLEMM_10 -DKLEMM_11 -DKLEMM_12 -DKLEMM_13 -DKLEMM_14 -DKLEMM_15 -DKLEMM_16 -DKLEMM_17 -DKLEMM_18 -DKLEMM_19 -DKLEMM_20 -DKLEMM_21 -DKLEMM_22 -DKLEMM_23 -DKLEMM_24 -DKLEMM_25 -DKLEMM_26 -DKLEMM_27 -DKLEMM_28 -DKLEMM_29 -DKLEMM_30 -DKLEMM_31 -DKLEMM_32 -DKLEMM_33 -DKLEMM_34 -DKLEMM_35 -DKLEMM_36 -DKLEMM_37 -DKLEMM_38 -DKLEMM_39 -DKLEMM_40 -DKLEMM_41 -DKLEMM_42 -DKLEMM_43 -DKLEMM_44 -DKLEMM_45 -DKLEMM_46 -DKLEMM_47 -DKLEMM_48 -DKLEMM_49 -DKLEMM_50
  158. CC_OPTS = \
  159. -Wall -O9 -fomit-frame-pointer -march=pentium \
  160. -finline-functions -fexpensive-optimizations \
  161. -funroll-loops -funroll-all-loops -pipe -fschedule-insns2 \
  162. -fstrength-reduce \
  163. -malign-double -mfancy-math-387 -ffast-math
  164. HAVE_NEWER_GLIBC = YES
  165. HAVE_NASM = YES
  166. endif
  167.  
  168. ##########################################################################
  169. # LINUX on Digital/Compaq Alpha CPUs
  170. ##########################################################################
  171. ifeq ($(ARCH),alpha)
  172.  
  173. ################################################################
  174. #### Check if 'ccc' is in our path
  175. #### if not, use 'gcc'
  176. ################################################################
  177. ifeq ($(shell which ccc 2>/dev/null | grep -c ccc),0)
  178.  
  179. # double is faster than float on Alpha
  180. CC_OPTS = -O4 -pedantic -Wall -fomit-frame-pointer -ffast-math -funroll-loops \
  181. -mfp-regs -fschedule-insns -fschedule-insns2 \
  182. -finline-functions \
  183. # -DFLOAT=double
  184. # add "-mcpu=21164a -Wa,-m21164a" to optimize for 21164a (ev56) CPU
  185.  
  186. ################################################################
  187. #### else, use 'ccc'
  188. ################################################################
  189. else
  190.  
  191. # Compaq's C Compiler
  192. CC = ccc
  193.  
  194. ################################################################
  195. #### set 'CC_OPTS = -arch host -tune host' to generate/tune instructions for this machine
  196. #### 'CC_OPTS += -migrate -fast -inline speed -unroll 0' tweak to run as fast as possible :)
  197. #### 'CC_OPTS += -w0 -pedantic -Wall' set warning and linking flags
  198. ################################################################
  199. CC_OPTS = -arch host -tune host
  200. CC_OPTS += -migrate -fast -inline speed -unroll 0
  201. CC_OPTS += -w0 -pedantic -Wall
  202.  
  203.  
  204. ################################################################
  205. #### to debug, uncomment
  206. ################################################################
  207. # For Debugging
  208. #CC_OPTS += -g3
  209.  
  210. ################################################################
  211. #### define __DECALPHA__ (i was getting re-declaration warnings
  212. #### in machine.h
  213. ################################################################
  214. # Define DEC Alpha
  215. CPP_OPTS += -D__DECALPHA__
  216.  
  217. # standard Linux libm
  218. #LIBS = -lm
  219. # optimized libffm (free fast math library)
  220. #LIBS = -lffm
  221. # Compaq's fast math library
  222. LIBS = -lcpml
  223. endif # gcc or ccc?
  224. endif # alpha
  225. endif # linux
  226.  
  227.  
  228.  
  229. ##########################################################################
  230. # FreeBSD
  231. ##########################################################################
  232. ifeq ($(UNAME),FreeBSD)
  233. # remove if you do not have GTK or do not want the GTK frame analyzer
  234. GTK = -DHAVE_GTK `gtk12-config --cflags`
  235. GTKLIBS = `gtk12-config --libs`
  236. # Comment out next 2 lines if you want to remove VBR histogram capability
  237. BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  238. LIBTERMCAP = -lncurses
  239.  
  240. endif
  241.  
  242.  
  243. ##########################################################################
  244. # OpenBSD
  245. ##########################################################################
  246. ifeq ($(UNAME),OpenBSD)
  247. # remove if you do not have GTK or do not want the GTK frame analyzer
  248. GTK = -DHAVE_GTK `gtk-config --cflags`
  249. GTKLIBS = `gtk-config --libs`
  250. # Comment out next 2 lines if you want to remove VBR histogram capability
  251. BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  252. LIBTERMCAP = -lcurses
  253. endif
  254.  
  255.  
  256.  
  257.  
  258. ##########################################################################
  259. # SunOS
  260. ##########################################################################
  261. ifeq ($(UNAME),SunOS)
  262. CC = cc
  263. CC_OPTS = -O -xCC
  264. MAKEDEP = -xM
  265. # for gcc, use instead:
  266. # CC = gcc
  267. # CC_OPTS = -O
  268. # MAKEDEP = -M
  269. endif
  270.  
  271.  
  272. ##########################################################################
  273. # SGI
  274. ##########################################################################
  275. ifeq ($(UNAME),IRIX64)
  276. CC = cc
  277. CC_OPTS = -O3 -woff all
  278.  
  279. #optonal:
  280. # GTK = -DHAVE_GTK `gtk-config --cflags`
  281. # GTKLIBS = `gtk-config --libs`
  282. # BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_TERMCAP_H
  283. # LIBTERMCAP = -lncurses
  284.  
  285. endif
  286. ifeq ($(UNAME),IRIX)
  287. CC = cc
  288. CC_OPTS = -O3 -woff all
  289. endif
  290.  
  291.  
  292.  
  293. ##########################################################################
  294. # Compaq Alpha running Dec Unix (OSF)
  295. ##########################################################################
  296. ifeq ($(UNAME),OSF1)
  297. CC = cc
  298. CC_OPTS = -fast -O3 -std -g3 -non_shared
  299. endif
  300.  
  301. ##########################################################################
  302. # BeOS
  303. ##########################################################################
  304. ifeq ($(UNAME),BeOS)
  305. CC = $(BE_C_COMPILER)
  306. LIBS =
  307. ifeq ($(ARCH),BePC)
  308. CC_OPTS = -O9 -fomit-frame-pointer -march=pentium \
  309. -mcpu=pentium -ffast-math -funroll-loops \
  310. -fprofile-arcs -fbranch-probabilities
  311. else
  312. CC_OPTS = -opt all
  313. MAKEDEP = -make
  314. endif
  315. endif
  316.  
  317. ###########################################################################
  318. # MOSXS (Rhapsody PPC)
  319. ###########################################################################
  320. ifeq ($(UNAME),Rhapsody)
  321. CC = cc
  322. LIBS =
  323. CC_OPTS = -O9 -ffast-math -funroll-loops -fomit-frame-pointer
  324. MAKEDEP = -make
  325. endif
  326. ##########################################################################
  327. # OS/2
  328. ##########################################################################
  329. # Properly installed EMX runtime & development package is a prerequisite.
  330. # tools I used: make 3.76.1, uname 1.12, sed 2.05, PD-ksh 5.2.13
  331. #
  332. ##########################################################################
  333. ifeq ($(UNAME),OS/2)
  334. SHELL=sh
  335. CC = gcc
  336. CC_OPTS = -O3 -D__OS2__
  337. PGM = lame.exe
  338. LIBS =
  339. RANLIB = touch
  340.  
  341. # I use the following for slightly better performance on my Pentium-II
  342. # using pgcc-2.91.66:
  343. # CC_OPTS = -O6 -ffast-math -funroll-loops -mpentiumpro -march=pentiumpro -D__OS2__
  344. # for the unfortunates with a regular pentium (using pgcc):
  345. # CC_OPTS = -O6 -ffast-math -funroll-loops -mpentium -march=pentium -D__OS2__
  346.  
  347. # Comment out next 2 lines if you want to remove VBR histogram capability
  348. BRHIST_SWITCH = -DBRHIST -DHAVE_TERMCAP -DHAVE_{NCURSES_}TERMCAP_H
  349. LIBTERMCAP = -lncurses
  350.  
  351. # Uncomment & inspect the 2 GTK lines to use MP3x GTK frame analyzer.
  352. # Properly installed XFree86/devlibs & GTK+ is a prerequisite.
  353. # The following works for me using Xfree86/OS2 3.3.5 and GTK+ 1.2.3:
  354. # GTK = -DHAVE_GTK -IC:/XFree86/include/gtk12 -Zmt -D__ST_MT_ERRNO__ -IC:/XFree86/include/glib12 -IC:/XFree86/include
  355. # GTKLIBS = -LC:/XFree86/lib -Zmtd -Zsysv-signals -Zbin-files -lgtk12 -lgdk12 -lgmodule -lglib12 -lXext -lX11 -lshm -lbsd -lsocket -lm
  356. endif
  357.  
  358. ###########################################################################
  359. # MSDOS/Windows
  360. ###########################################################################
  361. ifeq ($(UNAME),MSDOS)
  362. RM =
  363. CC_OPTS = \
  364. -Wall -pipe -O3 -fomit-frame-pointer -ffast-math -funroll-loops \
  365. -fschedule-insns2 -fmove-all-movables -freduce-all-givs \
  366. -mcpu=pentium -march=pentium -mfancy-math-387
  367. CC_OPTS += -D_cdecl=__cdecl
  368. PGM = lame.exe
  369. endif
  370.  
  371. ###########################################################################
  372. # AmigaOS
  373. ###########################################################################
  374. # Type 'Make ARCH=PPC' for PowerUP and 'Make ARCH=WOS' for WarpOS
  375. #
  376. ###########################################################################
  377. ifeq ($(UNAME),AmigaOS)
  378. CC = gcc -noixemul
  379. CC_OPTS = -O3 -ffast-math -funroll-loops -m68020-60 -m68881
  380. BRHIST_SWITCH = -DBRHIST
  381. MAKEDEP = -MM
  382. ifeq ($(ARCH),WOS)
  383. CC = ppc-amigaos-gcc -warpup
  384. CC_OPTS = -O3 -ffast-math -fomit-frame-pointer -funroll-loops \
  385. -mmultiple -mcpu=603e
  386. AR = ppc-amigaos-ar
  387. RANLIB = ppc-amigaos-ranlib
  388. LIBS =
  389. endif
  390. ifeq ($(ARCH),PPC)
  391. CC = ppc-amigaos-gcc
  392. CC_OPTS = -O3 -ffast-math -fomit-frame-pointer -funroll-loops \
  393. -mmultiple -mcpu=603e
  394. AR = ppc-amigaos-ar
  395. RANLIB = ppc-amigaos-ranlib
  396. LIBS =
  397. endif
  398. endif
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415. # 10/99 added -D__NO_MATH_INLINES to fix a bug in *all* versions of
  416. # gcc 2.8+ as of 10/99.
  417.  
  418. ifeq ($(HAVE_NEWER_GLIBC),YES)
  419. CC_SWITCHES =
  420. else
  421. CC_SWITCHES = -D__NO_MATH_INLINES # only needed by some older glibc
  422. endif
  423.  
  424. CC_SWITCHES += -DNDEBUG $(CC_OPTS) $(SNDLIB) $(GTK) $(BRHIST_SWITCH)
  425. frontend_sources = \
  426. frontend/amiga_mpega.c \
  427. frontend/brhist.c \
  428. frontend/get_audio.c \
  429. frontend/lametime.c \
  430. frontend/parse.c \
  431. frontend/portableio.c \
  432. frontend/timestatus.c
  433.  
  434. lib_sources = \
  435. libmp3lame/bitstream.c \
  436. libmp3lame/encoder.c \
  437. libmp3lame/fft.c \
  438. libmp3lame/gain_analysis.c \
  439. libmp3lame/id3tag.c \
  440. libmp3lame/lame.c \
  441. libmp3lame/newmdct.c \
  442. libmp3lame/psymodel.c \
  443. libmp3lame/quantize.c \
  444. libmp3lame/quantize_pvt.c \
  445. libmp3lame/set_get.c \
  446. libmp3lame/vbrquantize.c \
  447. libmp3lame/reservoir.c \
  448. libmp3lame/tables.c \
  449. libmp3lame/takehiro.c \
  450. libmp3lame/util.c \
  451. libmp3lame/mpglib_interface.c \
  452. libmp3lame/VbrTag.c \
  453. libmp3lame/version.c \
  454. libmp3lame/presets.c \
  455. mpglib/common.c \
  456. mpglib/dct64_i386.c \
  457. mpglib/decode_i386.c \
  458. mpglib/layer1.c \
  459. mpglib/layer2.c \
  460. mpglib/layer3.c \
  461. mpglib/tabinit.c \
  462. mpglib/interface.c
  463.  
  464.  
  465. #ifeq ($(UNAME),MSDOS)
  466. # frontend_sources := $(subst /,\,$(frontend_sources))
  467. # lib_sources := $(subst /,\,$(lib_sources))
  468. #endif
  469.  
  470. frontend_obj = $(frontend_sources:.c=.o)
  471. lib_obj = $(lib_sources:.c=.o)
  472.  
  473. DEP = $(frontend_sources:.c=.d) $(lib_sources:.c=.d )
  474.  
  475. gtk_sources = frontend/gtkanal.c frontend/gpkplotting.c
  476. gtk_obj = $(gtk_sources:.c=.o)
  477. gtk_dep = $(gtk_sources:.c=.d)
  478.  
  479.  
  480.  
  481. NASM = nasm
  482. ASFLAGS=-f elf -i libmp3lame/i386/
  483.  
  484. # for people with nasmw
  485. ifeq ($(UNAME),MSDOS)
  486. NASM = nasmw
  487. ASFLAGS=-f win32 -DWIN32 -i libmp3lame/i386/
  488. endif
  489.  
  490. %.o: %.nas
  491. $(NASM) $(ASFLAGS) $< -o $@
  492. %.o: %.s
  493. gcc -c $< -o $@
  494.  
  495.  
  496. #HAVE_NASM = YES
  497.  
  498. ifeq ($(HAVE_NASM),YES)
  499. ## have NASM
  500. CC_SWITCHES += -DHAVE_NASM
  501. lib_obj += libmp3lame/i386/cpu_feat.o
  502.  
  503. ## use MMX extension. you need nasm and MMX supported CPU.
  504. CC_SWITCHES += -DMMX_choose_table
  505. lib_obj += libmp3lame/i386/choose_table.o
  506.  
  507. ## use 3DNow! extension. you need nasm and 3DNow! supported CPU.
  508. lib_obj += libmp3lame/i386/fft3dn.o
  509.  
  510. ## not yet coded
  511. #CC_SWITCHES += -DUSE_FFTSSE
  512. #lib_obj += libmp3lame/i386/fftsse.o
  513.  
  514. ## not yet coded
  515. #CC_SWITCHES += -DUSE_FFTFPU
  516. #lib_obj += libmp3lame/i386/fftfpu.o
  517. endif
  518.  
  519.  
  520. %.o: %.c
  521. $(CC) $(CPP_OPTS) $(CC_SWITCHES) -c $< -o $@
  522.  
  523. %.d: %.c
  524. ifeq ($(NOUNIXCMD),YES)
  525. $(CC) $(MAKEDEP) $(CPP_OPTS) $(CC_SWITCHES) $< > $@
  526. else
  527. $(SHELL) -ec '$(CC) $(MAKEDEP) $(CPP_OPTS) $(CC_SWITCHES) $< | sed '\''s;$*.o;& $@;g'\'' > $@'
  528. endif
  529.  
  530. all: frontend/$(PGM)
  531.  
  532. $(lib_sources) $(frontend_sources) $(gtk_sources) : config.h
  533.  
  534. config.h: configMS.h
  535. ifeq ($(NOUNIXCMD),YES)
  536. copy configMS.h config.h
  537. else
  538. cp configMS.h config.h
  539. endif
  540.  
  541. frontend/$(PGM): frontend/main.o $(frontend_obj) $(MP3LIB)
  542. $(CC) $(CC_OPTS) -o frontend/$(PGM) frontend/main.o $(frontend_obj) \
  543. $(MP3LIB) $(LIBS) $(LIBSNDFILE) $(LIBTERMCAP)
  544.  
  545. mp3x: frontend/mp3x.o $(frontend_obj) $(gtk_obj) $(MP3LIB)
  546. $(CC) $(CC_OPTS) -o frontend/mp3x frontend/mp3x.o $(frontend_obj) $(gtk_obj) $(MP3LIB) \
  547. $(LIBS) $(LIBSNDFILE) $(GTKLIBS) $(LIBTERMCAP)
  548.  
  549. mp3rtp: frontend/rtp.o frontend/mp3rtp.o $(frontend_obj) $(MP3LIB)
  550. $(CC) $(CC_OPTS) -o frontend/mp3rtp frontend/mp3rtp.o frontend/rtp.o $(frontend_obj) $(MP3LIB) \
  551. $(LIBS) $(LIBSNDFILE) $(LIBTERMCAP)
  552.  
  553. libmp3lame/libmp3lame.a: $(lib_obj)
  554. $(AR) cr libmp3lame/libmp3lame.a $(lib_obj)
  555. $(RANLIB) libmp3lame/libmp3lame.a
  556.  
  557. #shared library. GNU specific?
  558. libmp3lame/libmp3lame.so: $(lib_obj)
  559. gcc -shared -Wl,-soname,libmp3lame/libmp3lame.so -o libmp3lame/libmp3lame.so $(lib_obj)
  560.  
  561. install: frontend/$(PGM) #libmp3lame.a
  562. cp frontend/$(PGM) /usr/bin
  563. #cp libmp3lame.a /usr/lib
  564. #cp lame.h /usr/lib
  565.  
  566.  
  567.  
  568. clean:
  569. ifeq ($(UNAME),MSDOS)
  570. -del $(subst /,\,$(frontend_obj))
  571. -del $(subst /,\,$(lib_obj))
  572. -del $(subst /,\,$(gtk_obj))
  573. -del $(subst /,\,$(DEP))
  574. -del frontend\$(PGM)
  575. -del frontend\main.o
  576. -del libmp3lame\libmp3lame.a
  577. else
  578. -$(RM) $(gtk_obj) $(frontend_obj) $(lib_obj) $(DEP) frontend/$(PGM) \
  579. frontend/main.o frontend/lame libmp3lame/libmp3lame.a \
  580. frontend/mp3x.o frontend/mp3x
  581. endif
  582.  
  583.  
  584. tags: TAGS
  585.  
  586. TAGS: ${c_sources}
  587. etags -T ${c_sources}
  588.  
  589. ifneq ($(MAKECMDGOALS),clean)
  590. -include $(DEP)
  591. endif
  592.  
  593.  
  594. #
  595. # testcase.mp3 is a 2926 byte file. The first number output by
  596. # wc is the number of bytes which differ between new output
  597. # and 'official' results.
  598. #
  599. # Because of compilier options and effects of roundoff, the
  600. # number of bytes which are different may not be zero, but
  601. # should be at most 30.
  602. #
  603. test: frontend/$(PGM)
  604. frontend/$(PGM) --nores -h testcase.wav testcase.new.mp3
  605. cmp -l testcase.new.mp3 testcase.mp3 | wc -l
  606.  
  607. testg: frontend/$(PGM)
  608. frontend/$(PGM) -g -h ../test/castanets.wav
  609.