Merge MP2, MP3 and MPEG audio demuxer entries.
[FFMpeg-mirror/lagarith.git] / Makefile
blob5e42841d9b9f7b33f9cde263971424eccad4c90a
1 include config.mak
3 SRC_DIR = $(SRC_PATH_BARE)
5 vpath %.texi $(SRC_PATH_BARE)
7 PROGS-$(CONFIG_FFMPEG) += ffmpeg
8 PROGS-$(CONFIG_FFPLAY) += ffplay
9 PROGS-$(CONFIG_FFSERVER) += ffserver
11 PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
12 PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
13 OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
14 MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
16 BASENAMES = ffmpeg ffplay ffserver
17 ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
18 ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
19 ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
21 FFLIBS-$(CONFIG_AVFILTER) += avfilter
22 FFLIBS-$(CONFIG_POSTPROC) += postproc
23 FFLIBS-$(CONFIG_SWSCALE) += swscale
25 FFLIBS := avdevice avformat avcodec avutil
27 DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
29 include common.mak
31 FF_LDFLAGS := $(FFLDFLAGS)
32 FF_EXTRALIBS := $(FFEXTRALIBS)
33 FF_DEP_LIBS := $(DEP_LIBS)
35 ALL_TARGETS-$(CONFIG_VHOOK) += videohook
36 ALL_TARGETS-$(BUILD_DOC) += documentation
38 INSTALL_TARGETS-$(CONFIG_VHOOK) += install-vhook
39 ifneq ($(PROGS),)
40 INSTALL_TARGETS-yes += install-progs install-data
41 INSTALL_TARGETS-$(BUILD_DOC) += install-man
42 endif
43 INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
45 all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
47 $(PROGS): %$(EXESUF): %_g$(EXESUF)
48 cp -p $< $@
49 $(STRIP) $@
51 SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTS
53 define RESET
54 $(1) :=
55 $(1)-yes :=
56 endef
58 define DOSUBDIR
59 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
60 SUBDIR := $(1)/
61 include $(1)/Makefile
62 endef
64 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
66 ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
67 ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
69 %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
70 $(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
72 output_example$(EXESUF): output_example.o $(FF_DEP_LIBS)
73 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
75 tools/%$(EXESUF): tools/%.c
76 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
78 ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
80 cmdutils.o cmdutils.d: version.h
82 alltools: $(addsuffix $(EXESUF),$(addprefix tools/, cws2fws pktdumper qt-faststart trasher))
84 VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
86 BASEHOOKS = fish null watermark
87 ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm
88 ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS)))
90 HOOKS-$(HAVE_FORK) += ppm
91 HOOKS-$(HAVE_IMLIB2) += imlib2
92 HOOKS-$(HAVE_FREETYPE2) += drawtext
94 HOOKS = $(addprefix vhook/, $(addsuffix $(SLIBSUF), $(BASEHOOKS) $(HOOKS-yes)))
96 VHOOKCFLAGS-$(HAVE_IMLIB2) += `imlib2-config --cflags`
97 LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs`
99 VHOOKCFLAGS-$(HAVE_FREETYPE2) += `freetype-config --cflags`
100 LIBS_drawtext$(SLIBSUF) = `freetype-config --libs`
102 VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
104 vhook/%.o vhook/%.d: CFLAGS:=$(VHOOKCFLAGS)
106 # vhooks compile fine without libav*, but need them nonetheless.
107 videohook: $(FF_DEP_LIBS) $(HOOKS)
109 $(eval VHOOKSHFLAGS=$(VHOOKSHFLAGS))
110 vhook/%$(SLIBSUF): vhook/%.o
111 $(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
113 VHOOK_DEPS = $(HOOKS:$(SLIBSUF)=.d)
114 depend dep: $(VHOOK_DEPS)
116 documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
117 ffplay-doc.html general.html hooks.html \
118 $(ALLMANPAGES))
120 doc/%.html: doc/%.texi
121 texi2html -monolithic -number $<
122 mv $(@F) $@
124 doc/%.pod: doc/%-doc.texi
125 doc/texi2pod.pl $< $@
127 doc/%.1: doc/%.pod
128 pod2man --section=1 --center=" " --release=" " $< > $@
130 install: $(INSTALL_TARGETS-yes)
132 install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
133 install -d "$(BINDIR)"
134 install -c -m 755 $(PROGS) "$(BINDIR)"
136 install-data: $(DATA_FILES)
137 install -d "$(DATADIR)"
138 install -m 644 $(DATA_FILES) "$(DATADIR)"
140 install-man: $(MANPAGES)
141 install -d "$(MANDIR)/man1"
142 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
144 install-vhook: videohook
145 install -d "$(SHLIBDIR)/vhook"
146 install -m 755 $(HOOKS) "$(SHLIBDIR)/vhook"
148 uninstall: uninstall-progs uninstall-data uninstall-man uninstall-vhook
150 uninstall-progs:
151 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
153 uninstall-data:
154 rm -rf "$(DATADIR)"
156 uninstall-man:
157 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
159 uninstall-vhook:
160 rm -f $(addprefix "$(SHLIBDIR)/",$(ALLHOOKS_SRCS:.c=$(SLIBSUF)))
161 -rmdir "$(SHLIBDIR)/vhook/"
163 testclean:
164 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
166 clean:: testclean
167 rm -f $(ALLPROGS) $(ALLPROGS_G) output_example$(EXESUF)
168 rm -f doc/*.html doc/*.pod doc/*.1
169 rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
170 rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
171 rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
173 distclean::
174 rm -f version.h config.* vhook/*.d
176 # regression tests
178 check: test checkheaders
180 fulltest test: codectest libavtest seektest
182 FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
183 FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
184 LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
185 ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
186 SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
188 CODEC_TESTS = $(addprefix regtest-, \
189 mpeg \
190 mpeg2 \
191 mpeg2thread \
192 msmpeg4v2 \
193 msmpeg4 \
194 wmv1 \
195 wmv2 \
196 h261 \
197 h263 \
198 h263p \
199 mpeg4 \
200 huffyuv \
201 rc \
202 mpeg4adv \
203 mpeg4thread \
204 error \
205 mpeg4nr \
206 mpeg1b \
207 mjpeg \
208 ljpeg \
209 jpegls \
210 rv10 \
211 rv20 \
212 asv1 \
213 asv2 \
214 flv \
215 ffv1 \
216 snow \
217 snowll \
218 dv \
219 dv50 \
220 svq1 \
221 flashsv \
222 mp2 \
223 ac3 \
224 g726 \
225 adpcm_ima_wav \
226 adpcm_ima_qt \
227 adpcm_ms \
228 adpcm_yam \
229 adpcm_swf \
230 flac \
231 wma \
232 pcm \
235 LAVF_TESTS = $(addprefix regtest-, \
236 avi \
237 asf \
238 rm \
239 mpg \
240 ts \
241 swf \
242 ffm \
243 flv_fmt \
244 mov \
245 dv_fmt \
246 gxf \
247 nut \
248 mkv \
249 pbmpipe \
250 pgmpipe \
251 ppmpipe \
252 gif \
253 yuv4mpeg \
254 pgm \
255 ppm \
256 bmp \
257 tga \
258 tiff \
259 sgi \
260 jpg \
261 wav \
262 alaw \
263 mulaw \
264 au \
265 mmf \
266 aiff \
267 voc \
268 ogg \
269 pixfmt \
272 REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
274 CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
275 CODEC_VSYNTH = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
277 LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
279 LAVF_REG = tests/data/lavf.regression
280 ROTOZOOM_REG = tests/data/rotozoom.regression
281 VSYNTH_REG = tests/data/vsynth.regression
283 ifneq ($(CONFIG_SWSCALE),yes)
284 servertest codectest $(CODEC_TESTS) libavtest: swscale-error
285 swscale-error:
286 @echo
287 @echo "This regression test requires --enable-swscale."
288 @echo
289 @exit 1
290 endif
292 ifneq ($(CONFIG_ZLIB),yes)
293 regtest-flashsv codectest: zlib-error
294 endif
295 zlib-error:
296 @echo
297 @echo "This regression test requires zlib."
298 @echo
299 @exit 1
301 codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
302 diff -u -w $(FFMPEG_REFFILE) $(VSYNTH_REG)
303 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
305 libavtest: $(LAVF_REG)
306 diff -u -w $(LIBAV_REFFILE) $(LAVF_REG)
308 $(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
309 cat $^ > $@
311 $(LAVF_REG): $(LAVF_REGFILES)
312 $(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
313 $(VSYNTH_REG): $(CODEC_VSYNTH)
315 $(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
317 $(LAVF_REGFILES): $(LAVF_TESTS)
319 $(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
321 regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw
323 $(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(EXESUF)
324 $(SRC_PATH)/tests/regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
325 $(SRC_PATH)/tests/regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
327 $(LAVF_TESTS):
328 $(SRC_PATH)/tests/regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
330 seektest: codectest libavtest tests/seek_test$(EXESUF)
331 $(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
333 servertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
334 @echo
335 @echo "Unfortunately ffserver is broken and therefore its regression"
336 @echo "test fails randomly. Treat the results accordingly."
337 @echo
338 $(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
340 tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
341 mkdir -p tests/vsynth1
342 $(BUILD_ROOT)/$< 'tests/vsynth1/'
344 tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
345 mkdir -p tests/vsynth2
346 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
348 tests/asynth1.sw: tests/audiogen$(EXESUF)
349 $(BUILD_ROOT)/$< $@
351 tests/%$(EXESUF): tests/%.c
352 $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
354 tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
355 $(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
358 .PHONY: lib videohook documentation *test regtest-* swscale-error zlib-error alltools check
360 -include $(VHOOK_DEPS)