Mark dvdaudio_substream_type variable as av_uninit to work around false
[FFMpeg-mirror/lagarith.git] / Makefile
blobe46c7e13e0771a1234b467a2e9393bbc6b8a45e4
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
24 FFLIBS := avdevice avformat avcodec avutil swscale
26 DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
28 include common.mak
30 FF_LDFLAGS := $(FFLDFLAGS)
31 FF_EXTRALIBS := $(FFEXTRALIBS)
32 FF_DEP_LIBS := $(DEP_LIBS)
34 ALL_TARGETS-$(BUILD_DOC) += documentation
36 ifneq ($(PROGS),)
37 INSTALL_TARGETS-yes += install-progs install-data
38 INSTALL_TARGETS-$(BUILD_DOC) += install-man
39 endif
40 INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
42 all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
44 $(PROGS): %$(EXESUF): %_g$(EXESUF)
45 cp -p $< $@
46 $(STRIP) $@
48 SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTS
50 define RESET
51 $(1) :=
52 $(1)-yes :=
53 endef
55 define DOSUBDIR
56 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
57 SUBDIR := $(1)/
58 include $(1)/Makefile
59 endef
61 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
63 ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
64 ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
66 %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
67 $(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
69 output_example$(EXESUF): output_example.o $(FF_DEP_LIBS)
70 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
72 tools/%$(EXESUF): tools/%.c
73 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
75 ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
77 cmdutils.o cmdutils.d: version.h
79 alltools: $(addsuffix $(EXESUF),$(addprefix tools/, cws2fws pktdumper qt-faststart trasher))
81 documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
82 ffplay-doc.html general.html $(ALLMANPAGES))
84 doc/%.html: doc/%.texi
85 texi2html -monolithic -number $<
86 mv $(@F) $@
88 doc/%.pod: doc/%-doc.texi
89 doc/texi2pod.pl $< $@
91 doc/%.1: doc/%.pod
92 pod2man --section=1 --center=" " --release=" " $< > $@
94 install: $(INSTALL_TARGETS-yes)
96 install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
97 install -d "$(BINDIR)"
98 install -c -m 755 $(PROGS) "$(BINDIR)"
100 install-data: $(DATA_FILES)
101 install -d "$(DATADIR)"
102 install -m 644 $(DATA_FILES) "$(DATADIR)"
104 install-man: $(MANPAGES)
105 install -d "$(MANDIR)/man1"
106 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
108 uninstall: uninstall-progs uninstall-data uninstall-man
110 uninstall-progs:
111 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
113 uninstall-data:
114 rm -rf "$(DATADIR)"
116 uninstall-man:
117 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
119 testclean:
120 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
122 clean:: testclean
123 rm -f $(ALLPROGS) $(ALLPROGS_G) output_example$(EXESUF)
124 rm -f doc/*.html doc/*.pod doc/*.1
125 rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
126 rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
128 distclean::
129 rm -f version.h config.*
131 # regression tests
133 check: test checkheaders
135 fulltest test: codectest libavtest seektest
137 FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
138 FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
139 LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
140 ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
141 SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
143 CODEC_TESTS = $(addprefix regtest-, \
144 mpeg \
145 mpeg2 \
146 mpeg2thread \
147 msmpeg4v2 \
148 msmpeg4 \
149 wmv1 \
150 wmv2 \
151 h261 \
152 h263 \
153 h263p \
154 mpeg4 \
155 huffyuv \
156 rc \
157 mpeg4adv \
158 mpeg4thread \
159 error \
160 mpeg4nr \
161 mpeg1b \
162 mjpeg \
163 ljpeg \
164 jpegls \
165 rv10 \
166 rv20 \
167 asv1 \
168 asv2 \
169 flv \
170 ffv1 \
171 snow \
172 snowll \
173 dv \
174 dv50 \
175 svq1 \
176 flashsv \
177 mp2 \
178 ac3 \
179 g726 \
180 adpcm_ima_wav \
181 adpcm_ima_qt \
182 adpcm_ms \
183 adpcm_yam \
184 adpcm_swf \
185 flac \
186 wma \
187 pcm \
190 LAVF_TESTS = $(addprefix regtest-, \
191 avi \
192 asf \
193 rm \
194 mpg \
195 ts \
196 swf \
197 ffm \
198 flv_fmt \
199 mov \
200 dv_fmt \
201 gxf \
202 nut \
203 mkv \
204 pbmpipe \
205 pgmpipe \
206 ppmpipe \
207 gif \
208 yuv4mpeg \
209 pgm \
210 ppm \
211 bmp \
212 tga \
213 tiff \
214 sgi \
215 jpg \
216 wav \
217 alaw \
218 mulaw \
219 au \
220 mmf \
221 aiff \
222 voc \
223 ogg \
224 pixfmt \
227 REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
229 CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
230 CODEC_VSYNTH = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
232 LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
234 LAVF_REG = tests/data/lavf.regression
235 ROTOZOOM_REG = tests/data/rotozoom.regression
236 VSYNTH_REG = tests/data/vsynth.regression
238 ifneq ($(CONFIG_ZLIB),yes)
239 regtest-flashsv codectest: zlib-error
240 endif
241 zlib-error:
242 @echo
243 @echo "This regression test requires zlib."
244 @echo
245 @exit 1
247 codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
248 diff -u -w $(FFMPEG_REFFILE) $(VSYNTH_REG)
249 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
251 libavtest: $(LAVF_REG)
252 diff -u -w $(LIBAV_REFFILE) $(LAVF_REG)
254 $(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
255 cat $^ > $@
257 $(LAVF_REG): $(LAVF_REGFILES)
258 $(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
259 $(VSYNTH_REG): $(CODEC_VSYNTH)
261 $(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
263 $(LAVF_REGFILES): $(LAVF_TESTS)
265 $(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
267 regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw
269 $(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(EXESUF)
270 $(SRC_PATH)/tests/regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
271 $(SRC_PATH)/tests/regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
273 $(LAVF_TESTS):
274 $(SRC_PATH)/tests/regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
276 seektest: codectest libavtest tests/seek_test$(EXESUF)
277 $(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
279 servertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
280 @echo
281 @echo "Unfortunately ffserver is broken and therefore its regression"
282 @echo "test fails randomly. Treat the results accordingly."
283 @echo
284 $(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
286 tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
287 mkdir -p tests/vsynth1
288 $(BUILD_ROOT)/$< 'tests/vsynth1/'
290 tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
291 mkdir -p tests/vsynth2
292 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
294 tests/asynth1.sw: tests/audiogen$(EXESUF)
295 $(BUILD_ROOT)/$< $@
297 tests/%$(EXESUF): tests/%.c
298 $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
300 tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
301 $(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
304 .PHONY: lib documentation *test regtest-* swscale-error zlib-error alltools check