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
:%=%/) -Pconfig.asm
31 HOSTCCFLAGS
= $(IFLAGS
) $(HOSTCPPFLAGS
) $(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 $(CC
) $(CCFLAGS
) $(CC_E
) $<
52 $(Q
)echo
'#include "$*.h"' >$@
55 $(Q
)sed
's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^
> $@
59 PROGS-
$(CONFIG_AVCONV
) += avconv
60 PROGS-
$(CONFIG_AVPLAY
) += avplay
61 PROGS-
$(CONFIG_AVPROBE
) += avprobe
62 PROGS-
$(CONFIG_AVSERVER
) += avserver
64 PROGS
:= $(PROGS-yes
:%=%$(EXESUF
))
65 OBJS
= cmdutils.o
$(EXEOBJS
)
66 OBJS-avconv
= avconv_opt.o avconv_filter.o
67 TESTTOOLS
= audiogen videogen rotozoom tiny_psnr base64
68 HOSTPROGS
:= $(TESTTOOLS
:%=tests
/%) doc
/print_options
69 TOOLS
= qt-faststart trasher
70 TOOLS-
$(CONFIG_ZLIB
) += cws2fws
72 BASENAMES
= avconv avplay avprobe avserver
73 ALLPROGS
= $(BASENAMES
:%=%$(EXESUF
))
74 ALLMANPAGES
= $(BASENAMES
:%=%.1)
76 FFLIBS-
$(CONFIG_AVDEVICE
) += avdevice
77 FFLIBS-
$(CONFIG_AVFILTER
) += avfilter
78 FFLIBS-
$(CONFIG_AVFORMAT
) += avformat
79 FFLIBS-
$(CONFIG_AVRESAMPLE
) += avresample
80 FFLIBS-
$(CONFIG_AVCODEC
) += avcodec
81 FFLIBS-
$(CONFIG_SWSCALE
) += swscale
85 DATA_FILES
:= $(wildcard $(SRC_PATH
)/presets
/*.avpreset
)
87 SKIPHEADERS
= cmdutils_common_opts.h
89 include $(SRC_PATH
)/common.mak
91 FF_EXTRALIBS
:= $(FFEXTRALIBS
)
92 FF_DEP_LIBS
:= $(DEP_LIBS
)
96 $(TOOLS
): %$(EXESUF
): %.o
$(EXEOBJS
)
97 $(LD
) $(LDFLAGS
) $(LD_O
) $^
$(ELIBS
)
99 tools
/cws2fws
$(EXESUF
): ELIBS
= $(ZLIB
)
102 .config
: $(wildcard $(FFLIBS
:%=$(SRC_PATH
)/lib
%/all*.c
))
103 @
-tput bold
2>/dev
/null
104 @
-printf
'\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
105 @
-tput sgr0
2>/dev
/null
107 SUBDIR_VARS
:= CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
108 HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
109 ARMV5TE-OBJS ARMV6-OBJS VFP-OBJS NEON-OBJS \
110 ALTIVEC-OBJS VIS-OBJS \
112 OBJS HOSTOBJS TESTOBJS
120 $(foreach V
,$(SUBDIR_VARS
),$(eval
$(call RESET
,$(V
))))
122 include $(SRC_PATH
)/$(1)/Makefile
123 -include $(SRC_PATH
)/$(1)/$(ARCH
)/Makefile
124 include $(SRC_PATH
)/library.mak
127 $(foreach D
,$(FFLIBS
),$(eval
$(call DOSUBDIR
,lib
$(D
))))
130 OBJS-
$(1) += $(1).o cmdutils.o
$(EXEOBJS
)
131 $(1)$(EXESUF
): $$(OBJS-
$(1))
132 $$(OBJS-
$(1)): CFLAGS
+= $(CFLAGS-
$(1))
133 $(1)$(EXESUF
): LDFLAGS
+= $(LDFLAGS-
$(1))
134 $(1)$(EXESUF
): FF_EXTRALIBS
+= $(LIBS-
$(1))
135 -include $$(OBJS-
$(1):.o
=.d
)
138 $(foreach P
,$(PROGS-yes
),$(eval
$(call DOPROG
,$(P
))))
140 $(PROGS
): %$(EXESUF
): %.o
$(FF_DEP_LIBS
)
141 $(LD
) $(LDFLAGS
) $(LD_O
) $(OBJS-
$*) $(FF_EXTRALIBS
)
145 -include $(wildcard tools
/*.d
)
147 VERSION_SH
= $(SRC_PATH
)/version.sh
148 GIT_LOG
= $(SRC_PATH
)/.git
/logs
/HEAD
150 .version
: $(wildcard $(GIT_LOG
)) $(VERSION_SH
) config.mak
154 $(M
)$(VERSION_SH
) $(SRC_PATH
) version.h
$(EXTRA_VERSION
)
157 # force version.sh to run whenever version might have changed
161 install: install-progs install-data
164 install: install-libs install-headers
166 install-libs
: install-libs-yes
169 install-progs-
$(CONFIG_SHARED
): install-libs
171 install-progs
: install-progs-yes
$(PROGS
)
172 $(Q
)mkdir
-p
"$(BINDIR)"
173 $(INSTALL
) -c
-m
755 $(PROGS
) "$(BINDIR)"
175 install-data
: $(DATA_FILES
)
176 $(Q
)mkdir
-p
"$(DATADIR)"
177 $(INSTALL
) -m
644 $(DATA_FILES
) "$(DATADIR)"
179 uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
182 $(RM
) $(addprefix "$(BINDIR)/", $(ALLPROGS
))
185 $(RM
) -r
"$(DATADIR)"
189 $(RM
) $(CLEANSUFFIXES
)
190 $(RM
) $(CLEANSUFFIXES
:%=tools
/%)
193 $(RM
) $(DISTCLEANSUFFIXES
)
194 $(RM
) config.
* .version version.h libavutil
/avconfig.h
197 $(SRC_PATH
)/configure
$(value LIBAV_CONFIGURATION
)
199 check: all alltools checkheaders examples testprogs fate
201 include $(SRC_PATH
)/doc
/Makefile
202 include $(SRC_PATH
)/tests
/Makefile
207 # Dummy rule to stop make trying to rebuild removed or renamed headers
211 # Disable suffix rules. Most of the builtin rules are suffix rules,
212 # so this saves some time on slow systems.
215 .PHONY
: all all-yes alltools
check *clean config examples
install*
216 .PHONY
: testprogs
uninstall*