ffmpeg: compilation: Makefile

1. Find sub-directory and ...
2. Care of the literature and ...

*
Parameterprint
--
--
CONFIG_POSTPROC-

--
.PHONY...  there is a file named clean. ...
--
--

--
--
--
--

.\Makefile File changed time Fri Jun 04 12:29:06 2021
1 :MAIN_MAKEFILE=1
2 :include config.mak
3 :
4 :vpath %.c $(SRC_PATH)
5 :vpath %.cpp $(SRC_PATH)
6 :vpath %.h $(SRC_PATH)
7 :vpath %.inc $(SRC_PATH)
8 :vpath %.m $(SRC_PATH)
9 :vpath %.S $(SRC_PATH)
10 :vpath %.asm $(SRC_PATH)
11 :vpath %.rc $(SRC_PATH)
12 :vpath %.v $(SRC_PATH)
13 :vpath %.texi $(SRC_PATH)
14 :vpath %/fate_config.sh.template $(SRC_PATH)
15 :
16 :AVPROGS-$(CONFIG_FFMPEG) += ffmpeg
17 :AVPROGS-$(CONFIG_FFPLAY) += ffplay
18 :AVPROGS-$(CONFIG_FFPROBE) += ffprobe
19 :AVPROGS-$(CONFIG_FFSERVER) += ffserver
20 :
21 :AVPROGS := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
22 :INSTPROGS = $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
23 :PROGS += $(AVPROGS)
24 :
25 :AVBASENAMES = ffmpeg ffplay ffprobe ffserver
26 :ALLAVPROGS = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
27 :ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
28 :
29 :$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o))
30 :$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_opencl.o))
31 :
32 :OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
33 :OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
34 :OBJS-ffmpeg-$(CONFIG_LIBMFX) += ffmpeg_qsv.o
35 :OBJS-ffmpeg-$(CONFIG_VAAPI) += ffmpeg_vaapi.o
36 :ifndef CONFIG_VIDEOTOOLBOX
37 :OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_videotoolbox.o
38 :endif
39 :OBJS-ffmpeg-$(CONFIG_CUVID) += ffmpeg_cuvid.o
40 :OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
41 :OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
42 :OBJS-ffserver += ffserver_config.o
43 :
44 :TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
45 :HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
46 :TOOLS = qt-faststart trasher uncoded_frame
47 :TOOLS-$(CONFIG_ZLIB) += cws2fws
48 :
49 :# $(FFLIBS-yes) needs to be in linking order
50 :FFLIBS-$(CONFIG_AVDEVICE) += avdevice
51 :FFLIBS-$(CONFIG_AVFILTER) += avfilter
52 :FFLIBS-$(CONFIG_AVFORMAT) += avformat
53 :FFLIBS-$(CONFIG_AVCODEC) += avcodec
54 :FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
55 :FFLIBS-$(CONFIG_POSTPROC) += postproc
56 :FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
57 :FFLIBS-$(CONFIG_SWSCALE) += swscale
58 :
59 :FFLIBS := avutil
60 :
61 :DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
62 :EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README
63 :
64 :SKIPHEADERS = cmdutils_common_opts.h \
65 : compat/w32pthreads.h
66 :
67 :include $(SRC_PATH)/common.mak
68 :
69 :FF_EXTRALIBS := $(FFEXTRALIBS)
70 :FF_DEP_LIBS := $(DEP_LIBS)
71 :FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
72 :
73 :all: $(AVPROGS)
74 :
75 :$(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
76 : $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS)
77 :
78 :tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
79 :tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
80 :tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
81 :
82 :config.h: .config
83 :.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
84 : @-tput bold 2>/dev/null
85 : @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
86 : @-tput sgr0 2>/dev/null
87 :
88 :SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
89 : HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
90 : ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
91 : ALTIVEC-OBJS MMX-OBJS YASM-OBJS \
92 : MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
93 : MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
94 :
95 :define RESET
96 :$(1) :=
97 :$(1)-yes :=
98 :endef
99 :
00 :define DOSUBDIR
01 :$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
02 :SUBDIR := $(1)/
03 :include $(SRC_PATH)/$(1)/Makefile
04 :-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
05 :-include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
06 :include $(SRC_PATH)/library.mak
07 :endef
08 :
09 :$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
10 :
11 :include $(SRC_PATH)/doc/Makefile
12 :
13 :define DOPROG
14 :OBJS-$(1) += $(1).o $(EXEOBJS) $(OBJS-$(1)-yes)
15 :$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
16 :$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
17 :$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
18 :$(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
19 :-include $$(OBJS-$(1):.o=.d)
20 :endef
21 :
22 :$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
23 :
24 :ffprobe.o cmdutils.o 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
25 :
26 :$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
27 : $(CP) $< $@
28 : $(STRIP) $@
29 :
30 :%$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
31 : $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
32 :
33 :OBJDIRS += tools
34 :
35 :-include $(wildcard tools/*.d)
36 :
37 :VERSION_SH = $(SRC_PATH)/version.sh
38 :GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
39 :
40 :.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
41 :.version: M=@
42 :
43 :libavutil/ffversion.h .version:
44 : $(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
45 : $(Q)touch .version
46 :
47 :# force version.sh to run whenever version might have changed
48 :-include .version
49 :
50 :ifdef AVPROGS
51 :install: install-progs install-data
52 :endif
53 :
54 :install: install-libs install-headers
55 :
56 :install-libs: install-libs-yes
57 :
58 :install-progs-yes:
59 :install-progs-$(CONFIG_SHARED): install-libs
60 :
61 :install-progs: install-progs-yes $(AVPROGS)
62 : $(Q)mkdir -p "$(BINDIR)"
63 : $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
64 :
65 :install-data: $(DATA_FILES) $(EXAMPLES_FILES)
66 : $(Q)mkdir -p "$(DATADIR)/examples"
67 : $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
68 : $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
69 :
70 :uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
71 :
72 :uninstall-progs:
73 : $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
74 :
75 :uninstall-data:
76 : $(RM) -r "$(DATADIR)"
77 :
78 :clean::
79 : $(RM) $(ALLAVPROGS) $(ALLAVPROGS_G)
80 : $(RM) $(CLEANSUFFIXES)
81 : $(RM) $(CLEANSUFFIXES:%=tools/%)
82 : $(RM) $(CLEANSUFFIXES:%=compat/msvcrt/%)
83 : $(RM) $(CLEANSUFFIXES:%=compat/atomics/pthread/%)
84 : $(RM) $(CLEANSUFFIXES:%=compat/%)
85 : $(RM) -r coverage-html
86 : $(RM) -rf coverage.info coverage.info.in lcov
87 :
88 :distclean::
89 : $(RM) $(DISTCLEANSUFFIXES)
90 : $(RM) config.* .config libavutil/avconfig.h .version mapfile avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h libavcodec/bsf_list.c libavformat/protocol_list.c
91 :ifeq ($(SRC_LINK),src)
92 : $(RM) src
93 :endif
94 : $(RM) -rf doc/examples/pc-uninstalled
95 :
96 :config:
97 : $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
98 :
99 :check: all alltools examples testprogs fate
00 :
01 :include $(SRC_PATH)/tests/Makefile
02 :
03 :$(sort $(OBJDIRS)):
04 : $(Q)mkdir -p $@
05 :
06 :# Dummy rule to stop make trying to rebuild removed or renamed headers
07 :%.h:
08 : @:
09 :
10 :# Disable suffix rules. Most of the builtin rules are suffix rules,
11 :# so this saves some time on slow systems.
12 :.SUFFIXES:
13 :
14 :.PHONY: all all-yes alltools check *clean config install*
15 :.PHONY: testprogs uninstall*
16 :

コメント