Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 850e9c6d

History | View | Annotate | Download (8.57 KB)

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