change name from stream type to frame type in AC3 code
[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
a426bbfc
MR
7SRC_DIR = $(SRC_PATH_BARE)
8
de2f77d8
MR
9vpath %.c $(SRC_PATH_BARE)
10vpath %.h $(SRC_PATH_BARE)
11vpath %.texi $(SRC_PATH_BARE)
dd9ca370 12
0cb8579a
MR
13PROGS-$(CONFIG_FFMPEG) += ffmpeg
14PROGS-$(CONFIG_FFPLAY) += ffplay
15PROGS-$(CONFIG_FFSERVER) += ffserver
01310af2 16
bb8fe69a
DB
17PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
18PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
916dafd5 19PROGS_SRCS = $(addsuffix .c, $(PROGS-yes)) cmdutils.c
bb8fe69a 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)
c721d803 28DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF) libavdevice/$(SLIBPREF)avdevice$(SLIBSUF)
0fd94442 29else
c721d803 30DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF) libavdevice/$(LIBPREF)avdevice$(LIBSUF)
f02be79d
RS
31endif
32
7d6ac9a3
MR
33ALL_TARGETS-$(CONFIG_VHOOK) += videohook
34ALL_TARGETS-$(BUILD_DOC) += documentation
35
36INSTALL_TARGETS-$(CONFIG_VHOOK) += install-vhook
1217916b
DB
37ifneq ($(PROGS),)
38INSTALL_TARGETS-yes += install-progs
282db5fd 39INSTALL_TARGETS-$(BUILD_DOC) += install-man
1217916b 40endif
dfd10838 41INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
dd9f3d97 42
27217159
DB
43main: lib $(PROGS_G) $(PROGS) $(ALL_TARGETS-yes)
44
45%$(EXESUF): %_g$(EXESUF)
46 cp -p $< $@
47 $(STRIP) $@
48
49vhook/%.o: vhook/%.c
50 $(CC) $(VHOOKCFLAGS) -c -o $@ $<
51
7716f7ff
DB
52.depend: version.h $(PROGS_SRCS)
53
9bcc2883
DB
54# bandaid to disable triggering shared library installation routines
55DISABLE=yes
56
7716f7ff
DB
57include common.mak
58
3b26ee47 59VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
dd9f3d97
MR
60
61BASEHOOKS = fish null watermark
62ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm
63ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS)))
64
65HOOKS-$(HAVE_FORK) += ppm
66HOOKS-$(HAVE_IMLIB2) += imlib2
67HOOKS-$(HAVE_FREETYPE2) += drawtext
68
69HOOKS = $(addprefix vhook/, $(addsuffix $(SLIBSUF), $(BASEHOOKS) $(HOOKS-yes)))
70
71VHOOKCFLAGS-$(HAVE_IMLIB2) += `imlib2-config --cflags`
cbefadbd 72LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs`
dd9f3d97
MR
73
74VHOOKCFLAGS-$(HAVE_FREETYPE2) += `freetype-config --cflags`
cbefadbd 75LIBS_drawtext$(SLIBSUF) = `freetype-config --libs`
dd9f3d97
MR
76
77VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
142fc6b9 78
88ad0368
DB
79LDFLAGS-$(CONFIG_SWSCALE) += -L$(BUILD_ROOT)/libswscale
80LDFLAGS-$(CONFIG_AVFILTER) += -L$(BUILD_ROOT)/libavfilter
81LDFLAGS := $(LDFLAGS-yes) -L$(BUILD_ROOT)/libavdevice -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil -g $(LDFLAGS)
57514323 82
88ad0368
DB
83EXTRALIBS-$(CONFIG_AVFILTER) += -lavfilter$(BUILDSUF)
84EXTRALIBS-$(CONFIG_SWSCALE) += -lswscale$(BUILDSUF)
85EXTRALIBS := $(EXTRALIBS-yes) -lavdevice$(BUILDSUF) -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
f7679c54 86
a11f43a4
MR
87MAKE-yes = $(MAKE)
88MAKE- = : $(MAKE)
89
951bf3e6 90lib:
20963a71
MR
91 $(MAKE) -C libavutil all
92 $(MAKE) -C libavcodec all
93 $(MAKE) -C libavformat all
94 $(MAKE) -C libavdevice all
4a24ab64 95 $(MAKE-$(CONFIG_POSTPROC)) -C libpostproc all
13ca50f3 96 $(MAKE-$(CONFIG_SWSCALE)) -C libswscale all
f7679c54 97 $(MAKE-$(CONFIG_AVFILTER)) -C libavfilter all
85f07f22 98
b1b18481
DB
99ffplay_g$(EXESUF): EXTRALIBS += $(SDL_LIBS)
100ffserver_g$(EXESUF): LDFLAGS += $(FFSERVERLDFLAGS)
85f07f22 101
b1b18481
DB
102%_g$(EXESUF): %.o cmdutils.o .libs
103 $(CC) $(LDFLAGS) -o $@ $< cmdutils.o $(EXTRALIBS)
01310af2 104
a4da50e1
MR
105SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
106ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
107version.h: $(SVN_ENTRIES)
108endif
109
f1cc88a5 110version.h:
997baf01 111 $(SRC_PATH)/version.sh $(SRC_PATH)
f1cc88a5 112
951bf3e6 113output_example$(EXESUF): output_example.o .libs
18caf192 114 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(EXTRALIBS)
8de65d4f 115
1521c500
DB
116tools/%$(EXESUF): tools/%.c
117 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(EXTRALIBS)
6da7cc81 118
3c889b5c 119ffplay.o .depend: CFLAGS += $(SDL_CFLAGS)
2744a37f 120
496cfa3c
MR
121ffmpeg.o ffplay.o ffserver.o: version.h
122
bab785a5
DB
123# vhooks compile fine without libav*, but need them nonetheless.
124videohook: .libs $(HOOKS)
ed5614eb
DB
125
126vhook/%$(SLIBSUF): vhook/%.o
3b26ee47 127 $(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
ed5614eb 128
e9b19db8 129documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
d0e1cd3d
DB
130 ffplay-doc.html general.html hooks.html \
131 $(ALLMANPAGES))
e9b19db8
DB
132
133doc/%.html: doc/%.texi
134 texi2html -monolithic -number $<
135 mv $(@F) $@
136
137doc/%.pod: doc/%-doc.texi
138 doc/texi2pod.pl $< $@
139
140doc/%.1: doc/%.pod
141 pod2man --section=1 --center=" " --release=" " $< > $@
146ea952 142
a7319cc2
DB
143install: $(INSTALL_TARGETS-yes)
144
c1ac39b3 145install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
22a324da
DB
146 install -d "$(BINDIR)"
147 install -c -m 755 $(PROGS) "$(BINDIR)"
85f07f22 148
23a65308 149install-man:
22a324da
DB
150 install -d "$(MANDIR)/man1"
151 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
23a65308 152
ed5614eb 153install-vhook: videohook
22a324da
DB
154 install -d "$(SHLIBDIR)/vhook"
155 install -m 755 $(HOOKS) "$(SHLIBDIR)/vhook"
142fc6b9 156
b12f8273 157install-libs:
20963a71
MR
158 $(MAKE) -C libavutil install-libs
159 $(MAKE) -C libavcodec install-libs
160 $(MAKE) -C libavformat install-libs
161 $(MAKE) -C libavdevice install-libs
4a24ab64 162 $(MAKE-$(CONFIG_POSTPROC)) -C libpostproc install-libs
13ca50f3 163 $(MAKE-$(CONFIG_SWSCALE)) -C libswscale install-libs
3d323571 164 $(MAKE-$(CONFIG_AVFILTER)) -C libavfilter install-libs
37736979 165
7716f7ff 166install-headers::
61c51088
DB
167 $(MAKE) -C libavutil install-headers
168 $(MAKE) -C libavcodec install-headers
169 $(MAKE) -C libavformat install-headers
170 $(MAKE) -C libavdevice install-headers
4a24ab64 171 $(MAKE-$(CONFIG_POSTPROC)) -C libpostproc install-headers
61c51088 172 $(MAKE) -C libswscale install-headers
f7679c54 173 $(MAKE-$(CONFIG_AVFILTER)) -C libavfilter install-headers
f29f3b5d 174
7716f7ff 175uninstall: uninstall-progs uninstall-man uninstall-vhook
f9edb717 176
f9edb717 177uninstall-progs:
1c2211bd 178 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
f9edb717 179
f9edb717 180uninstall-man:
1c2211bd 181 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
f9edb717
DB
182
183uninstall-vhook:
1c2211bd 184 rm -f $(addprefix "$(SHLIBDIR)/",$(ALLHOOKS_SRCS:.c=$(SLIBSUF)))
22a324da 185 -rmdir "$(SHLIBDIR)/vhook/"
f9edb717 186
7716f7ff 187uninstall-libs::
f9edb717
DB
188 $(MAKE) -C libavutil uninstall-libs
189 $(MAKE) -C libavcodec uninstall-libs
190 $(MAKE) -C libavformat uninstall-libs
c721d803 191 $(MAKE) -C libavdevice uninstall-libs
6d9a2421 192 $(MAKE) -C libpostproc uninstall-libs
65f37992 193 $(MAKE) -C libswscale uninstall-libs
f7679c54 194 $(MAKE) -C libavfilter uninstall-libs
f9edb717 195
7716f7ff 196uninstall-headers::
f9edb717
DB
197 $(MAKE) -C libavutil uninstall-headers
198 $(MAKE) -C libavcodec uninstall-headers
199 $(MAKE) -C libavformat uninstall-headers
c721d803 200 $(MAKE) -C libavdevice uninstall-headers
6d9a2421 201 $(MAKE) -C libpostproc uninstall-headers
65f37992 202 $(MAKE) -C libswscale uninstall-headers
f7679c54 203 $(MAKE) -C libavfilter uninstall-headers
22a324da 204 -rmdir "$(INCDIR)"
f9edb717 205
7716f7ff 206depend dep: .vhookdep
20963a71
MR
207 $(MAKE) -C libavutil depend
208 $(MAKE) -C libavcodec depend
209 $(MAKE) -C libavformat depend
210 $(MAKE) -C libavdevice depend
4a24ab64 211 $(MAKE-$(CONFIG_POSTPROC)) -C libpostproc depend
13ca50f3 212 $(MAKE-$(CONFIG_SWSCALE)) -C libswscale depend
f7679c54 213 $(MAKE-$(CONFIG_AVFILTER)) -C libavfilter depend
4b8b2edb 214
fc900b7b 215.vhookdep: $(ALLHOOKS_SRCS) version.h
315c741d 216 $(VHOOK_DEPEND_CMD) > $@
57514323 217
da34f7ac
MR
218$(DEP_LIBS): lib
219
220.libs: $(DEP_LIBS)
221 touch $@
cf2818b0 222
7716f7ff 223clean::
5d22ccf7
DB
224 $(MAKE) -C libavutil clean
225 $(MAKE) -C libavcodec clean
abac6175 226 $(MAKE) -C libavformat clean
c721d803 227 $(MAKE) -C libavdevice clean
6d9a2421 228 $(MAKE) -C libpostproc clean
790c9ca7 229 $(MAKE) -C libswscale clean
f7679c54 230 $(MAKE) -C libavfilter clean
7716f7ff 231 rm -f .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
2b258bba 232 output_example$(EXESUF)
e9b19db8 233 rm -f doc/*.html doc/*.pod doc/*.1
4fbd52f0
DB
234 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
235 rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
2b258bba 236 rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
ed5614eb 237 rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
142fc6b9 238
7716f7ff 239distclean::
98013cc1
DB
240 $(MAKE) -C libavutil distclean
241 $(MAKE) -C libavcodec distclean
242 $(MAKE) -C libavformat distclean
c721d803 243 $(MAKE) -C libavdevice distclean
6d9a2421 244 $(MAKE) -C libpostproc distclean
790c9ca7 245 $(MAKE) -C libswscale distclean
f7679c54 246 $(MAKE) -C libavfilter distclean
7716f7ff 247 rm -f .vhookdep version.h config.* *.pc
85f07f22 248
dd9ca370
FB
249# regression tests
250
4fbd52f0 251fulltest test: codectest libavtest seektest
4fbd52f0
DB
252
253FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
254FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
255LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
256ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
257SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
258
4383ed5c
MR
259CODEC_TESTS = $(addprefix regtest-, \
260 mpeg \
261 mpeg2 \
262 mpeg2thread \
263 msmpeg4v2 \
264 msmpeg4 \
265 wmv1 \
266 wmv2 \
267 h261 \
268 h263 \
269 h263p \
270 mpeg4 \
271 huffyuv \
272 rc \
273 mpeg4adv \
274 mpeg4thread \
4383ed5c
MR
275 error \
276 mpeg4nr \
277 mpeg1b \
278 mjpeg \
279 ljpeg \
280 jpegls \
281 rv10 \
282 rv20 \
283 asv1 \
284 asv2 \
285 flv \
286 ffv1 \
287 snow \
288 snowll \
289 dv \
290 dv50 \
291 svq1 \
292 flashsv \
293 mp2 \
294 ac3 \
295 g726 \
296 adpcm_ima_wav \
9dc92a38 297 adpcm_ima_qt \
4383ed5c
MR
298 adpcm_ms \
299 adpcm_yam \
300 adpcm_swf \
301 flac \
302 wma \
303 )
304
2009721d
MR
305LAVF_TESTS = $(addprefix regtest-, \
306 avi \
307 asf \
308 rm \
309 mpg \
310 ts \
311 swf \
312 ffm \
313 flv_fmt \
314 mov \
315 dv_fmt \
316 gxf \
317 nut \
318 mkv \
319 pbmpipe \
320 pgmpipe \
321 ppmpipe \
322 gif \
323 yuv4mpeg \
324 pgm \
325 ppm \
326 bmp \
327 tga \
328 tiff \
329 sgi \
330 jpg \
331 wav \
332 alaw \
333 mulaw \
334 au \
335 mmf \
336 aiff \
337 voc \
338 ogg \
339 pixfmt \
340 )
4383ed5c
MR
341
342REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
343
344CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
345CODEC_VSYNTH = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
346
347LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
348
349LAVF_REG = tests/data/lavf.regression
350ROTOZOOM_REG = tests/data/rotozoom.regression
351VSYNTH_REG = tests/data/vsynth.regression
352
353codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
4411cb11
MR
354 diff -u -w $(FFMPEG_REFFILE) $(VSYNTH_REG)
355 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
4383ed5c
MR
356
357libavtest: $(LAVF_REG)
358 diff -u -w $(LIBAV_REFFILE) $(LAVF_REG)
359
360$(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
361 cat $^ > $@
362
363$(LAVF_REG): $(LAVF_REGFILES)
364$(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
365$(VSYNTH_REG): $(CODEC_VSYNTH)
366
367$(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
368
369$(LAVF_REGFILES): $(LAVF_TESTS)
370
371$(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
372
373regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw
374
375$(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(EXESUF)
2009721d
MR
376 $(SRC_PATH)/tests/regression.sh $@ vsynth tests/vsynth1 a
377 $(SRC_PATH)/tests/regression.sh $@ rotozoom tests/vsynth2 a
4383ed5c
MR
378
379$(LAVF_TESTS):
2009721d 380 $(SRC_PATH)/tests/regression.sh $@ lavf tests/vsynth1 b
4383ed5c
MR
381
382seektest: codectest libavtest tests/seek_test$(EXESUF)
383 $(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE)
384
b13cdd33 385test-server: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
4fbd52f0
DB
386 @echo
387 @echo "Unfortunately ffserver is broken and therefore its regression"
388 @echo "test fails randomly. Treat the results accordingly."
389 @echo
390 $(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
391
13ca50f3 392ifeq ($(CONFIG_SWSCALE),yes)
4383ed5c 393test-server codectest $(CODEC_TESTS) libavtest: swscale_error
4fbd52f0
DB
394swscale_error:
395 @echo
13ca50f3 396 @echo "This regression test is incompatible with --enable-swscale."
4fbd52f0
DB
397 @echo
398 @exit 1
399endif
400
401tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
402 mkdir -p tests/vsynth1
403 $(BUILD_ROOT)/$< 'tests/vsynth1/'
404
405tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
406 mkdir -p tests/vsynth2
407 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
408
409tests/asynth1.sw: tests/audiogen$(EXESUF)
410 $(BUILD_ROOT)/$< $@
411
412%$(EXESUF): %.c
413 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
414
06396e11 415tests/seek_test$(EXESUF): tests/seek_test.c .libs
ff21c1b0 416 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $< $(EXTRALIBS)
4fbd52f0 417
dd9ca370 418
7716f7ff 419.PHONY: lib videohook documentation TAGS
5e2dfd39 420.PHONY: codectest libavtest seektest test-server fulltest test
4383ed5c 421.PHONY: $(CODEC_TESTS) $(LAVF_TESTS) regtest-ref swscale-error
cf2818b0 422
3b26ee47 423-include .vhookdep