avfilter/metadata: add intuitive labels for metadata values
[ffmpeg.git] / Makefile
1 MAIN_MAKEFILE=1
2 include ffbuild/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 %.cu   $(SRC_PATH)
15 vpath %.ptx  $(SRC_PATH)
16 vpath %/fate_config.sh.template $(SRC_PATH)
17
18 TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
19 HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
20
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_POSTPROC)   += postproc
27 FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
28 FFLIBS-$(CONFIG_SWSCALE)    += swscale
29
30 FFLIBS := avutil
31
32 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
33
34 SKIPHEADERS = compat/w32pthreads.h
35
36 # first so "all" becomes default target
37 all: all-yes
38
39 include $(SRC_PATH)/tools/Makefile
40 include $(SRC_PATH)/ffbuild/common.mak
41
42 FF_EXTRALIBS := $(FFEXTRALIBS)
43 FF_DEP_LIBS  := $(DEP_LIBS)
44 FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
45
46 $(TOOLS): %$(EXESUF): %.o
47         $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS-$(*F)) $(EXTRALIBS) $(ELIBS)
48
49 target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
50         $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
51
52 tools/target_bsf_%_fuzzer$(EXESUF): tools/target_bsf_%_fuzzer.o $(FF_DEP_LIBS)
53         $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
54
55 target_dem_%_fuzzer$(EXESUF): target_dem_%_fuzzer.o $(FF_DEP_LIBS)
56         $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
57
58 tools/target_dem_fuzzer$(EXESUF): tools/target_dem_fuzzer.o $(FF_DEP_LIBS)
59         $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
60
61 tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o $(FF_DEP_LIBS)
62         $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
63
64
65 tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS)
66 tools/enum_options$(EXESUF): $(FF_DEP_LIBS)
67 tools/sofa2wavs$(EXESUF): ELIBS = $(FF_EXTRALIBS)
68 tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
69 tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
70 tools/target_dec_%_fuzzer$(EXESUF): $(FF_DEP_LIBS)
71 tools/target_dem_%_fuzzer$(EXESUF): $(FF_DEP_LIBS)
72
73 CONFIGURABLE_COMPONENTS =                                           \
74     $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))                 \
75     $(SRC_PATH)/libavcodec/bitstream_filters.c                      \
76     $(SRC_PATH)/libavcodec/parsers.c                                \
77     $(SRC_PATH)/libavformat/protocols.c                             \
78
79 config.h: ffbuild/.config
80 ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
81         @-tput bold 2>/dev/null
82         @-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
83         @-tput sgr0 2>/dev/null
84
85 SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS               \
86                HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS            \
87                ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS     \
88                ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS                \
89                MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS         \
90                MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
91
92 define RESET
93 $(1) :=
94 $(1)-yes :=
95 endef
96
97 define DOSUBDIR
98 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
99 SUBDIR := $(1)/
100 include $(SRC_PATH)/$(1)/Makefile
101 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
102 -include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
103 include $(SRC_PATH)/ffbuild/library.mak
104 endef
105
106 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
107
108 include $(SRC_PATH)/fftools/Makefile
109 include $(SRC_PATH)/doc/Makefile
110 include $(SRC_PATH)/doc/examples/Makefile
111
112 libavcodec/avcodec.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
113
114 $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
115 ifeq ($(STRIPTYPE),direct)
116         $(STRIP) -o $@ $<
117 else
118         $(CP) $< $@
119         $(STRIP) $@
120 endif
121
122 %$(PROGSSUF)_g$(EXESUF): $(FF_DEP_LIBS)
123         $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
124
125 VERSION_SH  = $(SRC_PATH)/ffbuild/version.sh
126 GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD
127
128 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) ffbuild/config.mak
129 .version: M=@
130
131 libavutil/ffversion.h .version:
132         $(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
133         $(Q)touch .version
134
135 # force version.sh to run whenever version might have changed
136 -include .version
137
138 install: install-libs install-headers
139
140 install-libs: install-libs-yes
141
142 install-data: $(DATA_FILES)
143         $(Q)mkdir -p "$(DATADIR)"
144         $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
145
146 uninstall: uninstall-data uninstall-headers uninstall-libs uninstall-pkgconfig
147
148 uninstall-data:
149         $(RM) -r "$(DATADIR)"
150
151 clean::
152         $(RM) $(CLEANSUFFIXES)
153         $(RM) $(addprefix compat/,$(CLEANSUFFIXES)) $(addprefix compat/*/,$(CLEANSUFFIXES)) $(addprefix compat/*/*/,$(CLEANSUFFIXES))
154         $(RM) -r coverage-html
155         $(RM) -rf coverage.info coverage.info.in lcov
156
157 distclean:: clean
158         $(RM) .version avversion.h config.asm config.h mapfile  \
159                 ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
160                 version.h libavutil/ffversion.h libavcodec/codec_names.h \
161                 libavcodec/bsf_list.c libavformat/protocol_list.c \
162                 libavcodec/codec_list.c libavcodec/parser_list.c \
163                 libavfilter/filter_list.c libavdevice/indev_list.c libavdevice/outdev_list.c \
164                 libavformat/muxer_list.c libavformat/demuxer_list.c
165 ifeq ($(SRC_LINK),src)
166         $(RM) src
167 endif
168         $(RM) -rf doc/examples/pc-uninstalled
169
170 config:
171         $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
172
173 build: all alltools examples testprogs
174 check: all alltools examples testprogs fate
175
176 include $(SRC_PATH)/tests/Makefile
177
178 $(sort $(OUTDIRS)):
179         $(Q)mkdir -p $@
180
181 # Dummy rule to stop make trying to rebuild removed or renamed headers
182 %.h:
183         @:
184
185 # Disable suffix rules.  Most of the builtin rules are suffix rules,
186 # so this saves some time on slow systems.
187 .SUFFIXES:
188
189 .PHONY: all all-yes alltools build check config testprogs
190 .PHONY: *clean install* uninstall*