1
2CC = gcc
3
4c_sources = \
5	common.c \
6	dyn_cross.c \
7	encode.c \
8	audio_read.c \
9	lfe.c \
10	lingual.c \
11	musicin.c \
12	predisto.c \
13	psycho_1.c \
14	psycho_2.c \
15	alloc_tables.c \
16	crc.c \
17	subband.c \
18	config.c \
19	fft.c
20
21
22OBJ = $(c_sources:.c=.o)
23
24#Uncomment this if you want to do some profiling
25#PG = -g -pg
26
27# Optimize flag. 3 is about as high as you can sanely go with GCC3.2.
28OPTIM = -O3
29
30# These flags are pretty much mandatory
31REQUIRED = -DINLINE=inline
32
33#pick your architecture
34ARCH = -march=pentium
35#ARCH = -march=athlon-tbird
36#Possible x86 architectures
37#gcc3.2 => i386, i486, i586, i686, pentium, pentium-mmx
38#          pentiumpro, pentium2, pentium3, pentium4, k6, k6-2, k6-3,
39#          athlon, athlon-tbird, athlon-4, athlon-xp and athlon-mp.
40
41#TWEAK the hell out of the compile. Some of these are real dodgy
42#TWEAKS = -finline-functions -fexpensive-optimizations -ffast-math -malign-double \
43#	-mfancy-math-387 -funroll-loops -funroll-all-loops -pipe \
44#	-fschedule-insns2 -fno-strength-reduce
45
46#Set a stack of warnings to overcome my atrocious coding style . MFC.
47WARNINGS = -Wall
48WARNINGS2 = -Wstrict-prototypes -Wmissing-prototypes -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wredundant-decls
49
50CC_SWITCHES = $(OPTIM) $(REQUIRED)  $(PG) $(TWEAKS) $(WARNINGS) -DUNIX -DNEWSUBBAND -DNEWP1TABLES
51
52PGM = mctoolame
53
54LIBS =  -lm
55
56#nick burch's OS/2 fix  gagravarr@SoftHome.net
57UNAME = $(shell uname)
58ifeq ($(UNAME),OS/2)
59   SHELL=sh
60   PGM = toolame.exe
61   PG = -Zcrtdll -Zexe
62   LIBS =
63endif
64
65%.o: %.c Makefile
66	$(CC) $(CC_SWITCHES) -c $< -o $@
67
68$(PGM):	$(OBJ) Makefile
69	$(CC) $(PG) -o $(PGM) $(OBJ) $(LIBS)
70
71clean:
72	-rm $(OBJ) $(DEP)
73
74megaclean:
75	-rm $(OBJ) $(DEP) $(PGM) \#*\# *~
76
77distclean:
78	-rm *.o $(PGM) \#* *~ gmon.out gprof* core *shit* *.wav *.mp2 *.c.* *.mp2.* *.da *.h.* *.d *.mp3 *.pcm *.wav logfile
79
80tags: TAGS
81
82TAGS: ${c_sources}
83	etags -T ${c_sources}
84
85