Subversion Repositories shark

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
###
2
###   mpg123  Makefile
3
###
4
 
5
# Where to install binary and manpage on "make install":
6
 
7
PREFIX=/usr/local
8
BINDIR=$(PREFIX)/bin
9
MANDIR=$(PREFIX)/man
10
SECTION=1
11
 
12
###################################################
13
######                                       ######
14
######   End of user-configurable settings   ######
15
######                                       ######
16
###################################################
17
 
18
nothing-specified:
19
	@echo ""
20
	@echo "You must specify the system which you want to compile for:"
21
	@echo ""
22
	@echo "make linux           Linux"
23
	@echo "make freebsd         FreeBSD"
24
	@echo "make solaris         Solaris 2.x (tested: 2.5 and 2.5.1) using SparcWorks cc"
25
	@echo "make solaris-gcc     Solaris 2.x using GNU cc (somewhat slower)"
26
	@echo "make sunos           SunOS 4.x (tested: 4.1.4)"
27
	@echo "make hpux            HP/UX 9/10, /7xx"
28
	@echo "make sgi             SGI running IRIX"
29
	@echo "make dec             DEC Unix (tested: 3.2 and 4.0), OSF/1"
30
	@echo "make ultrix          DEC Ultrix (tested: 4.4)"
31
	@echo "make aix             IBM AIX (tested: 4.2)"
32
	@echo "make os2             IBM OS/2"
33
	@echo "make generic         try this one if your system isn't listed above"
34
	@echo ""
35
	@echo "Please read the file INSTALL for additional information."
36
	@echo ""
37
 
38
linux-devel:
39
	$(MAKE) OBJECTS='decode_i386.o dct64_i386.o' \
40
        CC=gcc LDFLAGS= \
41
        CFLAGS='-DREAL_IS_FLOAT -DLINUX -Wall -g -m486 \
42
            -funroll-all-loops \
43
            -finline-functions -ffast-math' \
44
        mpg123
45
 
46
linux-profile:
47
	$(MAKE) OBJECTS='decode_i386.o dct64_i386.o' \
48
        CC=gcc LDFLAGS='-pg' \
49
        CFLAGS='-DREAL_IS_FLOAT -DLINUX -Wall -pg -m486 \
50
            -funroll-all-loops \
51
            -finline-functions -ffast-math' \
52
        mpg123
53
 
54
linux:
55
	$(MAKE) CC=gcc LDFLAGS= \
56
		OBJECTS='decode_i386.o dct64_i386.o getbits.o' \
57
		CFLAGS='-DI386_ASSEM -DREAL_IS_FLOAT -DLINUX -Wall -O2 -m486 \
58
			-fomit-frame-pointer -funroll-all-loops \
59
			-finline-functions -ffast-math' \
60
		mpg123
61
 
62
linux-sajber:
63
	$(MAKE) CC=gcc LDFLAGS= \
64
		OBJECTS='decode_i386.o dct64_i386.o getbits.o control.o' \
65
		CFLAGS='-DFRONTEND -DI386_ASSEM -DREAL_IS_FLOAT -DLINUX -Wall -O2 -m486\
66
			-fomit-frame-pointer -funroll-all-loops \
67
			-finline-functions -ffast-math' \
68
		sajberplay
69
 
70
 
71
#### the following defines are for experimental use ...
72
#
73
#CFLAGS='-pg -DI386_ASSEM -DREAL_IS_FLOAT -DLINUX -Wall -O2 -m486 -funroll-all-loops -finline-functions -ffast-math' mpg123
74
#CFLAGS='-DI386_ASSEM -O2 -DREAL_IS_FLOAT -DLINUX -Wall -g'
75
#CFLAGS='-DI386_ASSEM -DREAL_IS_FLOAT -DLINUX -Wall -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2'
76
 
77
freebsd:
78
	$(MAKE) CC=cc LDFLAGS= \
79
		OBJECTS='decode_i386.o dct64_i386.o getbits_.o' \
80
		CFLAGS='-Wall -ansi -pedantic -O4 -m486 -fomit-frame-pointer \
81
			-funroll-all-loops -ffast-math -DROT_I386 \
82
			-DI386_ASSEM -DREAL_IS_FLOAT -DUSE_MMAP' \
83
		mpg123
84
 
85
solaris:
86
	$(MAKE) CC=cc LDFLAGS='-lsocket -lnsl' OBJECTS='decode.o dct64.o' \
87
		CFLAGS='-fast -native -xO5 -DSOLARIS -DREAL_IS_FLOAT \
88
			-DUSE_MMAP' \
89
		mpg123
90
 
91
solaris-gcc:
92
	$(MAKE) CC=gcc LDFLAGS='-lsocket -lnsl' OBJECTS='decode.o dct64.o' \
93
		CFLAGS='-O2 -Wall -DSOLARIS -DREAL_IS_FLOAT -DUSE_MMAP \
94
			-funroll-all-loops -finline-functions' \
95
		mpg123
96
 
97
sunos:
98
	$(MAKE) CC=gcc LDFLAGS= OBJECTS='decode.o dct64.o' \
99
		CFLAGS='-O2 -DSUNOS -DREAL_IS_FLOAT -DUSE_MMAP \
100
			-funroll-loops' \
101
		mpg123
102
 
103
hpux:
104
	$(MAKE) CC=cc LDFLAGS= OBJECTS='decode.o dct64.o' \
105
		CFLAGS='-DREAL_IS_FLOAT -Aa +O3 -D_HPUX_SOURCE -DHPUX' \
106
		mpg123
107
 
108
sgi:
109
	$(MAKE) CC=cc LDFLAGS= OBJECTS='decode.o dct64.o' AUDIO_LIB=-laudio \
110
		CFLAGS='-O2 -DSGI -DREAL_IS_FLOAT -DUSE_MMAP' \
111
		mpg123
112
 
113
dec:
114
	$(MAKE) CC=cc LDFLAGS= OBJECTS='decode.o dct64.o' \
115
		CFLAGS='-std1 -warnprotos -O4 -DUSE_MMAP' \
116
		mpg123
117
 
118
ultrix:
119
	$(MAKE) CC=cc LDFLAGS= OBJECTS='decode.o dct64.o' \
120
		CFLAGS='-std1 -O2 -DULTRIX' \
121
		mpg123
122
 
123
aix:
124
	$(MAKE) LDFLAGS= OBJECTS='decode.o dct64.o' \
125
		CFLAGS='-O -DAIX -DUSE_MMAP' \
126
		mpg123
127
os2:
128
	$(MAKE) CC=gcc LDFLAGS= \
129
		OBJECTS='decode_i386.o dct64_i386.o' \
130
		CFLAGS='-DREAL_IS_FLOAT -DOS2 -Wall -O2 -m486 \
131
		-fomit-frame-pointer -funroll-all-loops \
132
		-finline-functions -ffast-math' \
133
		LIBS='-los2me -lsocket' \
134
		mpg123.exe
135
 
136
generic:
137
	$(MAKE) LDFLAGS= OBJECTS='decode.o dct64.o' \
138
		CFLAGS='-O' \
139
		mpg123
140
 
141
 
142
sajberplay: mpg123.o common.o $(OBJECTS) decode_2to1.o decode_4to1.o \
143
		tabinit.o audio.o layer1.o layer2.o layer3.o buffer.o \
144
		getlopt.o httpget.o xfermem.o Makefile
145
	$(CC) $(CFLAGS) $(LDFLAGS)  mpg123.o tabinit.o common.o layer1.o \
146
		layer2.o layer3.o audio.o buffer.o decode_2to1.o \
147
		decode_4to1.o getlopt.o httpget.o xfermem.o $(OBJECTS) \
148
		-o sajberplay -lm $(AUDIO_LIB)
149
 
150
mpg123: mpg123.o common.o $(OBJECTS) decode_2to1.o decode_4to1.o \
151
		tabinit.o audio.o layer1.o layer2.o layer3.o buffer.o \
152
		getlopt.o httpget.o xfermem.o Makefile
153
	$(CC) $(CFLAGS) $(LDFLAGS)  mpg123.o tabinit.o common.o layer1.o \
154
		layer2.o layer3.o audio.o buffer.o decode_2to1.o \
155
		decode_4to1.o getlopt.o httpget.o xfermem.o $(OBJECTS) \
156
		-o mpg123 -lm $(AUDIO_LIB)
157
 
158
mpg123.exe: mpg123.o common.o $(OBJECTS) decode_2to1.o decode_4to1.o \
159
	tabinit.o audio.o layer1.o layer2.o layer3.o buffer.o \
160
	getlopt.o httpget.o Makefile
161
	$(CC) $(CFLAGS) $(LDFLAGS)  mpg123.o tabinit.o common.o layer1.o \
162
		layer2.o layer3.o audio.o buffer.o decode_2to1.o \
163
		decode_4to1.o getlopt.o httpget.o $(OBJECTS) \
164
		-o mpg123.exe -lm $(LIBS)
165
 
166
tst:
167
	gcc $(CFLAGS) -S decode.c
168
 
169
layer1.o:	mpg123.h
170
layer2.o:	mpg123.h
171
layer3.o:	mpg123.h huffman.h get1bit.h
172
decode.o:	mpg123.h
173
decode_int.o:	mpg123.h
174
decode_2to1.o:	mpg123.h
175
decode_4to1.o:	mpg123.h
176
decode_i386.o:	mpg123.h
177
common.o:	mpg123.h tables.h
178
mpg123.o:	mpg123.h getlopt.h xfermem.h version.h
179
mpg123.h:	audio.h
180
audio.o:	mpg123.h
181
buffer.o:	mpg123.h xfermem.h
182
getbits.o:	mpg123.h
183
getbits_.o:	mpg123.h
184
tabinit.o:	mpg123.h
185
getlopt.o:	getlopt.h
186
httpget.o:	mpg123.h
187
dct64.o:	mpg123.h
188
dct64_i386.o:	mpg123.h
189
xfermem.o:	xfermem.h
190
 
191
clean:
192
	rm -f *.o *core *~ mpg123 gmon.out sajberplay
193
 
194
prepared-for-install:
195
	@if [ ! -x mpg123 ]; then \
196
		echo '###' ; \
197
		echo '###  Before doing "make install", you have to compile the software.' ; \
198
		echo '### Type "make" for more information.' ; \
199
		echo '###' ; \
200
		exit 1 ; \
201
	fi
202
 
203
install:	prepared-for-install
204
	strip mpg123
205
	if [ -x /usr/ccs/bin/mcs ]; then /usr/ccs/bin/mcs -d mpg123; fi
206
	cp -f mpg123 $(BINDIR)
207
	chmod 755 $(BINDIR)/mpg123
208
	cp -f mpg123.1 $(MANDIR)/man$(SECTION)
209
	chmod 644 $(MANDIR)/man$(SECTION)/mpg123.1
210
	if [ -r $(MANDIR)/windex ]; then catman -w -M $(MANDIR) $(SECTION); fi
211
 
212
dist:	clean
213
	DISTNAME="`basename \`pwd\``" ; \
214
	sed '/prgDate/s_".*"_"'`date +%Y/%m/%d`'"_' version.h > version.new; \
215
	mv -f version.new version.h; \
216
	cd .. ; \
217
	rm -f "$$DISTNAME".tar.gz "$$DISTNAME".tar ; \
218
	tar cvf "$$DISTNAME".tar "$$DISTNAME" ; \
219
	gzip -9 "$$DISTNAME".tar