Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 10ed02eb

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