Add missing doxy for function arguments.
[libav.git] / Makefile
CommitLineData
bde51e6a
JR
1include config.mak
2
3SRC_DIR = $(SRC_PATH_BARE)
4
5vpath %.texi $(SRC_PATH_BARE)
6
7PROGS-$(CONFIG_FFMPEG) += ffmpeg
8PROGS-$(CONFIG_FFPLAY) += ffplay
336ce917 9PROGS-$(CONFIG_FFPROBE) += ffprobe
bde51e6a
JR
10PROGS-$(CONFIG_FFSERVER) += ffserver
11
00962aba 12PROGS := $(addsuffix $(EXESUF), $(PROGS-yes))
bde51e6a
JR
13PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
14OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
15MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
dd46b538 16HTMLPAGES = $(addprefix doc/, $(addsuffix -doc.html, $(PROGS-yes)))
94f3c0e5 17TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
de4070b5 18HOSTPROGS = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
bde51e6a 19
336ce917 20BASENAMES = ffmpeg ffplay ffprobe ffserver
bde51e6a
JR
21ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
22ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
23ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
dd46b538 24ALLHTMLPAGES= $(addsuffix -doc.html, $(BASENAMES))
bde51e6a 25
5a0f7131 26FFLIBS-$(CONFIG_AVDEVICE) += avdevice
bde51e6a 27FFLIBS-$(CONFIG_AVFILTER) += avfilter
5a0f7131 28FFLIBS-$(CONFIG_AVFORMAT) += avformat
97d5fa38 29FFLIBS-$(CONFIG_AVCODEC) += avcodec
bde51e6a 30FFLIBS-$(CONFIG_POSTPROC) += postproc
5a0f7131 31FFLIBS-$(CONFIG_SWSCALE) += swscale
bde51e6a 32
5a0f7131 33FFLIBS := avutil
bde51e6a 34
a1a84f69
RS
35DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
36
9b55e2e7
MR
37SKIPHEADERS = cmdutils_common_opts.h
38
bde51e6a
JR
39include common.mak
40
41FF_LDFLAGS := $(FFLDFLAGS)
42FF_EXTRALIBS := $(FFEXTRALIBS)
43FF_DEP_LIBS := $(DEP_LIBS)
44
c73f65d9 45ALL_TARGETS-$(CONFIG_DOC) += documentation
bde51e6a 46
a48289c7 47ifdef PROGS
a1a84f69 48INSTALL_TARGETS-yes += install-progs install-data
c73f65d9 49INSTALL_TARGETS-$(CONFIG_DOC) += install-man
bde51e6a 50endif
bea81a52 51INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
bde51e6a
JR
52
53all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
54
55$(PROGS): %$(EXESUF): %_g$(EXESUF)
4335125c 56 $(CP) $< $@
bde51e6a
JR
57 $(STRIP) $@
58
95f2c769 59SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
de4070b5 60 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
f89c1402 61 HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS
bde51e6a
JR
62
63define RESET
64$(1) :=
65$(1)-yes :=
66endef
67
68define DOSUBDIR
69$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
70SUBDIR := $(1)/
71include $(1)/Makefile
72endef
73
74$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
75
76ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
77ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
78
79%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
684b28e0 80 $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 81
2dfa3054
MR
82tools/%$(EXESUF): tools/%.o
83 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
84
2205da0d 85tools/%.o: tools/%.c
2dfa3054 86 $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
bde51e6a
JR
87
88ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
89
6a53fffd 90VERSION_SH = $(SRC_PATH_BARE)/version.sh
f82bf850 91GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD
6a53fffd
MR
92SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
93
f82bf850 94.version: $(wildcard $(GIT_LOG) $(SVN_ENTRIES)) $(VERSION_SH) config.mak
6a53fffd
MR
95.version: M=@
96
97version.h .version:
0853a2b4 98 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
6a53fffd
MR
99 $(Q)touch .version
100
101# force version.sh to run whenever version might have changed
102-include .version
36798f1b 103
13b1c80b 104alltools: $(TOOLS)
9bce82fa 105
dd46b538
SS
106documentation: $(addprefix doc/, developer.html faq.html general.html libavfilter.html \
107 $(ALLHTMLPAGES) $(ALLMANPAGES))
108
109$(HTMLPAGES) $(MANPAGES): doc/fftools-common-opts.texi
bde51e6a 110
3275ac6a
SS
111doc/ffmpeg.pod doc/ffmpeg-doc.html: doc/filters.texi
112doc/ffplay.pod doc/ffplay-doc.html: doc/filters.texi
113
7732f641 114doc/%.html: TAG = HTML
bde51e6a 115doc/%.html: doc/%.texi
86be2bc3 116 $(M)cd doc && texi2html -monolithic -number $(<:doc/%=%)
bde51e6a 117
7732f641 118doc/%.pod: TAG = POD
bde51e6a 119doc/%.pod: doc/%-doc.texi
86be2bc3 120 $(M)doc/texi2pod.pl $< $@
bde51e6a 121
7732f641 122doc/%.1: TAG = MAN
bde51e6a 123doc/%.1: doc/%.pod
86be2bc3 124 $(M)pod2man --section=1 --center=" " --release=" " $< > $@
bde51e6a
JR
125
126install: $(INSTALL_TARGETS-yes)
127
128install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
63611f31 129 $(Q)mkdir -p "$(BINDIR)"
fd676deb 130 $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
bde51e6a 131
a1a84f69 132install-data: $(DATA_FILES)
63611f31 133 $(Q)mkdir -p "$(DATADIR)"
fd676deb 134 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
a1a84f69 135
bde51e6a 136install-man: $(MANPAGES)
63611f31 137 $(Q)mkdir -p "$(MANDIR)/man1"
fd676deb 138 $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
bde51e6a 139
d3cb93b3
RP
140uninstall: uninstall-progs uninstall-data uninstall-man
141
142uninstall-progs:
50e10cbd 143 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
d3cb93b3
RP
144
145uninstall-data:
50e10cbd 146 $(RM) -r "$(DATADIR)"
d3cb93b3
RP
147
148uninstall-man:
50e10cbd 149 $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
bde51e6a 150
250dd6f0 151testclean:
50e10cbd
MR
152 $(RM) -r tests/vsynth1 tests/vsynth2 tests/data
153 $(RM) $(addprefix tests/,$(CLEANSUFFIXES))
154 $(RM) tests/seek_test$(EXESUF) tests/seek_test.o
155 $(RM) $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
250dd6f0
FC
156
157clean:: testclean
50e10cbd
MR
158 $(RM) $(ALLPROGS) $(ALLPROGS_G)
159 $(RM) $(CLEANSUFFIXES)
160 $(RM) doc/*.html doc/*.pod doc/*.1
161 $(RM) $(TOOLS)
bde51e6a
JR
162
163distclean::
50e10cbd
MR
164 $(RM) $(DISTCLEANSUFFIXES)
165 $(RM) version.h config.* libavutil/avconfig.h
bde51e6a 166
0c3b2d65
MR
167config:
168 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
169
bde51e6a
JR
170# regression tests
171
5bab8536
DB
172check: test checkheaders
173
1cde611d 174fulltest test: codectest lavftest seektest
bde51e6a 175
bde51e6a 176FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
bde51e6a
JR
177SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
178
05e24fa8
MR
179ENCDEC = $(and $(CONFIG_$(1)_ENCODER),$(CONFIG_$(1)_DECODER))
180MUXDEM = $(and $(CONFIG_$(1)_MUXER),$(CONFIG_$(or $(2),$(1))_DEMUXER))
181
c676895f
MR
182VCODEC_TESTS =
183VCODEC_TESTS-$(call ENCDEC,ASV1) += asv1
184VCODEC_TESTS-$(call ENCDEC,ASV2) += asv2
185VCODEC_TESTS-$(call ENCDEC,DNXHD) += dnxhd_1080i dnxhd_720p dnxhd_720p_rd
186VCODEC_TESTS-$(call ENCDEC,DVVIDEO) += dv dv50
187VCODEC_TESTS-$(call ENCDEC,FFV1) += ffv1
188VCODEC_TESTS-$(call ENCDEC,FLASHSV) += flashsv
189VCODEC_TESTS-$(call ENCDEC,FLV) += flv
190VCODEC_TESTS-$(call ENCDEC,H261) += h261
191VCODEC_TESTS-$(call ENCDEC,H263) += h263 h263p
192VCODEC_TESTS-$(call ENCDEC,HUFFYUV) += huffyuv
193VCODEC_TESTS-$(call ENCDEC,JPEGLS) += jpegls
194VCODEC_TESTS-$(call ENCDEC,MJPEG) += mjpeg ljpeg
195VCODEC_TESTS-$(call ENCDEC,MPEG1VIDEO) += mpeg mpeg1b
196VCODEC_TESTS-$(call ENCDEC,MPEG2VIDEO) += mpeg2 mpeg2thread
197VCODEC_TESTS-$(call ENCDEC,MPEG4) += mpeg4 mpeg4adv mpeg4nr mpeg4thread error rc
198VCODEC_TESTS-$(call ENCDEC,MSMPEG4V1) += msmpeg4
199VCODEC_TESTS-$(call ENCDEC,MSMPEG4V2) += msmpeg4v2
59b847d3 200VCODEC_TESTS-$(call ENCDEC,RAWVIDEO) += rgb yuv
c676895f
MR
201VCODEC_TESTS-$(call ENCDEC,ROQ) += roq
202VCODEC_TESTS-$(call ENCDEC,RV10) += rv10
203VCODEC_TESTS-$(call ENCDEC,RV20) += rv20
204VCODEC_TESTS-$(call ENCDEC,SNOW) += snow snowll
205VCODEC_TESTS-$(call ENCDEC,SVQ1) += svq1
206VCODEC_TESTS-$(call ENCDEC,WMV1) += wmv1
207VCODEC_TESTS-$(call ENCDEC,WMV2) += wmv2
208
209ACODEC_TESTS =
210ACODEC_TESTS-$(call ENCDEC,AC3) += ac3
211ACODEC_TESTS-$(call ENCDEC,ADPCM_G726) += g726
212ACODEC_TESTS-$(call ENCDEC,ADPCM_IMA_QT) += adpcm_ima_qt
213ACODEC_TESTS-$(call ENCDEC,ADPCM_IMA_WAV) += adpcm_ima_wav
214ACODEC_TESTS-$(call ENCDEC,ADPCM_MS) += adpcm_ms
215ACODEC_TESTS-$(call ENCDEC,ADPCM_SWF) += adpcm_swf
216ACODEC_TESTS-$(call ENCDEC,ADPCM_YAMAHA) += adpcm_yam
217ACODEC_TESTS-$(call ENCDEC,ALAC) += alac
218ACODEC_TESTS-$(call ENCDEC,FLAC) += flac
219ACODEC_TESTS-$(call ENCDEC,MP2) += mp2
220ACODEC_TESTS-$(call ENCDEC,PCM_S16LE) += pcm # fixme
221ACODEC_TESTS-$(call ENCDEC,WMAV1) += wmav1
222ACODEC_TESTS-$(call ENCDEC,WMAV1) += wmav2
05e24fa8
MR
223
224LAVF_TESTS =
225LAVF_TESTS-$(call MUXDEM,AIFF) += aiff
226LAVF_TESTS-$(call MUXDEM,PCM_ALAW) += alaw
227LAVF_TESTS-$(call MUXDEM,ASF) += asf
228LAVF_TESTS-$(call MUXDEM,AU) += au
229LAVF_TESTS-$(call MUXDEM,AVI) += avi
230LAVF_TESTS-$(call ENCDEC,BMP) += bmp
231LAVF_TESTS-$(call MUXDEM,DV) += dv_fmt
232LAVF_TESTS-$(call MUXDEM,FFM) += ffm
233LAVF_TESTS-$(call MUXDEM,FLV) += flv_fmt
234LAVF_TESTS-$(call ENCDEC,GIF) += gif
235LAVF_TESTS-$(call MUXDEM,GXF) += gxf
236LAVF_TESTS-$(call ENCDEC,MJPEG) += jpg
237LAVF_TESTS-$(call MUXDEM,MATROSKA) += mkv
238LAVF_TESTS-$(call MUXDEM,MMF) += mmf
239LAVF_TESTS-$(call MUXDEM,MOV) += mov
240LAVF_TESTS-$(call MUXDEM,MPEG1SYSTEM,MPEGPS) += mpg
241LAVF_TESTS-$(call MUXDEM,PCM_MULAW) += mulaw
242LAVF_TESTS-$(call MUXDEM,MXF) += mxf
243LAVF_TESTS-$(call MUXDEM,NUT) += nut
244LAVF_TESTS-$(call MUXDEM,OGG) += ogg
245LAVF_TESTS-$(call ENCDEC,PBM) += pbmpipe
246LAVF_TESTS-$(call ENCDEC,PCX) += pcx
247LAVF_TESTS-$(call ENCDEC,PGM) += pgm pgmpipe
248LAVF_TESTS-$(call MUXDEM,RAWVIDEO) += pixfmt
249LAVF_TESTS-$(call ENCDEC,PPM) += ppm ppmpipe
250LAVF_TESTS-$(call MUXDEM,RM) += rm
251LAVF_TESTS-$(call ENCDEC,SGI) += sgi
252LAVF_TESTS-$(call MUXDEM,SWF) += swf
253LAVF_TESTS-$(call ENCDEC,TARGA) += tga
254LAVF_TESTS-$(call ENCDEC,TIFF) += tiff
255LAVF_TESTS-$(call MUXDEM,MPEGTS) += ts
256LAVF_TESTS-$(call MUXDEM,VOC) += voc
257LAVF_TESTS-$(call MUXDEM,WAV) += wav
258LAVF_TESTS-$(call MUXDEM,YUV4MPEGPIPE) += yuv4mpeg
259
cec96e8d
SS
260LAVFI_TESTS = \
261 crop \
262 crop_scale \
263 crop_scale_vflip \
264 crop_vflip \
265 null \
266 scale200 \
267 scale500 \
268 vflip \
269 vflip_crop \
270 vflip_vflip \
ce2e4ae3 271 lavfi_pixdesc \
e34d5db5 272# lavfi_pix_fmts \
05e24fa8 273
c676895f
MR
274ACODEC_TESTS := $(addprefix regtest-, $(ACODEC_TESTS) $(ACODEC_TESTS-yes))
275VCODEC_TESTS := $(addprefix regtest-, $(VCODEC_TESTS) $(VCODEC_TESTS-yes))
05e24fa8
MR
276LAVF_TESTS := $(addprefix regtest-, $(LAVF_TESTS) $(LAVF_TESTS-yes))
277LAVFI_TESTS := $(addprefix regtest-, $(LAVFI_TESTS) $(LAVFI_TESTS-yes))
20a93972 278
c676895f
MR
279CODEC_TESTS = $(VCODEC_TESTS) $(ACODEC_TESTS)
280
eca478c3
MR
281codectest: $(CODEC_TESTS)
282lavftest: $(LAVF_TESTS)
cec96e8d 283lavfitest: $(LAVFI_TESTS)
40e02409 284
c676895f
MR
285$(ACODEC_TESTS): regtest-aref
286$(VCODEC_TESTS): regtest-vref
287$(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
bde51e6a 288
eca478c3
MR
289REFFILE = $(SRC_PATH)/tests/ref/$(1)/$(2:regtest-%=%)
290RESFILE = tests/data/$(2:regtest-%=%).$(1).regression
bde51e6a 291
eca478c3 292define CODECTEST_CMD
801b571e
MR
293 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth1 tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
294 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth2 tests/vsynth2 "$(TARGET_EXEC)" "$(TARGET_PATH)"
eca478c3 295endef
bde51e6a 296
c676895f
MR
297regtest-ref: regtest-aref regtest-vref
298
299regtest-vref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
eca478c3 300 $(CODECTEST_CMD)
bde51e6a 301
c676895f 302regtest-aref: ffmpeg$(EXESUF) tests/data/asynth1.sw
801b571e 303 @$(SRC_PATH)/tests/codec-regression.sh $@ acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
c676895f
MR
304
305$(VCODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
306 @echo "TEST VCODEC $(@:regtest-%=%)"
eca478c3
MR
307 @$(CODECTEST_CMD)
308 @diff -u -w $(call REFFILE,vsynth1,$@) $(call RESFILE,vsynth1,$@)
309 @diff -u -w $(call REFFILE,vsynth2,$@) $(call RESFILE,vsynth2,$@)
bde51e6a 310
c676895f
MR
311$(ACODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
312 @echo "TEST ACODEC $(@:regtest-%=%)"
801b571e 313 @$(SRC_PATH)/tests/codec-regression.sh $@ acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
c676895f
MR
314 @diff -u -w $(call REFFILE,acodec,$@) $(call RESFILE,acodec,$@)
315
bde51e6a 316$(LAVF_TESTS):
eca478c3 317 @echo "TEST LAVF $(@:regtest-%=%)"
801b571e 318 @$(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
eca478c3 319 @diff -u -w $(call REFFILE,lavf,$@) $(call RESFILE,lavf,$@)
bde51e6a 320
e34d5db5 321$(LAVFI_TESTS): tools/lavfi-showfiltfmts$(EXESUF)
eca478c3 322 @echo "TEST LAVFI $(@:regtest-%=%)"
801b571e 323 @$(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
eca478c3 324 @diff -u -w $(call REFFILE,lavfi,$@) $(call RESFILE,lavfi,$@)
40e02409 325
1cde611d 326seektest: codectest lavftest tests/seek_test$(EXESUF)
d7096d6f 327 $(SRC_PATH)/tests/seek-regression.sh $(SRC_PATH) "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 328
d7167f05 329ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
bde51e6a
JR
330 @echo
331 @echo "Unfortunately ffserver is broken and therefore its regression"
332 @echo "test fails randomly. Treat the results accordingly."
333 @echo
767e14c3 334 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
bde51e6a 335
82bb3329 336tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
bde51e6a
JR
337 mkdir -p tests/vsynth1
338 $(BUILD_ROOT)/$< 'tests/vsynth1/'
339
82bb3329 340tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
bde51e6a
JR
341 mkdir -p tests/vsynth2
342 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
343
d7167f05
DB
344tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
345 mkdir -p tests/data
bde51e6a
JR
346 $(BUILD_ROOT)/$< $@
347
684b28e0
MR
348tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
349 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
bde51e6a 350
2fad0977 351include $(SRC_PATH_BARE)/tests/fate.mak
666d7d18
MR
352
353ifdef SAMPLES
2fad0977 354fate: $(FATE_TESTS)
1840b280 355$(FATE_TESTS): ffmpeg$(EXESUF)
2fad0977
MR
356 @echo "TEST FATE $(@:fate-%=%)"
357 @$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)'
358else
666d7d18 359fate $(FATE_TESTS):
2fad0977
MR
360 @echo "SAMPLES not specified, cannot run FATE"
361endif
bde51e6a 362
0c3b2d65 363.PHONY: documentation *test regtest-* zlib-error alltools check config