5 vpath %.cpp $(SRC_PATH)
8 vpath %.asm $(SRC_PATH)
10 vpath %.texi $(SRC_PATH)
11 vpath %/fate_config.sh.template $(SRC_PATH)
13 AVPROGS-$(CONFIG_FFMPEG) += ffmpeg
14 AVPROGS-$(CONFIG_FFPLAY) += ffplay
15 AVPROGS-$(CONFIG_FFPROBE) += ffprobe
16 AVPROGS-$(CONFIG_FFSERVER) += ffserver
18 AVPROGS := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
19 INSTPROGS = $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
22 AVBASENAMES = ffmpeg ffplay ffprobe ffserver
23 ALLAVPROGS = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
24 ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
26 $(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o))
28 OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
29 OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
30 TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
31 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
32 TOOLS = qt-faststart trasher
33 TOOLS-$(CONFIG_ZLIB) += cws2fws
35 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
36 FFLIBS-$(CONFIG_AVFILTER) += avfilter
37 FFLIBS-$(CONFIG_AVFORMAT) += avformat
38 FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
39 FFLIBS-$(CONFIG_AVCODEC) += avcodec
40 FFLIBS-$(CONFIG_POSTPROC) += postproc
41 FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
42 FFLIBS-$(CONFIG_SWSCALE) += swscale
46 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
47 EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README
49 SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h
51 include $(SRC_PATH)/common.mak
53 FF_EXTRALIBS := $(FFEXTRALIBS)
54 FF_DEP_LIBS := $(DEP_LIBS)
58 $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
59 $(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
61 tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
64 .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
65 @-tput bold 2>/dev/null
66 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
67 @-tput sgr0 2>/dev/null
69 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
70 HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
71 ARMV5TE-OBJS ARMV6-OBJS VFP-OBJS NEON-OBJS \
72 ALTIVEC-OBJS VIS-OBJS \
74 MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \
75 OBJS HOSTOBJS TESTOBJS
83 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
85 include $(SRC_PATH)/$(1)/Makefile
86 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
87 include $(SRC_PATH)/library.mak
90 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
92 include $(SRC_PATH)/doc/Makefile
95 OBJS-$(1) += $(1).o $(EXEOBJS) $(OBJS-$(1)-yes)
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),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
105 $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
109 %$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
110 $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
114 -include $(wildcard tools/*.d)
116 VERSION_SH = $(SRC_PATH)/version.sh
117 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
119 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
123 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
126 # force version.sh to run whenever version might have changed
130 install: install-progs install-data
133 install: install-libs install-headers
135 install-libs: install-libs-yes
138 install-progs-$(CONFIG_SHARED): install-libs
140 install-progs: install-progs-yes $(AVPROGS)
141 $(Q)mkdir -p "$(BINDIR)"
142 $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
144 install-data: $(DATA_FILES) $(EXAMPLES_FILES)
145 $(Q)mkdir -p "$(DATADIR)/examples"
146 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
147 $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
149 uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
152 $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
155 $(RM) -r "$(DATADIR)"
158 $(RM) $(ALLAVPROGS) $(ALLAVPROGS_G)
159 $(RM) $(CLEANSUFFIXES)
160 $(RM) $(CLEANSUFFIXES:%=tools/%)
161 $(RM) -r coverage-html
162 $(RM) -rf coverage.info lcov
165 $(RM) $(DISTCLEANSUFFIXES)
166 $(RM) config.* .config libavutil/avconfig.h .version version.h libavcodec/codec_names.h
169 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
171 check: all alltools examples testprogs fate
173 include $(SRC_PATH)/tests/Makefile
178 # Dummy rule to stop make trying to rebuild removed or renamed headers
182 # Disable suffix rules. Most of the builtin rules are suffix rules,
183 # so this saves some time on slow systems.
186 .PHONY: all all-yes alltools check *clean config install*
187 .PHONY: testprogs uninstall*