Remove unused file
[libav.git] / Makefile
CommitLineData
a1b63811 1#
85f07f22 2# Main ffmpeg Makefile
38100e8c 3# (c) 2000-2004 Fabrice Bellard
85f07f22 4#
980fc7b8 5include config.mak
85f07f22 6
997baf01 7VPATH=$(SRC_PATH_BARE)
dd9ca370 8
cbeee4d8 9CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
a163ed1a 10 -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
364a9607 11 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -DHAVE_AV_CONFIG_H
115329f1 12LDFLAGS+= -g
37736979 13
0cb8579a
MR
14PROGS-$(CONFIG_FFMPEG) += ffmpeg
15PROGS-$(CONFIG_FFPLAY) += ffplay
16PROGS-$(CONFIG_FFSERVER) += ffserver
01310af2 17
bb8fe69a
DB
18PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
19PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
20MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
85f07f22 21
bb8fe69a
DB
22BASENAMES = ffmpeg ffplay ffserver
23ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
24ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
25ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
6b991cb2 26
0fd94442 27ifeq ($(BUILD_SHARED),yes)
6bc114b2 28DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
0fd94442 29else
f3ec2d46 30DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
f02be79d
RS
31endif
32
d226c750 33ifeq ($(CONFIG_VHOOK),yes)
4c9b0af5
MR
34all: videohook
35install: install-vhook
47930f09 36endif
142fc6b9 37
146ea952 38ifeq ($(BUILD_DOC),yes)
4c9b0af5
MR
39all: documentation
40install: install-man
146ea952
NB
41endif
42
7f0f6e13 43SRCS = $(addsuffix .c, $(PROGS-yes)) cmdutils.c
84471efd 44LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
8dc6f118 45EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
57514323 46
790c9ca7 47ifeq ($(CONFIG_SWSCALER),yes)
06694949 48LDFLAGS+=-L$(BUILD_ROOT)/libswscale
6de9e506 49EXTRALIBS+=-lswscale$(BUILDSUF)
790c9ca7
LA
50endif
51
4c9b0af5 52all: lib $(PROGS)
85f07f22 53
951bf3e6 54lib:
5d22ccf7
DB
55 $(MAKE) -C libavutil all
56 $(MAKE) -C libavcodec all
abac6175 57 $(MAKE) -C libavformat all
1a9150b1 58ifeq ($(CONFIG_PP),yes)
6d9a2421 59 $(MAKE) -C libpostproc all
1a9150b1 60endif
790c9ca7
LA
61ifeq ($(CONFIG_SWSCALER),yes)
62 $(MAKE) -C libswscale all
63endif
85f07f22 64
951bf3e6 65ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
6de9e506 66 $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
85f07f22 67
951bf3e6 68ffserver$(EXESUF): ffserver.o .libs
6de9e506 69 $(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(EXTRALIBS)
85f07f22 70
951bf3e6 71ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
6de9e506 72 $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
01310af2 73
0cfd96cc 74%$(EXESUF): %_g$(EXESUF)
01310af2
FB
75 cp -p $< $@
76 $(STRIP) $@
77
a4da50e1
MR
78SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
79ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
80version.h: $(SVN_ENTRIES)
81endif
82
f1cc88a5 83version.h:
997baf01 84 $(SRC_PATH)/version.sh $(SRC_PATH)
f1cc88a5 85
951bf3e6 86output_example$(EXESUF): output_example.o .libs
18caf192 87 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(EXTRALIBS)
8de65d4f 88
38100e8c 89qt-faststart$(EXESUF): qt-faststart.c
3acc68b4 90 $(CC) $(CFLAGS) $< -o $@
38100e8c 91
f7599d5f 92cws2fws$(EXESUF): cws2fws.c
18caf192 93 $(CC) $(CFLAGS) $< -o $@ -lz
f7599d5f 94
4566de57 95ffplay.o: CFLAGS += $(SDL_CFLAGS)
2744a37f 96
496cfa3c
MR
97ffmpeg.o ffplay.o ffserver.o: version.h
98
85f07f22 99%.o: %.c
115329f1 100 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 101
d6cfad67 102videohook: .libs
142fc6b9
PG
103 $(MAKE) -C vhook all
104
e9b19db8
DB
105documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
106 ffplay-doc.html hooks.html $(ALLMANPAGES))
107
108doc/%.html: doc/%.texi
109 texi2html -monolithic -number $<
110 mv $(@F) $@
111
112doc/%.pod: doc/%-doc.texi
113 doc/texi2pod.pl $< $@
114
115doc/%.1: doc/%.pod
116 pod2man --section=1 --center=" " --release=" " $< > $@
146ea952 117
4c9b0af5 118install: install-progs install-libs install-headers
81dcdc53 119
a4848db6 120ifeq ($(BUILD_SHARED),yes)
7d2f4546 121install-progs: $(PROGS) install-libs
a4848db6 122else
7d2f4546 123install-progs: $(PROGS)
a4848db6 124endif
951bf3e6 125 install -d "$(bindir)"
ca3798dc 126 install -c -m 755 $(PROGS) "$(bindir)"
85f07f22 127
7a7be126 128# Create the Windows installer.
d35ff76b
FB
129wininstaller: all install
130 makensis ffinstall.nsi
131
23a65308 132install-man:
8233b750
DB
133 install -d "$(mandir)/man1"
134 install -m 644 $(MANPAGES) "$(mandir)/man1"
23a65308 135
aa99b8ff
MN
136install-vhook:
137 $(MAKE) -C vhook install
142fc6b9 138
b12f8273 139install-libs:
8b2121e3
MR
140 $(MAKE) -C libavutil install-libs
141 $(MAKE) -C libavcodec install-libs
142 $(MAKE) -C libavformat install-libs
1a9150b1 143ifeq ($(CONFIG_PP),yes)
6d9a2421 144 $(MAKE) -C libpostproc install-libs
1a9150b1 145endif
790c9ca7
LA
146ifeq ($(CONFIG_SWSCALER),yes)
147 $(MAKE) -C libswscale install-libs
148endif
149
8b2121e3 150ifeq ($(BUILD_SHARED),yes)
1e7ffa50 151 -$(LDCONFIG)
b12f8273 152endif
37736979 153
f29f3b5d
DB
154install-headers:
155 $(MAKE) -C libavutil install-headers
156 $(MAKE) -C libavcodec install-headers
157 $(MAKE) -C libavformat install-headers
1a9150b1 158ifeq ($(CONFIG_PP),yes)
6d9a2421 159 $(MAKE) -C libpostproc install-headers
1a9150b1 160endif
790c9ca7 161 $(MAKE) -C libswscale install-headers
f29f3b5d 162
f9edb717
DB
163uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
164
f9edb717
DB
165uninstall-progs:
166 rm -f $(addprefix $(bindir)/, $(ALLPROGS))
167
f9edb717 168uninstall-man:
f9edb717 169 rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
f9edb717
DB
170
171uninstall-vhook:
172 $(MAKE) -C vhook uninstall
173
174uninstall-libs:
175 $(MAKE) -C libavutil uninstall-libs
176 $(MAKE) -C libavcodec uninstall-libs
177 $(MAKE) -C libavformat uninstall-libs
6d9a2421 178 $(MAKE) -C libpostproc uninstall-libs
f9edb717
DB
179
180uninstall-headers:
181 $(MAKE) -C libavutil uninstall-headers
182 $(MAKE) -C libavcodec uninstall-headers
183 $(MAKE) -C libavformat uninstall-headers
6d9a2421 184 $(MAKE) -C libpostproc uninstall-headers
f9edb717 185 -rmdir "$(incdir)"
f9edb717 186
354ca798 187depend dep: .depend
ea0f0681 188 $(MAKE) -C libavutil depend
5d22ccf7 189 $(MAKE) -C libavcodec depend
c80d990f 190 $(MAKE) -C libavformat depend
691c480e
DB
191ifeq ($(CONFIG_PP),yes)
192 $(MAKE) -C libpostproc depend
193endif
eaa6d7b6
DB
194ifeq ($(CONFIG_SWSCALER),yes)
195 $(MAKE) -C libswscale depend
196endif
d226c750 197ifeq ($(CONFIG_VHOOK),yes)
5d22ccf7 198 $(MAKE) -C vhook depend
811b32ed 199endif
4b8b2edb 200
fd071c26 201.depend: $(SRCS) version.h
0032cac2 202 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
57514323 203
da34f7ac
MR
204$(DEP_LIBS): lib
205
206.libs: $(DEP_LIBS)
207 touch $@
cf2818b0 208
98013cc1 209clean:
5d22ccf7
DB
210 $(MAKE) -C libavutil clean
211 $(MAKE) -C libavcodec clean
abac6175 212 $(MAKE) -C libavformat clean
6d9a2421 213 $(MAKE) -C libpostproc clean
790c9ca7 214 $(MAKE) -C libswscale clean
5d22ccf7 215 $(MAKE) -C vhook clean
b8d40825 216 rm -f *.o *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
3e4134f6 217 output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
e9b19db8 218 rm -f doc/*.html doc/*.pod doc/*.1
4fbd52f0
DB
219 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
220 rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
142fc6b9 221
85f07f22 222distclean: clean
98013cc1
DB
223 $(MAKE) -C libavutil distclean
224 $(MAKE) -C libavcodec distclean
225 $(MAKE) -C libavformat distclean
6d9a2421 226 $(MAKE) -C libpostproc distclean
790c9ca7 227 $(MAKE) -C libswscale distclean
98013cc1 228 $(MAKE) -C vhook distclean
5c6a5d58 229 rm -f .depend version.h config.* *.pc
85f07f22
FB
230
231TAGS:
abac6175 232 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 233
dd9ca370
FB
234# regression tests
235
4fbd52f0 236fulltest test: codectest libavtest seektest
4fbd52f0
DB
237
238FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
239FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
240LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
241ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
242SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
243
b13cdd33 244test-server: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
4fbd52f0
DB
245 @echo
246 @echo "Unfortunately ffserver is broken and therefore its regression"
247 @echo "test fails randomly. Treat the results accordingly."
248 @echo
249 $(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
250
b13cdd33 251codectest mpeg4 mpeg ac3 snow snowll: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw tests/tiny_psnr$(EXESUF)
4fbd52f0
DB
252 $(SRC_PATH)/tests/regression.sh $@ $(FFMPEG_REFFILE) tests/vsynth1
253 $(SRC_PATH)/tests/regression.sh $@ $(ROTOZOOM_REFFILE) tests/vsynth2
254
255ifeq ($(CONFIG_GPL),yes)
b13cdd33 256libavtest: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
4fbd52f0
DB
257 $(SRC_PATH)/tests/regression.sh $@ $(LIBAV_REFFILE) tests/vsynth1
258seektest: tests/seek_test$(EXESUF)
259 $(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE)
260else
261libavtest seektest:
262 @echo
263 @echo "This test requires FFmpeg to be compiled with --enable-gpl."
264 @echo
265 @exit 1
266endif
267
268ifeq ($(CONFIG_SWSCALER),yes)
269test-server codectest mpeg4 mpeg ac3 snow snowll libavtest: swscale_error
270swscale_error:
271 @echo
272 @echo "This regression test is incompatible with --enable-swscaler."
273 @echo
274 @exit 1
275endif
276
277tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
278 mkdir -p tests/vsynth1
279 $(BUILD_ROOT)/$< 'tests/vsynth1/'
280
281tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
282 mkdir -p tests/vsynth2
283 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
284
285tests/asynth1.sw: tests/audiogen$(EXESUF)
286 $(BUILD_ROOT)/$< $@
287
288%$(EXESUF): %.c
289 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
290
291tests/seek_test$(EXESUF): tests/seek_test.c
292 $(CC) $(LDFLAGS) $(CFLAGS) -DHAVE_AV_CONFIG_H -o $@ $< $(EXTRALIBS)
293
dd9ca370 294
3263626f 295.PHONY: all lib videohook documentation install* wininstaller uninstall*
bedb3550 296.PHONY: dep depend clean distclean TAGS
5e2dfd39 297.PHONY: codectest libavtest seektest test-server fulltest test
4fbd52f0 298.PHONY: mpeg4 mpeg ac3 snow snowll swscale-error
cf2818b0 299
6ca0c110 300-include .depend