Statistics
| Branch: | Revision:

ffmpeg / Makefile @ e8723e24

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