File: Makefile

package info (click to toggle)
toolame 02i-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 604 kB
  • ctags: 558
  • sloc: ansic: 12,338; sh: 111; makefile: 96
file content (82 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

CC = gcc

c_sources = \
	common.c \
	encode.c \
	formatBitstream.c \
	ieeefloat.c \
	toolame.c \
	portableio.c \
	psycho_I.c \
	psycho_II.c \
	fft.c \
	subband.c \
	get_audio.c \
	bitstream.c \
	mem.c \
	crc.c \
	tables.c \
	availbits.c

OBJ = $(c_sources:.c=.o)
DEP = $(c_sources:.c=.d)

#PG = -pg
#PG = -fomit-frame-pointer
OPTIM = -O2
#OPTIM = -O -g -DMDEBx
#DMAL = 
#DMAL = -DDMALLOC -DMEMFIX
#DMALLOCLIB = -ldmalloc
REQUIRED = -DMFCMISC -DUNIX -DNDEBUG -DINLINE=inline $(DMAL)
#ARCH = -march=pentium 
#Following TWEAKS are for gcc2.95.2 YMMV.
#TWEAKS = -finline-functions -fexpensive-optimizations -ffast-math -malign-double \
#	-mfancy-math-387 -funroll-loops -funroll-all-loops -pipe \
#	-fschedule-insns2 -fno-strength-reduce
#EXTRATWEAKS = -DVBRDEBUG
WARNING = -Wall -Wstrict-prototypes -Wmissing-prototypes
WORKING = -DVBR -DIOFIX
CC_SWITCHES = $(OPTIM) $(REQUIRED) $(ARCH) $(PG) $(TWEAKS) $(EXTRATWEAKS) $(WARNING) $(WORKING)

PGM = toolame

LIBS =  -lm $(DMALLOCLIB)

#nick burch's OS/2 fix  gagravarr@SoftHome.net
UNAME = $(shell uname)
ifeq ($(UNAME),OS/2)
   SHELL=sh     
   PGM = toolame.exe
   LIBS =
endif

%.o: %.c 
	$(CC) $(CC_SWITCHES) -c $< -o $@

%.d: %.c
	$(SHELL) -ec '$(CC) -M $(CC_SWITCHES) $< | sed '\''s/$*.o/& $@/g'\'' > $@'


$(PGM):	$(OBJ) Makefile
	$(CC) $(PG) -o $(PGM) $(OBJ) $(LIBS)

clean:
	-rm $(OBJ) $(DEP)

megaclean:
	-rm $(OBJ) $(DEP) $(PGM) \#*\# *~

distclean:
	-rm $(OBJ) $(DEP) $(PGM) \#* *~ gmon.out gprof* core *shit* *.wav *.mp2 *.c.* *.mp2.* *.da *.h.* *.d *.mp3 *.pcm *.wav logfile

tags: TAGS

install:
	install -m 755 toolame $(DESTDIR)/usr/bin/toolame

TAGS: ${c_sources}
	etags -T ${c_sources}

-include $(DEP)