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-
$(BUILD_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 \
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 $(CC
) $(FF_LDFLAGS
) -o
$@
$< cmdutils.o
$(FF_EXTRALIBS
)
70 tools
/%$(EXESUF
): tools
/%.c
71 $(CC
) $(CFLAGS
) $(FF_LDFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
73 ffplay.o ffplay.d
: CFLAGS
+= $(SDL_CFLAGS
)
75 cmdutils.o cmdutils.d
: version.h
77 alltools
: $(addsuffix $(EXESUF
),$(addprefix tools
/, cws2fws pktdumper qt-faststart trasher
))
79 documentation
: $(addprefix doc
/, ffmpeg-doc.html faq.html ffserver-doc.html \
80 ffplay-doc.html general.html
$(ALLMANPAGES
))
82 doc
/%.html
: doc
/%.texi
83 texi2html
-monolithic
-number
$<
86 doc
/%.pod
: doc
/%-doc.texi
90 pod2man
--section
=1 --center
=" " --release
=" " $< > $@
92 install: $(INSTALL_TARGETS-yes
)
94 install-progs
: $(PROGS
) $(INSTALL_PROGS_TARGETS-yes
)
95 install -d
"$(BINDIR)"
96 install -c
-m
755 $(PROGS
) "$(BINDIR)"
98 install-data
: $(DATA_FILES
)
99 install -d
"$(DATADIR)"
100 install -m
644 $(DATA_FILES
) "$(DATADIR)"
102 install-man
: $(MANPAGES
)
103 install -d
"$(MANDIR)/man1"
104 install -m
644 $(MANPAGES
) "$(MANDIR)/man1"
106 uninstall: uninstall-progs uninstall-data uninstall-man
109 rm -f
$(addprefix "$(BINDIR)/", $(ALLPROGS
))
115 rm -f
$(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES
))
118 rm -rf tests
/vsynth1 tests
/vsynth2 tests
/data tests
/*~
121 rm -f
$(ALLPROGS
) $(ALLPROGS_G
)
122 rm -f
$(CLEANSUFFIXES
)
123 rm -f doc
/*.html doc
/*.pod doc
/*.1
124 rm -f tests
/seek_test
$(EXESUF
)
125 rm -f
$(addprefix tests
/,$(addsuffix $(HOSTEXESUF
),audiogen videogen rotozoom tiny_psnr
))
126 rm -f
$(addprefix tools
/,$(addsuffix $(EXESUF
),cws2fws pktdumper qt-faststart trasher
))
129 rm -f
$(DISTCLEANSUFFIXES
)
130 rm -f version.h config.
*
134 check: test checkheaders
136 fulltest
test: codectest lavftest seektest
138 FFMPEG_REFFILE
= $(SRC_PATH
)/tests
/ffmpeg.regression.ref
139 FFSERVER_REFFILE
= $(SRC_PATH
)/tests
/ffserver.regression.ref
140 LAVF_REFFILE
= $(SRC_PATH
)/tests
/lavf.regression.ref
141 ROTOZOOM_REFFILE
= $(SRC_PATH
)/tests
/rotozoom.regression.ref
142 SEEK_REFFILE
= $(SRC_PATH
)/tests
/seek.regression.ref
144 CODEC_TESTS
= $(addprefix regtest-
, \
191 LAVF_TESTS
= $(addprefix regtest-
, \
230 REGFILES
= $(addprefix tests
/data
/,$(addsuffix .
$(1),$(2:regtest-
%=%)))
232 CODEC_ROTOZOOM
= $(call REGFILES
,rotozoom.regression
,$(CODEC_TESTS
))
233 CODEC_VSYNTH
= $(call REGFILES
,vsynth.regression
,$(CODEC_TESTS
))
235 LAVF_REGFILES
= $(call REGFILES
,lavf.regression
,$(LAVF_TESTS
))
237 LAVF_REG
= tests
/data
/lavf.regression
238 ROTOZOOM_REG
= tests
/data
/rotozoom.regression
239 VSYNTH_REG
= tests
/data
/vsynth.regression
241 ifneq ($(CONFIG_ZLIB
),yes
)
242 regtest-flashsv codectest
: zlib-error
246 @echo
"This regression test requires zlib."
250 codectest
: $(VSYNTH_REG
) $(ROTOZOOM_REG
)
251 diff
-u
-w
$(FFMPEG_REFFILE
) $(VSYNTH_REG
)
252 diff
-u
-w
$(ROTOZOOM_REFFILE
) $(ROTOZOOM_REG
)
254 lavftest
: $(LAVF_REG
)
255 diff
-u
-w
$(LAVF_REFFILE
) $(LAVF_REG
)
257 $(VSYNTH_REG
) $(ROTOZOOM_REG
) $(LAVF_REG
):
260 $(LAVF_REG
): $(LAVF_REGFILES
)
261 $(ROTOZOOM_REG
): $(CODEC_ROTOZOOM
)
262 $(VSYNTH_REG
): $(CODEC_VSYNTH
)
264 $(CODEC_VSYNTH
) $(CODEC_ROTOZOOM
): $(CODEC_TESTS
)
266 $(LAVF_REGFILES
): $(LAVF_TESTS
)
268 $(CODEC_TESTS
) $(LAVF_TESTS
): regtest-ref
270 regtest-ref
: ffmpeg
$(EXESUF
) tests
/vsynth1
/00.pgm tests
/vsynth2
/00.pgm tests
/data
/asynth1.sw
272 $(CODEC_TESTS
) regtest-ref
: tests
/tiny_psnr
$(HOSTEXESUF
)
273 $(SRC_PATH
)/tests
/codec-regression.sh
$@ vsynth tests
/vsynth1 a
"$(TARGET_EXEC)" "$(TARGET_PATH)"
274 $(SRC_PATH
)/tests
/codec-regression.sh
$@ rotozoom tests
/vsynth2 a
"$(TARGET_EXEC)" "$(TARGET_PATH)"
277 $(SRC_PATH
)/tests
/codec-regression.sh
$@ lavf tests
/vsynth1 b
"$(TARGET_EXEC)" "$(TARGET_PATH)"
279 seektest
: codectest lavftest tests
/seek_test
$(EXESUF
)
280 $(SRC_PATH
)/tests
/seek-regression.sh
$(SEEK_REFFILE
) "$(TARGET_EXEC)" "$(TARGET_PATH)"
282 ffservertest
: ffserver
$(EXESUF
) tests
/vsynth1
/00.pgm tests
/data
/asynth1.sw
284 @echo
"Unfortunately ffserver is broken and therefore its regression"
285 @echo
"test fails randomly. Treat the results accordingly."
287 $(SRC_PATH
)/tests
/ffserver-regression.sh
$(FFSERVER_REFFILE
) $(SRC_PATH
)/tests
/ffserver.conf
289 tests
/vsynth1
/00.pgm
: tests
/videogen
$(HOSTEXESUF
)
290 mkdir
-p tests
/vsynth1
291 $(BUILD_ROOT
)/$< 'tests/vsynth1/'
293 tests
/vsynth2
/00.pgm
: tests
/rotozoom
$(HOSTEXESUF
)
294 mkdir
-p tests
/vsynth2
295 $(BUILD_ROOT
)/$< 'tests/vsynth2/' $(SRC_PATH
)/tests
/lena.pnm
297 tests
/data
/asynth1.sw
: tests
/audiogen
$(HOSTEXESUF
)
301 tests
/%$(HOSTEXESUF
): tests
/%.c
302 $(HOSTCC
) $(HOSTCFLAGS
) $(HOSTLDFLAGS
) -o
$@
$< $(HOSTLIBS
)
304 tests
/seek_test
$(EXESUF
): tests
/seek_test.c
$(FF_DEP_LIBS
)
305 $(CC
) $(FF_LDFLAGS
) $(CFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
308 .PHONY
: documentation
*test regtest-
* zlib-error alltools
check