ARM: add some PLD in NEON IDCT
[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)))
15
16BASENAMES = ffmpeg ffplay ffserver
17ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
18ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
19ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
20
21FFLIBS-$(CONFIG_AVFILTER) += avfilter
22FFLIBS-$(CONFIG_POSTPROC) += postproc
bde51e6a 23
6d4f53cb 24FFLIBS := avdevice avformat avcodec avutil swscale
bde51e6a 25
a1a84f69
RS
26DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
27
bde51e6a
JR
28include common.mak
29
30FF_LDFLAGS := $(FFLDFLAGS)
31FF_EXTRALIBS := $(FFEXTRALIBS)
32FF_DEP_LIBS := $(DEP_LIBS)
33
bde51e6a
JR
34ALL_TARGETS-$(BUILD_DOC) += documentation
35
bde51e6a 36ifneq ($(PROGS),)
a1a84f69 37INSTALL_TARGETS-yes += install-progs install-data
bde51e6a
JR
38INSTALL_TARGETS-$(BUILD_DOC) += install-man
39endif
40INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
41
42all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
43
44$(PROGS): %$(EXESUF): %_g$(EXESUF)
45 cp -p $< $@
46 $(STRIP) $@
47
1bbeb233 48SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES \
cc013a74 49 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS
bde51e6a
JR
50
51define RESET
52$(1) :=
53$(1)-yes :=
54endef
55
56define DOSUBDIR
57$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
58SUBDIR := $(1)/
59include $(1)/Makefile
60endef
61
62$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
63
64ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
65ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
66
67%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
68 $(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
69
bde51e6a
JR
70tools/%$(EXESUF): tools/%.c
71 $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
72
73ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
74
36798f1b
MR
75cmdutils.o cmdutils.d: version.h
76
9bce82fa
DB
77alltools: $(addsuffix $(EXESUF),$(addprefix tools/, cws2fws pktdumper qt-faststart trasher))
78
bde51e6a 79documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
fdf11906 80 ffplay-doc.html general.html $(ALLMANPAGES))
bde51e6a
JR
81
82doc/%.html: doc/%.texi
83 texi2html -monolithic -number $<
84 mv $(@F) $@
85
86doc/%.pod: doc/%-doc.texi
87 doc/texi2pod.pl $< $@
88
89doc/%.1: doc/%.pod
90 pod2man --section=1 --center=" " --release=" " $< > $@
91
92install: $(INSTALL_TARGETS-yes)
93
94install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
95 install -d "$(BINDIR)"
96 install -c -m 755 $(PROGS) "$(BINDIR)"
97
a1a84f69
RS
98install-data: $(DATA_FILES)
99 install -d "$(DATADIR)"
100 install -m 644 $(DATA_FILES) "$(DATADIR)"
101
bde51e6a
JR
102install-man: $(MANPAGES)
103 install -d "$(MANDIR)/man1"
104 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
105
fdf11906 106uninstall: uninstall-progs uninstall-data uninstall-man
bde51e6a
JR
107
108uninstall-progs:
109 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
110
a1a84f69
RS
111uninstall-data:
112 rm -rf "$(DATADIR)"
113
bde51e6a
JR
114uninstall-man:
115 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
116
250dd6f0 117testclean:
d7167f05 118 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/*~
250dd6f0
FC
119
120clean:: testclean
219a7185 121 rm -f $(ALLPROGS) $(ALLPROGS_G)
bde51e6a 122 rm -f doc/*.html doc/*.pod doc/*.1
82bb3329
MR
123 rm -f tests/seek_test$(EXESUF)
124 rm -f $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
bde51e6a 125 rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
bde51e6a
JR
126
127distclean::
fdf11906 128 rm -f version.h config.*
bde51e6a
JR
129
130# regression tests
131
5bab8536
DB
132check: test checkheaders
133
1cde611d 134fulltest test: codectest lavftest seektest
bde51e6a
JR
135
136FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
137FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
f1f66d3a 138LAVF_REFFILE = $(SRC_PATH)/tests/lavf.regression.ref
bde51e6a
JR
139ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
140SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
141
142CODEC_TESTS = $(addprefix regtest-, \
143 mpeg \
144 mpeg2 \
145 mpeg2thread \
146 msmpeg4v2 \
147 msmpeg4 \
148 wmv1 \
149 wmv2 \
150 h261 \
151 h263 \
152 h263p \
153 mpeg4 \
154 huffyuv \
155 rc \
156 mpeg4adv \
157 mpeg4thread \
158 error \
159 mpeg4nr \
160 mpeg1b \
161 mjpeg \
162 ljpeg \
163 jpegls \
164 rv10 \
165 rv20 \
166 asv1 \
167 asv2 \
168 flv \
169 ffv1 \
170 snow \
171 snowll \
172 dv \
173 dv50 \
174 svq1 \
175 flashsv \
176 mp2 \
177 ac3 \
178 g726 \
179 adpcm_ima_wav \
180 adpcm_ima_qt \
181 adpcm_ms \
182 adpcm_yam \
183 adpcm_swf \
184 flac \
185 wma \
186 pcm \
187 )
188
189LAVF_TESTS = $(addprefix regtest-, \
190 avi \
191 asf \
192 rm \
193 mpg \
b686d0ab 194 mxf \
bde51e6a
JR
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 \
effcedf7 225 pcx \
bde51e6a
JR
226 )
227
228REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
229
230CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
231CODEC_VSYNTH = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
232
233LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
234
235LAVF_REG = tests/data/lavf.regression
236ROTOZOOM_REG = tests/data/rotozoom.regression
237VSYNTH_REG = tests/data/vsynth.regression
238
20a93972
DB
239ifneq ($(CONFIG_ZLIB),yes)
240regtest-flashsv codectest: zlib-error
241endif
242zlib-error:
243 @echo
244 @echo "This regression test requires zlib."
245 @echo
246 @exit 1
247
bde51e6a
JR
248codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
249 diff -u -w $(FFMPEG_REFFILE) $(VSYNTH_REG)
250 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
251
1cde611d
DB
252lavftest: $(LAVF_REG)
253 diff -u -w $(LAVF_REFFILE) $(LAVF_REG)
bde51e6a
JR
254
255$(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
256 cat $^ > $@
257
258$(LAVF_REG): $(LAVF_REGFILES)
259$(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
260$(VSYNTH_REG): $(CODEC_VSYNTH)
261
262$(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
263
264$(LAVF_REGFILES): $(LAVF_TESTS)
265
266$(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
267
d7167f05 268regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/data/asynth1.sw
bde51e6a 269
82bb3329 270$(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(HOSTEXESUF)
6117ffbe
DB
271 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
272 $(SRC_PATH)/tests/codec-regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a
JR
273
274$(LAVF_TESTS):
6117ffbe 275 $(SRC_PATH)/tests/codec-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 276
1cde611d 277seektest: codectest lavftest tests/seek_test$(EXESUF)
62cb577e 278 $(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 279
d7167f05 280ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
bde51e6a
JR
281 @echo
282 @echo "Unfortunately ffserver is broken and therefore its regression"
283 @echo "test fails randomly. Treat the results accordingly."
284 @echo
767e14c3 285 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
bde51e6a 286
82bb3329 287tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
bde51e6a
JR
288 mkdir -p tests/vsynth1
289 $(BUILD_ROOT)/$< 'tests/vsynth1/'
290
82bb3329 291tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
bde51e6a
JR
292 mkdir -p tests/vsynth2
293 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
294
d7167f05
DB
295tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
296 mkdir -p tests/data
bde51e6a
JR
297 $(BUILD_ROOT)/$< $@
298
82bb3329 299tests/%$(HOSTEXESUF): tests/%.c
dbad2c29 300 $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
bde51e6a
JR
301
302tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
303 $(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
304
305
38eb4b11 306.PHONY: documentation *test regtest-* zlib-error alltools check