Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 902d49ee

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