5 vpath %.cpp $(SRC_PATH)
8 vpath %.asm $(SRC_PATH)
10 vpath %.texi $(SRC_PATH)
12 PROGS-$(CONFIG_FFMPEG) += ffmpeg
13 PROGS-$(CONFIG_AVCONV) += avconv
14 PROGS-$(CONFIG_FFPLAY) += ffplay
15 PROGS-$(CONFIG_FFPROBE) += ffprobe
16 PROGS-$(CONFIG_FFSERVER) += ffserver
18 PROGS := $(PROGS-yes:%=%$(EXESUF))
19 INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
20 OBJS = $(PROGS-yes:%=%.o) cmdutils.o
21 TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
22 HOSTPROGS := $(TESTTOOLS:%=tests/%)
23 TOOLS = qt-faststart trasher
24 TOOLS-$(CONFIG_ZLIB) += cws2fws
26 BASENAMES = ffmpeg avconv ffplay ffprobe ffserver
27 ALLPROGS = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
28 ALLPROGS_G = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
29 ALLMANPAGES = $(BASENAMES:%=%.1)
31 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
32 FFLIBS-$(CONFIG_AVFILTER) += avfilter
33 FFLIBS-$(CONFIG_AVFORMAT) += avformat
34 FFLIBS-$(CONFIG_AVCODEC) += avcodec
35 FFLIBS-$(CONFIG_POSTPROC) += postproc
36 FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
37 FFLIBS-$(CONFIG_SWSCALE) += swscale
41 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset)
43 SKIPHEADERS = cmdutils_common_opts.h
45 include $(SRC_PATH)/common.mak
47 FF_EXTRALIBS := $(FFEXTRALIBS)
48 FF_DEP_LIBS := $(DEP_LIBS)
52 $(PROGS): %$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
53 $(CP) $< $@$(PROGSSUF)
54 $(STRIP) $@$(PROGSSUF)
56 $(TOOLS): %$(EXESUF): %.o
57 $(LD) $(LDFLAGS) -o $@ $< $(ELIBS)
59 tools/cws2fws$(EXESUF): ELIBS = -lz
62 .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
63 @-tput bold 2>/dev/null
64 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
65 @-tput sgr0 2>/dev/null
67 SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
68 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
69 HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS TOOLS
77 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
79 include $(SRC_PATH)/$(1)/Makefile
82 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
84 ffplay.o: CFLAGS += $(SDL_CFLAGS)
85 ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
86 ffserver_g$(EXESUF): LDFLAGS += $(FFSERVERLDFLAGS)
88 %$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
89 $(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
93 -include $(wildcard tools/*.d)
95 VERSION_SH = $(SRC_PATH)/version.sh
96 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
98 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
102 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
105 # force version.sh to run whenever version might have changed
109 install: install-progs install-data
112 install: install-libs install-headers
114 install-libs: install-libs-yes
117 install-progs-$(CONFIG_SHARED): install-libs
119 install-progs: install-progs-yes $(PROGS)
120 $(Q)mkdir -p "$(BINDIR)"
121 $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
123 install-data: $(DATA_FILES)
124 $(Q)mkdir -p "$(DATADIR)"
125 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
127 uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
130 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
133 $(RM) -r "$(DATADIR)"
136 $(RM) $(ALLPROGS) $(ALLPROGS_G)
137 $(RM) $(CLEANSUFFIXES)
139 $(RM) $(CLEANSUFFIXES:%=tools/%)
141 $(RM) -r coverage-html
144 $(RM) $(DISTCLEANSUFFIXES)
145 $(RM) config.* .version version.h libavutil/avconfig.h
148 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
150 # Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
151 coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
152 $(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
154 coverage-html: coverage.info
159 include $(SRC_PATH)/doc/Makefile
160 include $(SRC_PATH)/tests/Makefile
165 # Dummy rule to stop make trying to rebuild removed or renamed headers
169 # Disable suffix rules. Most of the builtin rules are suffix rules,
170 # so this saves some time on slow systems.
173 .PHONY: all all-yes alltools *clean config examples install*
174 .PHONY: testprogs uninstall*