WMAPRO: use vector_fmul_scalar from dsputil where possible
[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
9PROGS-$(CONFIG_FFSERVER) += ffserver
10
11PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
12PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
13OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
14MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
94f3c0e5 15TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
bde51e6a
JR
16
17BASENAMES = ffmpeg ffplay ffserver
18ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
19ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
20ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
21
22FFLIBS-$(CONFIG_AVFILTER) += avfilter
23FFLIBS-$(CONFIG_POSTPROC) += postproc
bde51e6a 24
6d4f53cb 25FFLIBS := avdevice avformat avcodec avutil swscale
bde51e6a 26
a1a84f69
RS
27DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
28
bde51e6a
JR
29include common.mak
30
31FF_LDFLAGS := $(FFLDFLAGS)
32FF_EXTRALIBS := $(FFEXTRALIBS)
33FF_DEP_LIBS := $(DEP_LIBS)
34
bde51e6a
JR
35ALL_TARGETS-$(BUILD_DOC) += documentation
36
bde51e6a 37ifneq ($(PROGS),)
a1a84f69 38INSTALL_TARGETS-yes += install-progs install-data
bde51e6a
JR
39INSTALL_TARGETS-$(BUILD_DOC) += install-man
40endif
bea81a52 41INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
bde51e6a
JR
42
43all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
44
45$(PROGS): %$(EXESUF): %_g$(EXESUF)
46 cp -p $< $@
47 $(STRIP) $@
48
95f2c769 49SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
cc013a74 50 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS
bde51e6a
JR
51
52define RESET
53$(1) :=
54$(1)-yes :=
55endef
56
57define DOSUBDIR
58$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
59SUBDIR := $(1)/
60include $(1)/Makefile
61endef
62
63$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
64
65ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
66ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
67
68%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
684b28e0 69 $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 70
2dfa3054
MR
71tools/%$(EXESUF): tools/%.o
72 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
73
2205da0d 74tools/%.o: tools/%.c
2dfa3054 75 $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
bde51e6a
JR
76
77ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
78
36798f1b
MR
79cmdutils.o cmdutils.d: version.h
80
13b1c80b 81alltools: $(TOOLS)
9bce82fa 82
a752069d 83documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html ffserver-doc.html \
fdf11906 84 ffplay-doc.html general.html $(ALLMANPAGES))
bde51e6a
JR
85
86doc/%.html: doc/%.texi
87 texi2html -monolithic -number $<
88 mv $(@F) $@
89
90doc/%.pod: doc/%-doc.texi
91 doc/texi2pod.pl $< $@
92
93doc/%.1: doc/%.pod
94 pod2man --section=1 --center=" " --release=" " $< > $@
95
96install: $(INSTALL_TARGETS-yes)
97
98install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
99 install -d "$(BINDIR)"
100 install -c -m 755 $(PROGS) "$(BINDIR)"
101
a1a84f69
RS
102install-data: $(DATA_FILES)
103 install -d "$(DATADIR)"
104 install -m 644 $(DATA_FILES) "$(DATADIR)"
105
bde51e6a
JR
106install-man: $(MANPAGES)
107 install -d "$(MANDIR)/man1"
108 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
109
fdf11906 110uninstall: uninstall-progs uninstall-data uninstall-man
bde51e6a
JR
111
112uninstall-progs:
113 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
114
a1a84f69
RS
115uninstall-data:
116 rm -rf "$(DATADIR)"
117
bde51e6a
JR
118uninstall-man:
119 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
120
250dd6f0 121testclean:
d7167f05 122 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/*~
250dd6f0
FC
123
124clean:: testclean
219a7185 125 rm -f $(ALLPROGS) $(ALLPROGS_G)
2b7a351e 126 rm -f $(CLEANSUFFIXES)
bde51e6a 127 rm -f doc/*.html doc/*.pod doc/*.1
4e67aedd 128 rm -f tests/seek_test$(EXESUF) tests/seek_test.o
82bb3329 129 rm -f $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
13b1c80b 130 rm -f $(TOOLS)
bde51e6a
JR
131
132distclean::
2b7a351e 133 rm -f $(DISTCLEANSUFFIXES)
fdf11906 134 rm -f version.h config.*
bde51e6a 135
0c3b2d65
MR
136config:
137 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
138
bde51e6a
JR
139# regression tests
140
5bab8536
DB
141check: test checkheaders
142
1cde611d 143fulltest test: codectest lavftest seektest
bde51e6a 144
bde51e6a 145FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
f1f66d3a 146LAVF_REFFILE = $(SRC_PATH)/tests/lavf.regression.ref
bde51e6a
JR
147ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
148SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
97668ac7 149VSYNTH_REFFILE = $(SRC_PATH)/tests/vsynth.regression.ref
bde51e6a
JR
150
151CODEC_TESTS = $(addprefix regtest-, \
152 mpeg \
153 mpeg2 \
154 mpeg2thread \
155 msmpeg4v2 \
156 msmpeg4 \
157 wmv1 \
158 wmv2 \
159 h261 \
160 h263 \
161 h263p \
162 mpeg4 \
163 huffyuv \
164 rc \
165 mpeg4adv \
166 mpeg4thread \
167 error \
168 mpeg4nr \
169 mpeg1b \
170 mjpeg \
171 ljpeg \
172 jpegls \
173 rv10 \
174 rv20 \
175 asv1 \
176 asv2 \
177 flv \
178 ffv1 \
179 snow \
180 snowll \
181 dv \
182 dv50 \
96fdb624
MR
183 dnxhd_1080i \
184 dnxhd_720p \
185 dnxhd_720p_rd \
bde51e6a
JR
186 svq1 \
187 flashsv \
188 mp2 \
189 ac3 \
190 g726 \
191 adpcm_ima_wav \
192 adpcm_ima_qt \
193 adpcm_ms \
194 adpcm_yam \
195 adpcm_swf \
196 flac \
197 wma \
198 pcm \
199 )
200
201LAVF_TESTS = $(addprefix regtest-, \
202 avi \
203 asf \
204 rm \
205 mpg \
b686d0ab 206 mxf \
bde51e6a
JR
207 ts \
208 swf \
209 ffm \
210 flv_fmt \
211 mov \
212 dv_fmt \
213 gxf \
214 nut \
215 mkv \
216 pbmpipe \
217 pgmpipe \
218 ppmpipe \
219 gif \
220 yuv4mpeg \
221 pgm \
222 ppm \
223 bmp \
224 tga \
225 tiff \
226 sgi \
227 jpg \
228 wav \
229 alaw \
230 mulaw \
231 au \
232 mmf \
233 aiff \
234 voc \
235 ogg \
236 pixfmt \
effcedf7 237 pcx \
bde51e6a
JR
238 )
239
2795e357 240RESFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
bde51e6a 241
2795e357
SS
242ROTOZOOM_RESFILES = $(call RESFILES,rotozoom.regression,$(CODEC_TESTS))
243VSYNTH_RESFILES = $(call RESFILES,vsynth.regression,$(CODEC_TESTS))
bde51e6a 244
2795e357 245LAVF_RESFILES = $(call RESFILES,lavf.regression,$(LAVF_TESTS))
bde51e6a 246
2795e357
SS
247LAVF_RESFILE = tests/data/lavf.regression
248ROTOZOOM_RESFILE = tests/data/rotozoom.regression
249VSYNTH_RESFILE = tests/data/vsynth.regression
bde51e6a 250
20a93972
DB
251ifneq ($(CONFIG_ZLIB),yes)
252regtest-flashsv codectest: zlib-error
253endif
254zlib-error:
255 @echo
256 @echo "This regression test requires zlib."
257 @echo
258 @exit 1
259
2795e357
SS
260codectest: $(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE)
261 diff -u -w $(VSYNTH_REFFILE) $(VSYNTH_RESFILE)
262 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_RESFILE)
bde51e6a 263
2795e357
SS
264lavftest: $(LAVF_RESFILE)
265 diff -u -w $(LAVF_REFFILE) $(LAVF_RESFILE)
bde51e6a 266
2795e357 267$(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE) $(LAVF_RESFILE):
bde51e6a
JR
268 cat $^ > $@
269
2795e357
SS
270$(LAVF_RESFILE): $(LAVF_RESFILES)
271$(ROTOZOOM_RESFILE): $(ROTOZOOM_RESFILES)
272$(VSYNTH_RESFILE): $(VSYNTH_RESFILES)
bde51e6a 273
2795e357 274$(VSYNTH_RESFILES) $(ROTOZOOM_RESFILES): $(CODEC_TESTS)
bde51e6a 275
2795e357 276$(LAVF_RESFILES): $(LAVF_TESTS)
bde51e6a
JR
277
278$(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
279
d7167f05 280regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/data/asynth1.sw
bde51e6a 281
82bb3329 282$(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(HOSTEXESUF)
6117ffbe
DB
283 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
284 $(SRC_PATH)/tests/codec-regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a
JR
285
286$(LAVF_TESTS):
6117ffbe 287 $(SRC_PATH)/tests/codec-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 288
1cde611d 289seektest: codectest lavftest tests/seek_test$(EXESUF)
62cb577e 290 $(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 291
d7167f05 292ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
bde51e6a
JR
293 @echo
294 @echo "Unfortunately ffserver is broken and therefore its regression"
295 @echo "test fails randomly. Treat the results accordingly."
296 @echo
767e14c3 297 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
bde51e6a 298
82bb3329 299tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
bde51e6a
JR
300 mkdir -p tests/vsynth1
301 $(BUILD_ROOT)/$< 'tests/vsynth1/'
302
82bb3329 303tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
bde51e6a
JR
304 mkdir -p tests/vsynth2
305 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
306
d7167f05
DB
307tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
308 mkdir -p tests/data
bde51e6a
JR
309 $(BUILD_ROOT)/$< $@
310
82bb3329 311tests/%$(HOSTEXESUF): tests/%.c
dbad2c29 312 $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
bde51e6a 313
684b28e0
MR
314tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
315 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
bde51e6a
JR
316
317
0c3b2d65 318.PHONY: documentation *test regtest-* zlib-error alltools check config