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