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
23 FFLIBS-
$(CONFIG_SWSCALE
) += swscale
25 FFLIBS
:= avdevice avformat avcodec avutil
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-
$(BUILD_SHARED
) = install-libs
43 all: $(FF_DEP_LIBS
) $(PROGS
) $(ALL_TARGETS-yes
)
45 $(PROGS
): %$(EXESUF
): %_g
$(EXESUF
)
49 SUBDIR_VARS
:= OBJS FFLIBS CLEANFILES DIRS TESTS
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 output_example
$(EXESUF
): output_example.o
$(FF_DEP_LIBS
)
71 $(CC
) $(CFLAGS
) $(FF_LDFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
73 tools
/%$(EXESUF
): tools
/%.c
74 $(CC
) $(CFLAGS
) $(FF_LDFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
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
/, ffmpeg-doc.html faq.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
/asynth1.sw tests
/*~
124 rm -f
$(ALLPROGS
) $(ALLPROGS_G
) output_example
$(EXESUF
)
125 rm -f doc
/*.html doc
/*.pod doc
/*.1
126 rm -f
$(addprefix tests
/,$(addsuffix $(EXESUF
),audiogen videogen rotozoom seek_test tiny_psnr
))
127 rm -f
$(addprefix tools
/,$(addsuffix $(EXESUF
),cws2fws pktdumper qt-faststart trasher
))
130 rm -f version.h config.
*
134 check: test checkheaders
136 fulltest
test: codectest libavtest seektest
138 FFMPEG_REFFILE
= $(SRC_PATH
)/tests
/ffmpeg.regression.ref
139 FFSERVER_REFFILE
= $(SRC_PATH
)/tests
/ffserver.regression.ref
140 LIBAV_REFFILE
= $(SRC_PATH
)/tests
/libav.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-
, \
228 REGFILES
= $(addprefix tests
/data
/,$(addsuffix .
$(1),$(2:regtest-
%=%)))
230 CODEC_ROTOZOOM
= $(call REGFILES
,rotozoom.regression
,$(CODEC_TESTS
))
231 CODEC_VSYNTH
= $(call REGFILES
,vsynth.regression
,$(CODEC_TESTS
))
233 LAVF_REGFILES
= $(call REGFILES
,lavf.regression
,$(LAVF_TESTS
))
235 LAVF_REG
= tests
/data
/lavf.regression
236 ROTOZOOM_REG
= tests
/data
/rotozoom.regression
237 VSYNTH_REG
= tests
/data
/vsynth.regression
239 ifneq ($(CONFIG_SWSCALE
),yes
)
240 servertest codectest
$(CODEC_TESTS
) libavtest
: swscale-error
243 @echo
"This regression test requires --enable-swscale."
248 ifneq ($(CONFIG_ZLIB
),yes
)
249 regtest-flashsv codectest
: zlib-error
253 @echo
"This regression test requires zlib."
257 codectest
: $(VSYNTH_REG
) $(ROTOZOOM_REG
)
258 diff
-u
-w
$(FFMPEG_REFFILE
) $(VSYNTH_REG
)
259 diff
-u
-w
$(ROTOZOOM_REFFILE
) $(ROTOZOOM_REG
)
261 libavtest
: $(LAVF_REG
)
262 diff
-u
-w
$(LIBAV_REFFILE
) $(LAVF_REG
)
264 $(VSYNTH_REG
) $(ROTOZOOM_REG
) $(LAVF_REG
):
267 $(LAVF_REG
): $(LAVF_REGFILES
)
268 $(ROTOZOOM_REG
): $(CODEC_ROTOZOOM
)
269 $(VSYNTH_REG
): $(CODEC_VSYNTH
)
271 $(CODEC_VSYNTH
) $(CODEC_ROTOZOOM
): $(CODEC_TESTS
)
273 $(LAVF_REGFILES
): $(LAVF_TESTS
)
275 $(CODEC_TESTS
) $(LAVF_TESTS
): regtest-ref
277 regtest-ref
: ffmpeg
$(EXESUF
) tests
/vsynth1
/00.pgm tests
/vsynth2
/00.pgm tests
/asynth1.sw
279 $(CODEC_TESTS
) regtest-ref
: tests
/tiny_psnr
$(EXESUF
)
280 $(SRC_PATH
)/tests
/regression.sh
$@ vsynth tests
/vsynth1 a
"$(TARGET_EXEC)" "$(TARGET_PATH)"
281 $(SRC_PATH
)/tests
/regression.sh
$@ rotozoom tests
/vsynth2 a
"$(TARGET_EXEC)" "$(TARGET_PATH)"
284 $(SRC_PATH
)/tests
/regression.sh
$@ lavf tests
/vsynth1 b
"$(TARGET_EXEC)" "$(TARGET_PATH)"
286 seektest
: codectest libavtest tests
/seek_test
$(EXESUF
)
287 $(SRC_PATH
)/tests
/seek_test.sh
$(SEEK_REFFILE
) "$(TARGET_EXEC)" "$(TARGET_PATH)"
289 servertest
: ffserver
$(EXESUF
) tests
/vsynth1
/00.pgm tests
/asynth1.sw
291 @echo
"Unfortunately ffserver is broken and therefore its regression"
292 @echo
"test fails randomly. Treat the results accordingly."
294 $(SRC_PATH
)/tests
/server-regression.sh
$(FFSERVER_REFFILE
) $(SRC_PATH
)/tests
/test.conf
296 tests
/vsynth1
/00.pgm
: tests
/videogen
$(EXESUF
)
297 mkdir
-p tests
/vsynth1
298 $(BUILD_ROOT
)/$< 'tests/vsynth1/'
300 tests
/vsynth2
/00.pgm
: tests
/rotozoom
$(EXESUF
)
301 mkdir
-p tests
/vsynth2
302 $(BUILD_ROOT
)/$< 'tests/vsynth2/' $(SRC_PATH
)/tests
/lena.pnm
304 tests
/asynth1.sw
: tests
/audiogen
$(EXESUF
)
307 tests
/%$(EXESUF
): tests
/%.c
308 $(HOSTCC
) $(HOSTCFLAGS
) $(HOSTLDFLAGS
) -o
$@
$< $(HOSTLIBS
)
310 tests
/seek_test
$(EXESUF
): tests
/seek_test.c
$(FF_DEP_LIBS
)
311 $(CC
) $(FF_LDFLAGS
) $(CFLAGS
) -o
$@
$< $(FF_EXTRALIBS
)
314 .PHONY
: lib documentation
*test regtest-
* swscale-error zlib-error alltools
check