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
)))
16 BASENAMES
= ffmpeg ffplay ffserver
17 ALLPROGS
= $(addsuffix $(EXESUF
), $(BASENAMES
))
18 ALLPROGS_G
= $(addsuffix _g
$(EXESUF
), $(BASENAMES
))
19 ALLMANPAGES
= $(addsuffix .1, $(BASENAMES
))
21 FFLIBS-
$(CONFIG_AVFILTER
) += avfilter
22 FFLIBS-
$(CONFIG_POSTPROC
) += postproc
24 FFLIBS
:= avdevice avformat avcodec avutil swscale
26 DATA_FILES
:= $(wildcard $(SRC_DIR
)/ffpresets
/*.ffpreset
)
30 FF_LDFLAGS
:= $(FFLDFLAGS
)
31 FF_EXTRALIBS
:= $(FFEXTRALIBS
)
32 FF_DEP_LIBS
:= $(DEP_LIBS
)
34 ALL_TARGETS-
$(BUILD_DOC
) += documentation
37 INSTALL_TARGETS-yes
+= install-progs install-data
38 INSTALL_TARGETS-
$(BUILD_DOC
) += install-man
40 INSTALL_PROGS_TARGETS-
$(CONFIG_SHARED
) = install-libs
42 all: $(FF_DEP_LIBS
) $(PROGS
) $(ALL_TARGETS-yes
)
44 $(PROGS
): %$(EXESUF
): %_g
$(EXESUF
)
48 SUBDIR_VARS
:= OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
49 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS
57 $(foreach V
,$(SUBDIR_VARS
),$(eval
$(call RESET
,$(V
))))
62 $(foreach D
,$(FFLIBS
),$(eval
$(call DOSUBDIR
,lib
$(D
))))
64 ffplay_g
$(EXESUF
): FF_EXTRALIBS
+= $(SDL_LIBS
)
65 ffserver_g
$(EXESUF
): FF_LDFLAGS
+= $(FFSERVERLDFLAGS
)
67 %_g
$(EXESUF
): %.o cmdutils.o
$(FF_DEP_LIBS
)
68 $(LD
) $(FF_LDFLAGS
) -o
$@
$< cmdutils.o
$(FF_EXTRALIBS
)
70 tools
/%$(EXESUF
): tools
/%.o
71 $(LD
) $(FF_LDFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
74 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $(CC_O
) $<
76 ffplay.o ffplay.d
: CFLAGS
+= $(SDL_CFLAGS
)
78 cmdutils.o cmdutils.d
: version.h
80 alltools
: $(addsuffix $(EXESUF
),$(addprefix tools
/, cws2fws pktdumper qt-faststart trasher
))
82 documentation
: $(addprefix doc
/, developer.html faq.html ffmpeg-doc.html ffserver-doc.html \
83 ffplay-doc.html general.html
$(ALLMANPAGES
))
85 doc
/%.html
: doc
/%.texi
86 texi2html
-monolithic
-number
$<
89 doc
/%.pod
: doc
/%-doc.texi
93 pod2man
--section
=1 --center
=" " --release
=" " $< > $@
95 install: $(INSTALL_TARGETS-yes
)
97 install-progs
: $(PROGS
) $(INSTALL_PROGS_TARGETS-yes
)
98 install -d
"$(BINDIR)"
99 install -c
-m
755 $(PROGS
) "$(BINDIR)"
101 install-data
: $(DATA_FILES
)
102 install -d
"$(DATADIR)"
103 install -m
644 $(DATA_FILES
) "$(DATADIR)"
105 install-man
: $(MANPAGES
)
106 install -d
"$(MANDIR)/man1"
107 install -m
644 $(MANPAGES
) "$(MANDIR)/man1"
109 uninstall: uninstall-progs uninstall-data uninstall-man
112 rm -f
$(addprefix "$(BINDIR)/", $(ALLPROGS
))
118 rm -f
$(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES
))
121 rm -rf tests
/vsynth1 tests
/vsynth2 tests
/data tests
/*~
124 rm -f
$(ALLPROGS
) $(ALLPROGS_G
)
125 rm -f
$(CLEANSUFFIXES
)
126 rm -f doc
/*.html doc
/*.pod doc
/*.1
127 rm -f tests
/seek_test
$(EXESUF
) tests
/seek_test.o
128 rm -f
$(addprefix tests
/,$(addsuffix $(HOSTEXESUF
),audiogen videogen rotozoom tiny_psnr
))
129 rm -f
$(addprefix tools
/,$(addsuffix $(EXESUF
),cws2fws pktdumper qt-faststart trasher
))
132 rm -f
$(DISTCLEANSUFFIXES
)
133 rm -f version.h config.
*
136 $(SRC_PATH
)/configure
$(value FFMPEG_CONFIGURATION
)
140 check: test checkheaders
142 fulltest
test: codectest lavftest seektest
144 FFSERVER_REFFILE
= $(SRC_PATH
)/tests
/ffserver.regression.ref
145 LAVF_REFFILE
= $(SRC_PATH
)/tests
/lavf.regression.ref
146 ROTOZOOM_REFFILE
= $(SRC_PATH
)/tests
/rotozoom.regression.ref
147 SEEK_REFFILE
= $(SRC_PATH
)/tests
/seek.regression.ref
148 VSYNTH_REFFILE
= $(SRC_PATH
)/tests
/vsynth.regression.ref
150 CODEC_TESTS
= $(addprefix regtest-
, \
197 LAVF_TESTS
= $(addprefix regtest-
, \
236 RESFILES
= $(addprefix tests
/data
/,$(addsuffix .
$(1),$(2:regtest-
%=%)))
238 ROTOZOOM_RESFILES
= $(call RESFILES
,rotozoom.regression
,$(CODEC_TESTS
))
239 VSYNTH_RESFILES
= $(call RESFILES
,vsynth.regression
,$(CODEC_TESTS
))
241 LAVF_RESFILES
= $(call RESFILES
,lavf.regression
,$(LAVF_TESTS
))
243 LAVF_RESFILE
= tests
/data
/lavf.regression
244 ROTOZOOM_RESFILE
= tests
/data
/rotozoom.regression
245 VSYNTH_RESFILE
= tests
/data
/vsynth.regression
247 ifneq ($(CONFIG_ZLIB
),yes
)
248 regtest-flashsv codectest
: zlib-error
252 @echo
"This regression test requires zlib."
256 codectest
: $(VSYNTH_RESFILE
) $(ROTOZOOM_RESFILE
)
257 diff
-u
-w
$(VSYNTH_REFFILE
) $(VSYNTH_RESFILE
)
258 diff
-u
-w
$(ROTOZOOM_REFFILE
) $(ROTOZOOM_RESFILE
)
260 lavftest
: $(LAVF_RESFILE
)
261 diff
-u
-w
$(LAVF_REFFILE
) $(LAVF_RESFILE
)
263 $(VSYNTH_RESFILE
) $(ROTOZOOM_RESFILE
) $(LAVF_RESFILE
):
266 $(LAVF_RESFILE
): $(LAVF_RESFILES
)
267 $(ROTOZOOM_RESFILE
): $(ROTOZOOM_RESFILES
)
268 $(VSYNTH_RESFILE
): $(VSYNTH_RESFILES
)
270 $(VSYNTH_RESFILES
) $(ROTOZOOM_RESFILES
): $(CODEC_TESTS
)
272 $(LAVF_RESFILES
): $(LAVF_TESTS
)
274 $(CODEC_TESTS
) $(LAVF_TESTS
): regtest-ref
276 regtest-ref
: ffmpeg
$(EXESUF
) tests
/vsynth1
/00.pgm tests
/vsynth2
/00.pgm tests
/data
/asynth1.sw
278 $(CODEC_TESTS
) regtest-ref
: tests
/tiny_psnr
$(HOSTEXESUF
)
279 $(SRC_PATH
)/tests
/codec-regression.sh
$@ vsynth tests
/vsynth1 a
"$(TARGET_EXEC)" "$(TARGET_PATH)"
280 $(SRC_PATH
)/tests
/codec-regression.sh
$@ rotozoom tests
/vsynth2 a
"$(TARGET_EXEC)" "$(TARGET_PATH)"
283 $(SRC_PATH
)/tests
/codec-regression.sh
$@ lavf tests
/vsynth1 b
"$(TARGET_EXEC)" "$(TARGET_PATH)"
285 seektest
: codectest lavftest tests
/seek_test
$(EXESUF
)
286 $(SRC_PATH
)/tests
/seek-regression.sh
$(SEEK_REFFILE
) "$(TARGET_EXEC)" "$(TARGET_PATH)"
288 ffservertest
: ffserver
$(EXESUF
) tests
/vsynth1
/00.pgm tests
/data
/asynth1.sw
290 @echo
"Unfortunately ffserver is broken and therefore its regression"
291 @echo
"test fails randomly. Treat the results accordingly."
293 $(SRC_PATH
)/tests
/ffserver-regression.sh
$(FFSERVER_REFFILE
) $(SRC_PATH
)/tests
/ffserver.conf
295 tests
/vsynth1
/00.pgm
: tests
/videogen
$(HOSTEXESUF
)
296 mkdir
-p tests
/vsynth1
297 $(BUILD_ROOT
)/$< 'tests/vsynth1/'
299 tests
/vsynth2
/00.pgm
: tests
/rotozoom
$(HOSTEXESUF
)
300 mkdir
-p tests
/vsynth2
301 $(BUILD_ROOT
)/$< 'tests/vsynth2/' $(SRC_PATH
)/tests
/lena.pnm
303 tests
/data
/asynth1.sw
: tests
/audiogen
$(HOSTEXESUF
)
307 tests
/%$(HOSTEXESUF
): tests
/%.c
308 $(HOSTCC
) $(HOSTCFLAGS
) $(HOSTLDFLAGS
) -o
$@
$< $(HOSTLIBS
)
310 tests
/seek_test
$(EXESUF
): tests
/seek_test.o
$(FF_DEP_LIBS
)
311 $(LD
) $(FF_LDFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
314 .PHONY
: documentation
*test regtest-
* zlib-error alltools
check config