cosmetics: add an @return to documentation for decode_frame_header()
[FFMpeg-mirror/lagarith.git] / Makefile
blob5dd4cf1a8a344d58669a692b0eed29933ccb1b37
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 EXAMPLES = output_example$(EXESUF)
30 include common.mak
32 FF_LDFLAGS := $(FFLDFLAGS)
33 FF_EXTRALIBS := $(FFEXTRALIBS)
34 FF_DEP_LIBS := $(DEP_LIBS)
36 ALL_TARGETS-$(BUILD_DOC) += documentation
38 ifneq ($(PROGS),)
39 INSTALL_TARGETS-yes += install-progs install-data
40 INSTALL_TARGETS-$(BUILD_DOC) += install-man
41 endif
42 INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
44 all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
46 $(PROGS): %$(EXESUF): %_g$(EXESUF)
47 cp -p $< $@
48 $(STRIP) $@
50 SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES
52 define RESET
53 $(1) :=
54 $(1)-yes :=
55 endef
57 define DOSUBDIR
58 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
59 SUBDIR := $(1)/
60 include $(1)/Makefile
61 endef
63 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
65 ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
66 ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
68 %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
69 $(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
71 output_example$(EXESUF): output_example.o $(FF_DEP_LIBS)
72 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
74 tools/%$(EXESUF): tools/%.c
75 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
77 ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
79 cmdutils.o cmdutils.d: version.h
81 alltools: $(addsuffix $(EXESUF),$(addprefix tools/, cws2fws pktdumper qt-faststart trasher))
83 documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
84 ffplay-doc.html general.html $(ALLMANPAGES))
86 doc/%.html: doc/%.texi
87 texi2html -monolithic -number $<
88 mv $(@F) $@
90 doc/%.pod: doc/%-doc.texi
91 doc/texi2pod.pl $< $@
93 doc/%.1: doc/%.pod
94 pod2man --section=1 --center=" " --release=" " $< > $@
96 install: $(INSTALL_TARGETS-yes)
98 install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
99 install -d "$(BINDIR)"
100 install -c -m 755 $(PROGS) "$(BINDIR)"
102 install-data: $(DATA_FILES)
103 install -d "$(DATADIR)"
104 install -m 644 $(DATA_FILES) "$(DATADIR)"
106 install-man: $(MANPAGES)
107 install -d "$(MANDIR)/man1"
108 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
110 uninstall: uninstall-progs uninstall-data uninstall-man
112 uninstall-progs:
113 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
115 uninstall-data:
116 rm -rf "$(DATADIR)"
118 uninstall-man:
119 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
121 testclean:
122 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
124 clean:: testclean
125 rm -f $(ALLPROGS) $(ALLPROGS_G) output_example$(EXESUF)
126 rm -f doc/*.html doc/*.pod doc/*.1
127 rm -f tests/seek_test$(EXESUF)
128 rm -f $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
129 rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
131 distclean::
132 rm -f version.h config.*
134 # regression tests
136 check: test checkheaders
138 fulltest test: codectest libavtest seektest
140 FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
141 FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
142 LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
143 ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
144 SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
146 CODEC_TESTS = $(addprefix regtest-, \
147 mpeg \
148 mpeg2 \
149 mpeg2thread \
150 msmpeg4v2 \
151 msmpeg4 \
152 wmv1 \
153 wmv2 \
154 h261 \
155 h263 \
156 h263p \
157 mpeg4 \
158 huffyuv \
159 rc \
160 mpeg4adv \
161 mpeg4thread \
162 error \
163 mpeg4nr \
164 mpeg1b \
165 mjpeg \
166 ljpeg \
167 jpegls \
168 rv10 \
169 rv20 \
170 asv1 \
171 asv2 \
172 flv \
173 ffv1 \
174 snow \
175 snowll \
176 dv \
177 dv50 \
178 svq1 \
179 flashsv \
180 mp2 \
181 ac3 \
182 g726 \
183 adpcm_ima_wav \
184 adpcm_ima_qt \
185 adpcm_ms \
186 adpcm_yam \
187 adpcm_swf \
188 flac \
189 wma \
190 pcm \
193 LAVF_TESTS = $(addprefix regtest-, \
194 avi \
195 asf \
196 rm \
197 mpg \
198 mxf \
199 ts \
200 swf \
201 ffm \
202 flv_fmt \
203 mov \
204 dv_fmt \
205 gxf \
206 nut \
207 mkv \
208 pbmpipe \
209 pgmpipe \
210 ppmpipe \
211 gif \
212 yuv4mpeg \
213 pgm \
214 ppm \
215 bmp \
216 tga \
217 tiff \
218 sgi \
219 jpg \
220 wav \
221 alaw \
222 mulaw \
223 au \
224 mmf \
225 aiff \
226 voc \
227 ogg \
228 pixfmt \
229 pcx \
232 REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
234 CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
235 CODEC_VSYNTH = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
237 LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
239 LAVF_REG = tests/data/lavf.regression
240 ROTOZOOM_REG = tests/data/rotozoom.regression
241 VSYNTH_REG = tests/data/vsynth.regression
243 ifneq ($(CONFIG_ZLIB),yes)
244 regtest-flashsv codectest: zlib-error
245 endif
246 zlib-error:
247 @echo
248 @echo "This regression test requires zlib."
249 @echo
250 @exit 1
252 codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
253 diff -u -w $(FFMPEG_REFFILE) $(VSYNTH_REG)
254 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
256 libavtest: $(LAVF_REG)
257 diff -u -w $(LIBAV_REFFILE) $(LAVF_REG)
259 $(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
260 cat $^ > $@
262 $(LAVF_REG): $(LAVF_REGFILES)
263 $(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
264 $(VSYNTH_REG): $(CODEC_VSYNTH)
266 $(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
268 $(LAVF_REGFILES): $(LAVF_TESTS)
270 $(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
272 regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw
274 $(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(HOSTEXESUF)
275 $(SRC_PATH)/tests/regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
276 $(SRC_PATH)/tests/regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
278 $(LAVF_TESTS):
279 $(SRC_PATH)/tests/regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
281 seektest: codectest libavtest tests/seek_test$(EXESUF)
282 $(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
284 servertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
285 @echo
286 @echo "Unfortunately ffserver is broken and therefore its regression"
287 @echo "test fails randomly. Treat the results accordingly."
288 @echo
289 $(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
291 tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
292 mkdir -p tests/vsynth1
293 $(BUILD_ROOT)/$< 'tests/vsynth1/'
295 tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
296 mkdir -p tests/vsynth2
297 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
299 tests/asynth1.sw: tests/audiogen$(HOSTEXESUF)
300 $(BUILD_ROOT)/$< $@
302 tests/%$(HOSTEXESUF): tests/%.c
303 $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
305 tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
306 $(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
309 .PHONY: documentation *test regtest-* zlib-error alltools check