6 vpath %.asm $(SRC_PATH)
8 vpath %.texi $(SRC_PATH)
12 ECHO = printf "$(1)\t%s\n" $(2)
13 BRIEF = CC HOSTCC HOSTLD AS YASM AR LD
14 SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
16 M = @$(call ECHO,$(TAG),$@);
17 $(foreach VAR,$(BRIEF), \
18 $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
19 $(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
20 $(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
23 ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil swscale
25 IFLAGS := -I. -I$(SRC_PATH)
26 CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
28 CCFLAGS = $(CPPFLAGS) $(CFLAGS)
29 ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
30 YASMFLAGS += $(IFLAGS:%=%/) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
31 HOSTCCFLAGS = $(IFLAGS) $(HOSTCFLAGS)
32 LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
36 $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
39 COMPILE_C = $(call COMPILE,CC)
40 COMPILE_S = $(call COMPILE,AS)
49 $(Q)echo '#include "$*.h"' >$@
52 $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
56 PROGS-$(CONFIG_AVCONV) += avconv
57 PROGS-$(CONFIG_AVPLAY) += avplay
58 PROGS-$(CONFIG_AVPROBE) += avprobe
59 PROGS-$(CONFIG_AVSERVER) += avserver
61 PROGS := $(PROGS-yes:%=%$(EXESUF))
63 OBJS-avconv = avconv_opt.o avconv_filter.o
64 TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
65 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
66 TOOLS = qt-faststart trasher
67 TOOLS-$(CONFIG_ZLIB) += cws2fws
69 BASENAMES = avconv avplay avprobe avserver
70 ALLPROGS = $(BASENAMES:%=%$(EXESUF))
71 ALLMANPAGES = $(BASENAMES:%=%.1)
73 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
74 FFLIBS-$(CONFIG_AVFILTER) += avfilter
75 FFLIBS-$(CONFIG_AVFORMAT) += avformat
76 FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
77 FFLIBS-$(CONFIG_AVCODEC) += avcodec
78 FFLIBS-$(CONFIG_SWSCALE) += swscale
82 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
84 SKIPHEADERS = cmdutils_common_opts.h
86 include $(SRC_PATH)/common.mak
88 FF_EXTRALIBS := $(FFEXTRALIBS)
89 FF_DEP_LIBS := $(DEP_LIBS)
93 $(TOOLS): %$(EXESUF): %.o
94 $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)
96 tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
99 .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
100 @-tput bold 2>/dev/null
101 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
102 @-tput sgr0 2>/dev/null
104 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
105 ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
106 ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS \
107 MMI-OBJS ALTIVEC-OBJS VIS-OBJS \
109 OBJS HOSTOBJS TESTOBJS
117 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
119 include $(SRC_PATH)/$(1)/Makefile
120 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
121 include $(SRC_PATH)/library.mak
124 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
128 $(1)$(EXESUF): $(OBJS-$(1))
129 $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
130 $(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
131 $(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
132 -include $$(OBJS-$(1):.o=.d)
135 $(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))
137 $(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
138 $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS)
142 -include $(wildcard tools/*.d)
144 VERSION_SH = $(SRC_PATH)/version.sh
145 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
147 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
151 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
154 # force version.sh to run whenever version might have changed
158 install: install-progs install-data
161 install: install-libs install-headers
163 install-libs: install-libs-yes
166 install-progs-$(CONFIG_SHARED): install-libs
168 install-progs: install-progs-yes $(PROGS)
169 $(Q)mkdir -p "$(BINDIR)"
170 $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
172 install-data: $(DATA_FILES)
173 $(Q)mkdir -p "$(DATADIR)"
174 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
176 uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
179 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
182 $(RM) -r "$(DATADIR)"
186 $(RM) $(CLEANSUFFIXES)
188 $(RM) $(CLEANSUFFIXES:%=tools/%)
191 $(RM) $(DISTCLEANSUFFIXES)
192 $(RM) config.* .version version.h libavutil/avconfig.h
195 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
197 check: all alltools checkheaders examples testprogs fate
199 include $(SRC_PATH)/doc/Makefile
200 include $(SRC_PATH)/tests/Makefile
205 # Dummy rule to stop make trying to rebuild removed or renamed headers
209 # Disable suffix rules. Most of the builtin rules are suffix rules,
210 # so this saves some time on slow systems.
213 .PHONY: all all-yes alltools check *clean config examples install*
214 .PHONY: testprogs uninstall*