6 vpath %.asm $(SRC_PATH)
8 vpath %.texi $(SRC_PATH)
12 ECHO = printf "$(1)\t%s\n" $(2)
13 BRIEF = CC AS YASM AR LD HOSTCC
14 SILENT = DEPCC YASMDEP RM RANLIB
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)
29 YASMFLAGS += $(IFLAGS) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
30 HOSTCFLAGS += $(IFLAGS)
31 LDFLAGS := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
35 $($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $<
38 COMPILE_C = $(call COMPILE,CC)
39 COMPILE_S = $(call COMPILE,AS)
48 $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
51 $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
55 PROGS-$(CONFIG_AVCONV) += avconv
56 PROGS-$(CONFIG_AVPLAY) += avplay
57 PROGS-$(CONFIG_AVPROBE) += avprobe
58 PROGS-$(CONFIG_AVSERVER) += avserver
60 PROGS := $(PROGS-yes:%=%$(EXESUF))
61 OBJS = $(PROGS-yes:%=%.o) cmdutils.o
62 TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
63 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
64 TOOLS = qt-faststart trasher
65 TOOLS-$(CONFIG_ZLIB) += cws2fws
67 BASENAMES = avconv avplay avprobe avserver
68 ALLPROGS = $(BASENAMES:%=%$(EXESUF))
69 ALLMANPAGES = $(BASENAMES:%=%.1)
71 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
72 FFLIBS-$(CONFIG_AVFILTER) += avfilter
73 FFLIBS-$(CONFIG_AVFORMAT) += avformat
74 FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
75 FFLIBS-$(CONFIG_AVCODEC) += avcodec
76 FFLIBS-$(CONFIG_SWSCALE) += swscale
80 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
82 SKIPHEADERS = cmdutils_common_opts.h
84 include $(SRC_PATH)/common.mak
86 FF_EXTRALIBS := $(FFEXTRALIBS)
87 FF_DEP_LIBS := $(DEP_LIBS)
91 $(TOOLS): %$(EXESUF): %.o
92 $(LD) $(LDFLAGS) -o $@ $< $(ELIBS)
94 tools/cws2fws$(EXESUF): ELIBS = -lz
97 .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
98 @-tput bold 2>/dev/null
99 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
100 @-tput sgr0 2>/dev/null
102 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
103 ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
104 ALTIVEC-OBJS ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS MMI-OBJS \
105 MMX-OBJS NEON-OBJS VIS-OBJS YASM-OBJS \
114 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
116 include $(SRC_PATH)/$(1)/Makefile
117 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
118 include $(SRC_PATH)/library.mak
121 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
123 avplay.o: CFLAGS += $(SDL_CFLAGS)
124 avplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
125 avserver$(EXESUF): LDFLAGS += $(AVSERVERLDFLAGS)
127 $(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
128 $(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
132 -include $(wildcard tools/*.d)
134 VERSION_SH = $(SRC_PATH)/version.sh
135 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
137 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
141 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
144 # force version.sh to run whenever version might have changed
148 install: install-progs install-data
151 install: install-libs install-headers
153 install-libs: install-libs-yes
156 install-progs-$(CONFIG_SHARED): install-libs
158 install-progs: install-progs-yes $(PROGS)
159 $(Q)mkdir -p "$(BINDIR)"
160 $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
162 install-data: $(DATA_FILES)
163 $(Q)mkdir -p "$(DATADIR)"
164 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
166 uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
169 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
172 $(RM) -r "$(DATADIR)"
176 $(RM) $(CLEANSUFFIXES)
178 $(RM) $(CLEANSUFFIXES:%=tools/%)
181 $(RM) $(DISTCLEANSUFFIXES)
182 $(RM) config.* .version version.h libavutil/avconfig.h
185 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
187 check: all alltools checkheaders examples testprogs fate
189 include $(SRC_PATH)/doc/Makefile
190 include $(SRC_PATH)/tests/Makefile
195 # Dummy rule to stop make trying to rebuild removed or renamed headers
199 # Disable suffix rules. Most of the builtin rules are suffix rules,
200 # so this saves some time on slow systems.
203 .PHONY: all all-yes alltools check *clean config examples install*
204 .PHONY: testprogs uninstall*