5 vpath %.cpp $(SRC_PATH)
8 vpath %.asm $(SRC_PATH)
10 vpath %.texi $(SRC_PATH)
11 vpath %/fate_config.sh.template $(SRC_PATH)
13 PROGS-$(CONFIG_FFMPEG) += ffmpeg
14 PROGS-$(CONFIG_FFPLAY) += ffplay
15 PROGS-$(CONFIG_FFPROBE) += ffprobe
16 PROGS-$(CONFIG_FFSERVER) += ffserver
18 PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
19 INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
21 OBJS = cmdutils.o $(EXEOBJS)
22 OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
23 TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
24 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
25 TOOLS = qt-faststart trasher
26 TOOLS-$(CONFIG_ZLIB) += cws2fws
28 BASENAMES = ffmpeg ffplay ffprobe ffserver
29 ALLPROGS = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
30 ALLPROGS_G = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
31 ALLMANPAGES = $(BASENAMES:%=%.1)
33 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
34 FFLIBS-$(CONFIG_AVFILTER) += avfilter
35 FFLIBS-$(CONFIG_AVFORMAT) += avformat
36 FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
37 FFLIBS-$(CONFIG_AVCODEC) += avcodec
38 FFLIBS-$(CONFIG_POSTPROC) += postproc
39 FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
40 FFLIBS-$(CONFIG_SWSCALE) += swscale
44 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
45 EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README
47 SKIPHEADERS = cmdutils_common_opts.h
49 include $(SRC_PATH)/common.mak
51 FF_EXTRALIBS := $(FFEXTRALIBS)
52 FF_DEP_LIBS := $(DEP_LIBS)
56 $(PROGS): %$(EXESUF): %_g$(EXESUF)
60 $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
61 $(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
63 tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
66 .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
67 @-tput bold 2>/dev/null
68 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
69 @-tput sgr0 2>/dev/null
71 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
72 HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
73 ARMV5TE-OBJS ARMV6-OBJS VFP-OBJS NEON-OBJS \
74 ALTIVEC-OBJS VIS-OBJS \
76 MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \
77 OBJS HOSTOBJS TESTOBJS
85 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
87 include $(SRC_PATH)/$(1)/Makefile
88 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
89 include $(SRC_PATH)/library.mak
92 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
95 OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS)
96 $(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
97 $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
98 $(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
99 $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
100 -include $$(OBJS-$(1):.o=.d)
103 $(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))
105 %$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
106 $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
110 -include $(wildcard tools/*.d)
112 VERSION_SH = $(SRC_PATH)/version.sh
113 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
115 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
119 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
122 # force version.sh to run whenever version might have changed
126 install: install-progs install-data
129 install: install-libs install-headers
131 install-libs: install-libs-yes
134 install-progs-$(CONFIG_SHARED): install-libs
136 install-progs: install-progs-yes $(PROGS)
137 $(Q)mkdir -p "$(BINDIR)"
138 $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
140 install-data: $(DATA_FILES) $(EXAMPLES_FILES)
141 $(Q)mkdir -p "$(DATADIR)/examples"
142 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
143 $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
145 uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
148 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
151 $(RM) -r "$(DATADIR)"
154 $(RM) $(ALLPROGS) $(ALLPROGS_G)
155 $(RM) $(CLEANSUFFIXES)
156 $(RM) $(CLEANSUFFIXES:%=tools/%)
158 $(RM) -r coverage-html
161 $(RM) $(DISTCLEANSUFFIXES)
162 $(RM) config.* .version version.h libavutil/avconfig.h libavcodec/codec_names.h
165 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
167 # Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
168 coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
169 $(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
171 coverage-html: coverage.info
176 check: all alltools examples testprogs fate
178 include $(SRC_PATH)/doc/Makefile
179 include $(SRC_PATH)/tests/Makefile
184 # Dummy rule to stop make trying to rebuild removed or renamed headers
188 # Disable suffix rules. Most of the builtin rules are suffix rules,
189 # so this saves some time on slow systems.
192 .PHONY: all all-yes alltools check *clean config install*
193 .PHONY: testprogs uninstall*