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