ac3enc: NEON optimised float_to_fixed24
[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
583fcb52
MR
12PROGS := $(PROGS-yes:%=%$(EXESUF))
13PROGS_G = $(PROGS-yes:%=%_g$(EXESUF))
14OBJS = $(PROGS-yes:%=%.o) cmdutils.o
15MANPAGES = $(PROGS-yes:%=doc/%.1)
16PODPAGES = $(PROGS-yes:%=doc/%.pod)
17HTMLPAGES = $(PROGS-yes:%=doc/%.html)
cd6a5a57 18TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws graph2dot lavfi-showfiltfmts pktdumper probetest qt-faststart trasher))
3d157bf3
MR
19TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
20HOSTPROGS := $(TESTTOOLS:%=tests/%)
bde51e6a 21
336ce917 22BASENAMES = ffmpeg ffplay ffprobe ffserver
583fcb52 23ALLPROGS = $(BASENAMES:%=%$(EXESUF))
3adbe49f 24ALLPROGS_G = $(BASENAMES:%=%_g$(EXESUF))
583fcb52 25ALLMANPAGES = $(BASENAMES:%=%.1)
bde51e6a 26
5a0f7131 27FFLIBS-$(CONFIG_AVDEVICE) += avdevice
bde51e6a 28FFLIBS-$(CONFIG_AVFILTER) += avfilter
5a0f7131 29FFLIBS-$(CONFIG_AVFORMAT) += avformat
97d5fa38 30FFLIBS-$(CONFIG_AVCODEC) += avcodec
bde51e6a 31FFLIBS-$(CONFIG_POSTPROC) += postproc
5a0f7131 32FFLIBS-$(CONFIG_SWSCALE) += swscale
bde51e6a 33
5a0f7131 34FFLIBS := avutil
bde51e6a 35
a1a84f69
RS
36DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
37
9b55e2e7
MR
38SKIPHEADERS = cmdutils_common_opts.h
39
bde51e6a
JR
40include common.mak
41
42FF_LDFLAGS := $(FFLDFLAGS)
43FF_EXTRALIBS := $(FFEXTRALIBS)
44FF_DEP_LIBS := $(DEP_LIBS)
45
c73f65d9 46ALL_TARGETS-$(CONFIG_DOC) += documentation
bde51e6a 47
a48289c7 48ifdef PROGS
a1a84f69 49INSTALL_TARGETS-yes += install-progs install-data
c73f65d9 50INSTALL_TARGETS-$(CONFIG_DOC) += install-man
bde51e6a 51endif
bea81a52 52INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
bde51e6a
JR
53
54all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
55
56$(PROGS): %$(EXESUF): %_g$(EXESUF)
4335125c 57 $(CP) $< $@
bde51e6a
JR
58 $(STRIP) $@
59
86601915
MR
60config.h: .config
61.config: $(wildcard $(FFLIBS:%=$(SRC_DIR)/lib%/all*.c))
9d0b3042
MR
62 @-tput bold 2>/dev/null
63 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
64 @-tput sgr0 2>/dev/null
86601915 65
95f2c769 66SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
de4070b5 67 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
a7878c9f 68 HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS
bde51e6a
JR
69
70define RESET
71$(1) :=
72$(1)-yes :=
73endef
74
75define DOSUBDIR
76$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
77SUBDIR := $(1)/
78include $(1)/Makefile
79endef
80
81$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
82
83ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
84ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
85
86%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
684b28e0 87 $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 88
2dfa3054
MR
89tools/%$(EXESUF): tools/%.o
90 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
91
2205da0d 92tools/%.o: tools/%.c
4d1156cb 93 $(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
08df7f86
MR
94
95-include $(wildcard tools/*.d)
bde51e6a 96
3123823c 97ffplay.o: CFLAGS += $(SDL_CFLAGS)
bde51e6a 98
6a53fffd 99VERSION_SH = $(SRC_PATH_BARE)/version.sh
f82bf850 100GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD
6a53fffd 101
faa6f1c3 102.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
6a53fffd
MR
103.version: M=@
104
105version.h .version:
0853a2b4 106 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
6a53fffd
MR
107 $(Q)touch .version
108
109# force version.sh to run whenever version might have changed
110-include .version
36798f1b 111
13b1c80b 112alltools: $(TOOLS)
9bce82fa 113
7f939f55 114DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
dd46b538 115
a0f9c8ce 116documentation: $(DOCS)
bde51e6a 117
a0f9c8ce
MR
118-include $(wildcard $(DOCS:%=%.d))
119
120TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
3275ac6a 121
7732f641 122doc/%.html: TAG = HTML
a8f0814a 123doc/%.html: doc/%.texi $(SRC_PATH_BARE)/doc/t2h.init
a0f9c8ce 124 $(Q)$(TEXIDEP)
a8f0814a 125 $(M)cd doc && texi2html -monolithic --init-file $(SRC_PATH_BARE)/doc/t2h.init $(<:doc/%=%)
bde51e6a 126
7732f641 127doc/%.pod: TAG = POD
82ccbe6b 128doc/%.pod: doc/%.texi
a0f9c8ce 129 $(Q)$(TEXIDEP)
86be2bc3 130 $(M)doc/texi2pod.pl $< $@
bde51e6a 131
7732f641 132doc/%.1: TAG = MAN
bde51e6a 133doc/%.1: doc/%.pod
86be2bc3 134 $(M)pod2man --section=1 --center=" " --release=" " $< > $@
bde51e6a
JR
135
136install: $(INSTALL_TARGETS-yes)
137
138install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
63611f31 139 $(Q)mkdir -p "$(BINDIR)"
fd676deb 140 $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
bde51e6a 141
a1a84f69 142install-data: $(DATA_FILES)
63611f31 143 $(Q)mkdir -p "$(DATADIR)"
fd676deb 144 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
a1a84f69 145
bde51e6a 146install-man: $(MANPAGES)
63611f31 147 $(Q)mkdir -p "$(MANDIR)/man1"
fd676deb 148 $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
bde51e6a 149
d3cb93b3
RP
150uninstall: uninstall-progs uninstall-data uninstall-man
151
152uninstall-progs:
50e10cbd 153 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
d3cb93b3
RP
154
155uninstall-data:
50e10cbd 156 $(RM) -r "$(DATADIR)"
d3cb93b3
RP
157
158uninstall-man:
50e10cbd 159 $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
bde51e6a 160
250dd6f0 161testclean:
50e10cbd
MR
162 $(RM) -r tests/vsynth1 tests/vsynth2 tests/data
163 $(RM) $(addprefix tests/,$(CLEANSUFFIXES))
164 $(RM) tests/seek_test$(EXESUF) tests/seek_test.o
3d157bf3 165 $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
250dd6f0
FC
166
167clean:: testclean
50e10cbd
MR
168 $(RM) $(ALLPROGS) $(ALLPROGS_G)
169 $(RM) $(CLEANSUFFIXES)
170 $(RM) doc/*.html doc/*.pod doc/*.1
171 $(RM) $(TOOLS)
40321376 172 $(RM) $(CLEANSUFFIXES:%=tools/%)
bde51e6a
JR
173
174distclean::
50e10cbd
MR
175 $(RM) $(DISTCLEANSUFFIXES)
176 $(RM) version.h config.* libavutil/avconfig.h
bde51e6a 177
9d0b3042 178config:
29ba0911 179 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
0c3b2d65 180
bde51e6a
JR
181# regression tests
182
5bab8536
DB
183check: test checkheaders
184
b3dce4b9 185fulltest test: codectest lavftest lavfitest seektest
bde51e6a 186
bde51e6a 187FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
bde51e6a
JR
188SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
189
57f09630
MR
190codectest: fate-codec
191lavftest: fate-lavf
192lavfitest: fate-lavfi
193seektest: fate-seek
40e02409 194
9770a7ad
MR
195AREF = tests/data/acodec.ref.wav
196VREF = tests/data/vsynth1.ref.yuv
197REFS = $(AREF) $(VREF)
198
57f09630 199$(REFS): TAG = GEN
bde51e6a 200
9be24c60 201$(VREF): ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
57f09630
MR
202 $(M)$(SRC_PATH)/tests/codec-regression.sh vref vsynth1 tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
203 $(Q)$(SRC_PATH)/tests/codec-regression.sh vref vsynth2 tests/vsynth2 "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 204
9be24c60 205$(AREF): ffmpeg$(EXESUF) tests/data/asynth1.sw
57f09630 206 $(M)$(SRC_PATH)/tests/codec-regression.sh aref acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 207
d7167f05 208ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
bde51e6a
JR
209 @echo
210 @echo "Unfortunately ffserver is broken and therefore its regression"
211 @echo "test fails randomly. Treat the results accordingly."
212 @echo
767e14c3 213 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
bde51e6a 214
82bb3329 215tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
4ab20de6
MR
216 @mkdir -p tests/vsynth1
217 $(M)$(BUILD_ROOT)/$< 'tests/vsynth1/'
bde51e6a 218
82bb3329 219tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
4ab20de6
MR
220 @mkdir -p tests/vsynth2
221 $(M)$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
bde51e6a 222
d7167f05 223tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
4ab20de6
MR
224 @mkdir -p tests/data
225 $(M)$(BUILD_ROOT)/$< $@
226
227tests/data/asynth1.sw tests/vsynth%/00.pgm: TAG = GEN
bde51e6a 228
684b28e0
MR
229tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
230 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
bde51e6a 231
43d2c6a5
SS
232tools/lavfi-showfiltfmts$(EXESUF): tools/lavfi-showfiltfmts.o $(FF_DEP_LIBS)
233 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
234
2fad0977 235include $(SRC_PATH_BARE)/tests/fate.mak
7e264ca1
MR
236include $(SRC_PATH_BARE)/tests/fate2.mak
237
4c3fbd4f
MR
238include $(SRC_PATH_BARE)/tests/fate/aac.mak
239include $(SRC_PATH_BARE)/tests/fate/als.mak
240include $(SRC_PATH_BARE)/tests/fate/fft.mak
241include $(SRC_PATH_BARE)/tests/fate/h264.mak
680aefa2 242include $(SRC_PATH_BARE)/tests/fate/mp3.mak
4c3fbd4f
MR
243include $(SRC_PATH_BARE)/tests/fate/vorbis.mak
244include $(SRC_PATH_BARE)/tests/fate/vp8.mak
245
57f09630
MR
246FATE_ACODEC = $(ACODEC_TESTS:%=fate-acodec-%)
247FATE_VSYNTH1 = $(VCODEC_TESTS:%=fate-vsynth1-%)
248FATE_VSYNTH2 = $(VCODEC_TESTS:%=fate-vsynth2-%)
9a3f31ef 249FATE_VCODEC = $(FATE_VSYNTH1) $(FATE_VSYNTH2)
57f09630
MR
250FATE_LAVF = $(LAVF_TESTS:%=fate-lavf-%)
251FATE_LAVFI = $(LAVFI_TESTS:%=fate-lavfi-%)
9a3f31ef
MR
252FATE_SEEK = $(SEEK_TESTS:seek_%=fate-seek-%)
253
254FATE = $(FATE_ACODEC) \
255 $(FATE_VCODEC) \
256 $(FATE_LAVF) \
257 $(FATE_LAVFI) \
258 $(FATE_SEEK) \
259
260$(FATE_ACODEC): $(AREF)
261$(FATE_VCODEC): $(VREF)
262$(FATE_LAVF): $(REFS)
43d2c6a5 263$(FATE_LAVFI): $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
9a3f31ef
MR
264$(FATE_SEEK): fate-codec fate-lavf tests/seek_test$(EXESUF)
265
266$(FATE_ACODEC): CMD = codectest acodec
267$(FATE_VSYNTH1): CMD = codectest vsynth1
268$(FATE_VSYNTH2): CMD = codectest vsynth2
269$(FATE_LAVF): CMD = lavftest
270$(FATE_LAVFI): CMD = lavfitest
271$(FATE_SEEK): CMD = seektest
272
273fate-codec: fate-acodec fate-vcodec
274fate-acodec: $(FATE_ACODEC)
275fate-vcodec: $(FATE_VCODEC)
276fate-lavf: $(FATE_LAVF)
277fate-lavfi: $(FATE_LAVFI)
278fate-seek: $(FATE_SEEK)
279
666d7d18 280ifdef SAMPLES
9a3f31ef 281FATE += $(FATE_TESTS)
2fad0977 282else
715e9be2 283$(FATE_TESTS):
2fad0977
MR
284 @echo "SAMPLES not specified, cannot run FATE"
285endif
bde51e6a 286
b82be636
MR
287FATE_UTILS = base64 tiny_psnr
288
9a3f31ef 289fate: $(FATE)
9a3f31ef 290
b82be636 291$(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
f6ae77d4 292 @echo "TEST $(@:fate-%=%)"
7851eb68 293 $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)'
9a3f31ef 294
d29d9ccc
MR
295fate-list:
296 @printf '%s\n' $(sort $(FATE))
297
34ae2d90 298.PHONY: documentation *test regtest-* alltools check config