hevc: Add names for reserved NAL unit types
[libav.git] / Makefile
1 include avbuild/config.mak
2
3 vpath %.c $(SRC_PATH)
4 vpath %.m $(SRC_PATH)
5 vpath %.h $(SRC_PATH)
6 vpath %.S $(SRC_PATH)
7 vpath %.asm $(SRC_PATH)
8 vpath %.v $(SRC_PATH)
9 vpath %.texi $(SRC_PATH)
10
11 ifndef V
12 Q = @
13 ECHO = printf "$(1)\t%s\n" $(2)
14 BRIEF = CC HOSTCC HOSTLD AS X86ASM AR LD
15 SILENT = DEPCC DEPHOSTCC DEPAS DEPX86ASM RANLIB RM STRIP
16 MSG = $@
17 M = @$(call ECHO,$(TAG),$@);
18 $(foreach VAR,$(BRIEF), \
19 $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
20 $(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
21 $(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
22 endif
23
24 ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil swscale
25
26 IFLAGS := -I. -I$(SRC_PATH)
27 CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
28 CFLAGS += $(ECFLAGS)
29 CCFLAGS = $(CPPFLAGS) $(CFLAGS)
30 OBJCFLAGS += $(EOBJCFLAGS)
31 OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
32 ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
33 X86ASMFLAGS += $(IFLAGS:%=%/) -I$(<D)/ -Pconfig.asm
34 HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
35 LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
36
37 define COMPILE
38 $(call $(1)DEP,$(1))
39 $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
40 endef
41
42 COMPILE_C = $(call COMPILE,CC)
43 COMPILE_S = $(call COMPILE,AS)
44 COMPILE_M = $(call COMPILE,OBJCC)
45 COMPILE_X86ASM = $(call COMPILE,X86ASM)
46 COMPILE_HOSTC = $(call COMPILE,HOSTCC)
47
48 %.o: %.c
49 $(COMPILE_C)
50
51 %.o: %.S
52 $(COMPILE_S)
53
54 %.o: %.m
55 $(COMPILE_M)
56
57 %_host.o: %.c
58 $(COMPILE_HOSTC)
59
60 %.o: %.asm
61 $(COMPILE_X86ASM)
62 -$(STRIP) $(STRIPFLAGS) $@
63
64 %.i: %.c
65 $(CC) $(CCFLAGS) $(CC_E) $<
66
67 %.h.c:
68 $(Q)echo '#include "$*.h"' >$@
69
70 %.c %.h %.pc %.ver %.version: TAG = GEN
71
72 TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
73 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
74
75 # $(FFLIBS-yes) needs to be in linking order
76 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
77 FFLIBS-$(CONFIG_AVFILTER) += avfilter
78 FFLIBS-$(CONFIG_AVFORMAT) += avformat
79 FFLIBS-$(CONFIG_AVCODEC) += avcodec
80 FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
81 FFLIBS-$(CONFIG_SWSCALE) += swscale
82
83 FFLIBS := avutil
84
85 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
86
87 SKIPHEADERS = compat/w32pthreads.h
88
89 # first so "all" becomes default target
90 all: all-yes
91
92 include $(SRC_PATH)/tools/Makefile
93 include $(SRC_PATH)/avbuild/common.mak
94
95 FF_EXTRALIBS := $(FFEXTRALIBS)
96 FF_DEP_LIBS := $(DEP_LIBS)
97 FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
98
99 $(TOOLS): %$(EXESUF): %.o
100 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS-$(*F)) $(EXTRALIBS) $(ELIBS)
101
102 CONFIGURABLE_COMPONENTS = \
103 $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \
104 $(SRC_PATH)/libavcodec/bitstream_filters.c \
105 $(SRC_PATH)/libavformat/protocols.c \
106
107 config.h: avbuild/.config
108 avbuild/.config: $(CONFIGURABLE_COMPONENTS)
109 @-tput bold 2>/dev/null
110 @-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
111 @-tput sgr0 2>/dev/null
112
113 SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
114 HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
115 ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
116 ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
117 OBJS HOSTOBJS TESTOBJS
118
119 define RESET
120 $(1) :=
121 $(1)-yes :=
122 endef
123
124 define DOSUBDIR
125 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
126 SUBDIR := $(1)/
127 include $(SRC_PATH)/$(1)/Makefile
128 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
129 -include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
130 include $(SRC_PATH)/avbuild/library.mak
131 endef
132
133 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
134
135 include $(SRC_PATH)/avtools/Makefile
136 include $(SRC_PATH)/doc/Makefile
137 include $(SRC_PATH)/doc/examples/Makefile
138
139 $(PROGS): %$(EXESUF): $(FF_DEP_LIBS)
140 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
141
142 VERSION_SH = $(SRC_PATH)/avbuild/version.sh
143 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
144
145 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) avbuild/config.mak
146 .version: M=@
147
148 libavutil/utils.o: avversion.h
149 avversion.h .version:
150 $(M)$(VERSION_SH) $(SRC_PATH) avversion.h $(EXTRA_VERSION)
151 $(Q)touch .version
152
153 # force version.sh to run whenever version might have changed
154 -include .version
155
156 install: install-libs install-headers
157
158 install-libs: install-libs-yes
159
160 install-data: $(DATA_FILES)
161 $(Q)mkdir -p "$(DATADIR)"
162 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
163
164 uninstall: uninstall-libs uninstall-headers uninstall-data
165
166 uninstall-data:
167 $(RM) -r "$(DATADIR)"
168
169 clean::
170 $(RM) $(CLEANSUFFIXES)
171 $(RM) -rf coverage.info lcov
172
173 distclean::
174 $(RM) $(DISTCLEANSUFFIXES)
175 $(RM) .version avversion.h config.asm config.h mapfile \
176 avbuild/.config avbuild/config.* libavutil/avconfig.h \
177 libavcodec/bsf_list.c libavformat/protocol_list.c
178
179 config:
180 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
181
182 build: all alltools checkheaders examples testprogs
183 check: all alltools checkheaders examples testprogs fate
184
185 include $(SRC_PATH)/tests/Makefile
186
187 $(sort $(OBJDIRS)):
188 $(Q)mkdir -p $@
189
190 # Dummy rule to stop make trying to rebuild removed or renamed headers
191 %.h:
192 @:
193
194 # Disable suffix rules. Most of the builtin rules are suffix rules,
195 # so this saves some time on slow systems.
196 .SUFFIXES:
197
198 .PHONY: all all-yes alltools build check config testprogs
199 .PHONY: *clean install* uninstall*