3 SRC_DIR
= $(SRC_PATH_BARE
)
5 vpath
%.texi
$(SRC_PATH_BARE
)
7 PROGS-
$(CONFIG_FFMPEG
) += ffmpeg
8 PROGS-
$(CONFIG_FFPLAY
) += ffplay
9 PROGS-
$(CONFIG_FFSERVER
) += ffserver
11 PROGS
= $(addsuffix $(EXESUF
), $(PROGS-yes
))
12 PROGS_G
= $(addsuffix _g
$(EXESUF
), $(PROGS-yes
))
13 OBJS
= $(addsuffix .o
, $(PROGS-yes
)) cmdutils.o
14 MANPAGES
= $(addprefix doc
/, $(addsuffix .1, $(PROGS-yes
)))
15 TOOLS
= $(addprefix tools
/, $(addsuffix $(EXESUF
), cws2fws pktdumper probetest qt-faststart trasher
))
17 BASENAMES
= ffmpeg ffplay ffserver
18 ALLPROGS
= $(addsuffix $(EXESUF
), $(BASENAMES
))
19 ALLPROGS_G
= $(addsuffix _g
$(EXESUF
), $(BASENAMES
))
20 ALLMANPAGES
= $(addsuffix .1, $(BASENAMES
))
22 FFLIBS-
$(CONFIG_AVFILTER
) += avfilter
23 FFLIBS-
$(CONFIG_POSTPROC
) += postproc
25 FFLIBS
:= avdevice avformat avcodec avutil swscale
27 DATA_FILES
:= $(wildcard $(SRC_DIR
)/ffpresets
/*.ffpreset
)
31 FF_LDFLAGS
:= $(FFLDFLAGS
)
32 FF_EXTRALIBS
:= $(FFEXTRALIBS
)
33 FF_DEP_LIBS
:= $(DEP_LIBS
)
35 ALL_TARGETS-
$(BUILD_DOC
) += documentation
38 INSTALL_TARGETS-yes
+= install-progs install-data
39 INSTALL_TARGETS-
$(BUILD_DOC
) += install-man
41 INSTALL_PROGS_TARGETS-
$(CONFIG_SHARED
) = install-libs
43 all: $(FF_DEP_LIBS
) $(PROGS
) $(ALL_TARGETS-yes
)
45 $(PROGS
): %$(EXESUF
): %_g
$(EXESUF
)
49 SUBDIR_VARS
:= OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
50 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS
58 $(foreach V
,$(SUBDIR_VARS
),$(eval
$(call RESET
,$(V
))))
63 $(foreach D
,$(FFLIBS
),$(eval
$(call DOSUBDIR
,lib
$(D
))))
65 ffplay_g
$(EXESUF
): FF_EXTRALIBS
+= $(SDL_LIBS
)
66 ffserver_g
$(EXESUF
): FF_LDFLAGS
+= $(FFSERVERLDFLAGS
)
68 %_g
$(EXESUF
): %.o cmdutils.o
$(FF_DEP_LIBS
)
69 $(LD
) $(FF_LDFLAGS
) -o
$@
$< cmdutils.o
$(FF_EXTRALIBS
)
71 tools
/%$(EXESUF
): tools
/%.o
72 $(LD
) $(FF_LDFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
75 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $(CC_O
) $<
77 ffplay.o ffplay.d
: CFLAGS
+= $(SDL_CFLAGS
)
79 cmdutils.o cmdutils.d
: version.h
83 documentation
: $(addprefix doc
/, developer.html faq.html ffmpeg-doc.html ffserver-doc.html \
84 ffplay-doc.html general.html
$(ALLMANPAGES
))
86 doc
/%.html
: doc
/%.texi
87 texi2html
-monolithic
-number
$<
90 doc
/%.pod
: doc
/%-doc.texi
94 pod2man
--section
=1 --center
=" " --release
=" " $< > $@
96 install: $(INSTALL_TARGETS-yes
)
98 install-progs
: $(PROGS
) $(INSTALL_PROGS_TARGETS-yes
)
99 install -d
"$(BINDIR)"
100 install -c
-m
755 $(PROGS
) "$(BINDIR)"
102 install-data
: $(DATA_FILES
)
103 install -d
"$(DATADIR)"
104 install -m
644 $(DATA_FILES
) "$(DATADIR)"
106 install-man
: $(MANPAGES
)
107 install -d
"$(MANDIR)/man1"
108 install -m
644 $(MANPAGES
) "$(MANDIR)/man1"
110 uninstall: uninstall-progs uninstall-data uninstall-man
113 rm -f
$(addprefix "$(BINDIR)/", $(ALLPROGS
))
119 rm -f
$(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES
))
122 rm -rf tests
/vsynth1 tests
/vsynth2 tests
/data tests
/*~
125 rm -f
$(ALLPROGS
) $(ALLPROGS_G
)
126 rm -f
$(CLEANSUFFIXES
)
127 rm -f doc
/*.html doc
/*.pod doc
/*.1
128 rm -f tests
/seek_test
$(EXESUF
) tests
/seek_test.o
129 rm -f
$(addprefix tests
/,$(addsuffix $(HOSTEXESUF
),audiogen videogen rotozoom tiny_psnr
))
133 rm -f
$(DISTCLEANSUFFIXES
)
134 rm -f version.h config.
*
137 $(SRC_PATH
)/configure
$(value FFMPEG_CONFIGURATION
)
141 check: test checkheaders
143 fulltest
test: codectest lavftest seektest
145 FFSERVER_REFFILE
= $(SRC_PATH
)/tests
/ffserver.regression.ref
146 LAVF_REFFILE
= $(SRC_PATH
)/tests
/lavf.regression.ref
147 LAVFI_REFFILE
= $(SRC_PATH
)/tests
/lavfi.regression.ref
148 ROTOZOOM_REFFILE
= $(SRC_PATH
)/tests
/rotozoom.regression.ref
149 SEEK_REFFILE
= $(SRC_PATH
)/tests
/seek.regression.ref
150 VSYNTH_REFFILE
= $(SRC_PATH
)/tests
/vsynth.regression.ref
152 CODEC_TESTS
= $(addprefix regtest-
, \
202 LAVF_TESTS
= $(addprefix regtest-
, \
241 LAVFI_TESTS
= $(addprefix regtest-
, \
244 RESFILES
= $(addprefix tests
/data
/,$(addsuffix .
$(1),$(2:regtest-
%=%)))
246 ROTOZOOM_RESFILES
= $(call RESFILES
,rotozoom.regression
,$(CODEC_TESTS
))
247 VSYNTH_RESFILES
= $(call RESFILES
,vsynth.regression
,$(CODEC_TESTS
))
249 LAVF_RESFILES
= $(call RESFILES
,lavf.regression
,$(LAVF_TESTS
))
250 LAVFI_RESFILES
= $(call RESFILES
,lavfi.regression
,$(LAVFI_TESTS
))
252 LAVF_RESFILE
= tests
/data
/lavf.regression
253 LAVFI_RESFILE
= tests
/data
/lavfi.regression
254 ROTOZOOM_RESFILE
= tests
/data
/rotozoom.regression
255 VSYNTH_RESFILE
= tests
/data
/vsynth.regression
257 ifneq ($(CONFIG_ZLIB
),yes
)
258 regtest-flashsv codectest
: zlib-error
262 @echo
"This regression test requires zlib."
266 codectest
: $(VSYNTH_RESFILE
) $(ROTOZOOM_RESFILE
)
267 diff
-u
-w
$(VSYNTH_REFFILE
) $(VSYNTH_RESFILE
)
268 diff
-u
-w
$(ROTOZOOM_REFFILE
) $(ROTOZOOM_RESFILE
)
270 lavftest
: $(LAVF_RESFILE
)
271 diff
-u
-w
$(LAVF_REFFILE
) $(LAVF_RESFILE
)
273 # lavfitest: $(LAVFI_RESFILE)
274 # diff -u -w $(LAVFI_REFFILE) $(LAVFI_RESFILE)
276 $(VSYNTH_RESFILE
) $(ROTOZOOM_RESFILE
) $(LAVF_RESFILE
) $(LAVFI_RESFILE
):
279 $(LAVF_RESFILE
): $(LAVF_RESFILES
)
280 $(LAVFI_RESFILE
): $(LAVFI_RESFILES
)
281 $(ROTOZOOM_RESFILE
): $(ROTOZOOM_RESFILES
)
282 $(VSYNTH_RESFILE
): $(VSYNTH_RESFILES
)
284 $(VSYNTH_RESFILES
) $(ROTOZOOM_RESFILES
): $(CODEC_TESTS
)
286 $(LAVF_RESFILES
): $(LAVF_TESTS
)
287 $(LAVFI_RESFILES
): $(LAVFI_TESTS
)
289 $(CODEC_TESTS
) $(LAVF_TESTS
) $(LAVFI_TESTS
): regtest-ref
291 regtest-ref
: ffmpeg
$(EXESUF
) tests
/vsynth1
/00.pgm tests
/vsynth2
/00.pgm tests
/data
/asynth1.sw
293 $(CODEC_TESTS
) regtest-ref
: tests
/tiny_psnr
$(HOSTEXESUF
)
294 $(SRC_PATH
)/tests
/codec-regression.sh
$@ vsynth tests
/vsynth1 a
"$(TARGET_EXEC)" "$(TARGET_PATH)"
295 $(SRC_PATH
)/tests
/codec-regression.sh
$@ rotozoom tests
/vsynth2 a
"$(TARGET_EXEC)" "$(TARGET_PATH)"
298 $(SRC_PATH
)/tests
/codec-regression.sh
$@ lavf tests
/vsynth1 b
"$(TARGET_EXEC)" "$(TARGET_PATH)"
301 $(SRC_PATH
)/tests
/codec-regression.sh
$@ lavfi tests
/vsynth1 b
"$(TARGET_EXEC)" "$(TARGET_PATH)"
303 seektest
: codectest lavftest tests
/seek_test
$(EXESUF
)
304 $(SRC_PATH
)/tests
/seek-regression.sh
$(SEEK_REFFILE
) "$(TARGET_EXEC)" "$(TARGET_PATH)"
306 ffservertest
: ffserver
$(EXESUF
) tests
/vsynth1
/00.pgm tests
/data
/asynth1.sw
308 @echo
"Unfortunately ffserver is broken and therefore its regression"
309 @echo
"test fails randomly. Treat the results accordingly."
311 $(SRC_PATH
)/tests
/ffserver-regression.sh
$(FFSERVER_REFFILE
) $(SRC_PATH
)/tests
/ffserver.conf
313 tests
/vsynth1
/00.pgm
: tests
/videogen
$(HOSTEXESUF
)
314 mkdir
-p tests
/vsynth1
315 $(BUILD_ROOT
)/$< 'tests/vsynth1/'
317 tests
/vsynth2
/00.pgm
: tests
/rotozoom
$(HOSTEXESUF
)
318 mkdir
-p tests
/vsynth2
319 $(BUILD_ROOT
)/$< 'tests/vsynth2/' $(SRC_PATH
)/tests
/lena.pnm
321 tests
/data
/asynth1.sw
: tests
/audiogen
$(HOSTEXESUF
)
325 tests
/%$(HOSTEXESUF
): tests
/%.c
326 $(HOSTCC
) $(HOSTCFLAGS
) $(HOSTLDFLAGS
) -o
$@
$< $(HOSTLIBS
)
328 tests
/seek_test
$(EXESUF
): tests
/seek_test.o
$(FF_DEP_LIBS
)
329 $(LD
) $(FF_LDFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
332 .PHONY
: documentation
*test regtest-
* zlib-error alltools
check config