2 include ffbuild/config.mak
5 vpath %.cpp $(SRC_PATH)
7 vpath %.inc $(SRC_PATH)
10 vpath %.asm $(SRC_PATH)
11 vpath %.rc $(SRC_PATH)
13 vpath %.texi $(SRC_PATH)
14 vpath %.cu $(SRC_PATH)
15 vpath %.ptx $(SRC_PATH)
16 vpath %/fate_config.sh.template $(SRC_PATH)
18 TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
19 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
21 # $(FFLIBS-yes) needs to be in linking order
22 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
23 FFLIBS-$(CONFIG_AVFILTER) += avfilter
24 FFLIBS-$(CONFIG_AVFORMAT) += avformat
25 FFLIBS-$(CONFIG_AVCODEC) += avcodec
26 FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
27 FFLIBS-$(CONFIG_POSTPROC) += postproc
28 FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
29 FFLIBS-$(CONFIG_SWSCALE) += swscale
33 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
35 SKIPHEADERS = compat/w32pthreads.h
37 # first so "all" becomes default target
40 include $(SRC_PATH)/tools/Makefile
41 include $(SRC_PATH)/ffbuild/common.mak
43 FF_EXTRALIBS := $(FFEXTRALIBS)
44 FF_DEP_LIBS := $(DEP_LIBS)
45 FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
47 $(TOOLS): %$(EXESUF): %.o
48 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS-$(*F)) $(EXTRALIBS) $(ELIBS)
50 target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
51 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
53 tools/sofa2wavs$(EXESUF): ELIBS = $(FF_EXTRALIBS)
54 tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
55 tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
56 tools/target_dec_%_fuzzer$(EXESUF): $(FF_DEP_LIBS)
58 CONFIGURABLE_COMPONENTS = \
59 $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \
60 $(SRC_PATH)/libavcodec/bitstream_filters.c \
61 $(SRC_PATH)/libavcodec/parsers.c \
62 $(SRC_PATH)/libavformat/protocols.c \
64 config.h: ffbuild/.config
65 ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
66 @-tput bold 2>/dev/null
67 @-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
68 @-tput sgr0 2>/dev/null
70 SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
71 HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
72 ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
73 ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
74 MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
75 MMI-OBJS OBJS SLIBOBJS 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)/$(1)/$(INTRINSICS)/Makefile
88 include $(SRC_PATH)/ffbuild/library.mak
91 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
93 include $(SRC_PATH)/fftools/Makefile
94 include $(SRC_PATH)/doc/Makefile
95 include $(SRC_PATH)/doc/examples/Makefile
97 libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
99 $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
100 ifeq ($(STRIPTYPE),direct)
107 %$(PROGSSUF)_g$(EXESUF): $(FF_DEP_LIBS)
108 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
110 VERSION_SH = $(SRC_PATH)/ffbuild/version.sh
111 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
113 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) ffbuild/config.mak
116 libavutil/ffversion.h .version:
117 $(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
120 # force version.sh to run whenever version might have changed
123 install: install-libs install-headers
125 install-libs: install-libs-yes
127 install-data: $(DATA_FILES)
128 $(Q)mkdir -p "$(DATADIR)"
129 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
131 uninstall: uninstall-data uninstall-headers uninstall-libs uninstall-pkgconfig
134 $(RM) -r "$(DATADIR)"
137 $(RM) $(CLEANSUFFIXES)
138 $(RM) $(addprefix compat/,$(CLEANSUFFIXES)) $(addprefix compat/*/,$(CLEANSUFFIXES)) $(addprefix compat/*/*/,$(CLEANSUFFIXES))
139 $(RM) -r coverage-html
140 $(RM) -rf coverage.info coverage.info.in lcov
143 $(RM) .version avversion.h config.asm config.h mapfile \
144 ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
145 version.h libavutil/ffversion.h libavcodec/codec_names.h \
146 libavcodec/bsf_list.c libavformat/protocol_list.c \
147 libavcodec/codec_list.c libavcodec/parser_list.c \
148 libavformat/muxer_list.c libavformat/demuxer_list.c
149 ifeq ($(SRC_LINK),src)
152 $(RM) -rf doc/examples/pc-uninstalled
155 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
157 build: all alltools examples testprogs
158 check: all alltools examples testprogs fate
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 build check config testprogs
174 .PHONY: *clean install* uninstall*