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))
16 HOSTPROGS = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
18 BASENAMES = ffmpeg ffplay ffserver
19 ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
20 ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
21 ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
23 FFLIBS-$(CONFIG_AVFILTER) += avfilter
24 FFLIBS-$(CONFIG_POSTPROC) += postproc
26 FFLIBS := avdevice avformat avcodec avutil swscale
28 DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
32 FF_LDFLAGS := $(FFLDFLAGS)
33 FF_EXTRALIBS := $(FFEXTRALIBS)
34 FF_DEP_LIBS := $(DEP_LIBS)
36 ALL_TARGETS-$(BUILD_DOC) += documentation
39 INSTALL_TARGETS-yes += install-progs install-data
40 INSTALL_TARGETS-$(BUILD_DOC) += install-man
42 INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
44 all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
46 $(PROGS): %$(EXESUF): %_g$(EXESUF)
50 SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
51 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
60 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
65 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
67 ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
68 ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
70 %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
71 $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
73 tools/%$(EXESUF): tools/%.o
74 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
77 $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
79 ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
81 cmdutils.o cmdutils.d: version.h
85 documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
86 ffplay-doc.html ffserver-doc.html \
87 general.html libavfilter.html $(ALLMANPAGES))
89 doc/%.html: doc/%.texi
90 texi2html -monolithic -number $<
93 doc/%.pod: doc/%-doc.texi
97 pod2man --section=1 --center=" " --release=" " $< > $@
99 install: $(INSTALL_TARGETS-yes)
101 install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
102 install -d "$(BINDIR)"
103 install -c -m 755 $(PROGS) "$(BINDIR)"
105 install-data: $(DATA_FILES)
106 install -d "$(DATADIR)"
107 install -m 644 $(DATA_FILES) "$(DATADIR)"
109 install-man: $(MANPAGES)
110 install -d "$(MANDIR)/man1"
111 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
113 uninstall: uninstall-progs uninstall-data uninstall-man
116 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
122 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
125 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/*~
128 rm -f $(ALLPROGS) $(ALLPROGS_G)
129 rm -f $(CLEANSUFFIXES)
130 rm -f doc/*.html doc/*.pod doc/*.1
131 rm -f tests/seek_test$(EXESUF) tests/seek_test.o
132 rm -f $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
136 rm -f $(DISTCLEANSUFFIXES)
137 rm -f version.h config.*
140 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
144 check: test checkheaders
146 fulltest test: codectest lavftest seektest
148 FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
149 LAVF_REFFILE = $(SRC_PATH)/tests/lavf.regression.ref
150 LAVFI_REFFILE = $(SRC_PATH)/tests/lavfi.regression.ref
151 ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
152 SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
153 VSYNTH_REFFILE = $(SRC_PATH)/tests/vsynth.regression.ref
155 CODEC_TESTS = $(addprefix regtest-, \
206 LAVF_TESTS = $(addprefix regtest-, \
245 LAVFI_TESTS = $(addprefix regtest-, \
248 RESFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
250 ROTOZOOM_RESFILES = $(call RESFILES,rotozoom.regression,$(CODEC_TESTS))
251 VSYNTH_RESFILES = $(call RESFILES,vsynth.regression,$(CODEC_TESTS))
253 LAVF_RESFILES = $(call RESFILES,lavf.regression,$(LAVF_TESTS))
254 LAVFI_RESFILES = $(call RESFILES,lavfi.regression,$(LAVFI_TESTS))
256 LAVF_RESFILE = tests/data/lavf.regression
257 LAVFI_RESFILE = tests/data/lavfi.regression
258 ROTOZOOM_RESFILE = tests/data/rotozoom.regression
259 VSYNTH_RESFILE = tests/data/vsynth.regression
261 ifneq ($(CONFIG_ZLIB),yes)
262 regtest-flashsv codectest: zlib-error
266 @echo "This regression test requires zlib."
270 codectest: $(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE)
271 diff -u -w $(VSYNTH_REFFILE) $(VSYNTH_RESFILE)
272 diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_RESFILE)
274 lavftest: $(LAVF_RESFILE)
275 diff -u -w $(LAVF_REFFILE) $(LAVF_RESFILE)
277 # lavfitest: $(LAVFI_RESFILE)
278 # diff -u -w $(LAVFI_REFFILE) $(LAVFI_RESFILE)
280 $(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE) $(LAVF_RESFILE) $(LAVFI_RESFILE):
283 $(LAVF_RESFILE): $(LAVF_RESFILES)
284 $(LAVFI_RESFILE): $(LAVFI_RESFILES)
285 $(ROTOZOOM_RESFILE): $(ROTOZOOM_RESFILES)
286 $(VSYNTH_RESFILE): $(VSYNTH_RESFILES)
288 $(VSYNTH_RESFILES) $(ROTOZOOM_RESFILES): $(CODEC_TESTS)
290 $(LAVF_RESFILES): $(LAVF_TESTS)
291 $(LAVFI_RESFILES): $(LAVFI_TESTS)
293 $(CODEC_TESTS) $(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
295 regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/data/asynth1.sw
297 $(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(HOSTEXESUF)
298 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
299 $(SRC_PATH)/tests/codec-regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
302 $(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
305 $(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
307 seektest: codectest lavftest tests/seek_test$(EXESUF)
308 $(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
310 ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
312 @echo "Unfortunately ffserver is broken and therefore its regression"
313 @echo "test fails randomly. Treat the results accordingly."
315 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
317 tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
318 mkdir -p tests/vsynth1
319 $(BUILD_ROOT)/$< 'tests/vsynth1/'
321 tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
322 mkdir -p tests/vsynth2
323 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
325 tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
329 tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
330 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
333 .PHONY: documentation *test regtest-* zlib-error alltools check config