hevc: Add names for reserved NAL unit types
[libav.git] / Makefile
CommitLineData
11a9320d 1include avbuild/config.mak
bde51e6a 2
f038cf3c 3vpath %.c $(SRC_PATH)
9f57f134 4vpath %.m $(SRC_PATH)
f038cf3c
MR
5vpath %.h $(SRC_PATH)
6vpath %.S $(SRC_PATH)
7vpath %.asm $(SRC_PATH)
8vpath %.v $(SRC_PATH)
9vpath %.texi $(SRC_PATH)
bde51e6a 10
bb524924
MR
11ifndef V
12Q = @
13ECHO = printf "$(1)\t%s\n" $(2)
39e208f4
DB
14BRIEF = CC HOSTCC HOSTLD AS X86ASM AR LD
15SILENT = DEPCC DEPHOSTCC DEPAS DEPX86ASM RANLIB RM STRIP
bb524924
MR
16MSG = $@
17M = @$(call ECHO,$(TAG),$@);
18$(foreach VAR,$(BRIEF), \
19 $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
20$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
f038cf3c 21$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
bb524924
MR
22endif
23
c8af852b 24ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil swscale
371584c4 25
bb524924
MR
26IFLAGS := -I. -I$(SRC_PATH)
27CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
28CFLAGS += $(ECFLAGS)
a758c5e2 29CCFLAGS = $(CPPFLAGS) $(CFLAGS)
9f57f134
LB
30OBJCFLAGS += $(EOBJCFLAGS)
31OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
a758c5e2 32ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
3c0efbd0 33X86ASMFLAGS += $(IFLAGS:%=%/) -I$(<D)/ -Pconfig.asm
4cc4b33f 34HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
8db73c61 35LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
bb524924 36
bc877faf 37define COMPILE
a758c5e2 38 $(call $(1)DEP,$(1))
23565c26 39 $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
bc877faf
MR
40endef
41
42COMPILE_C = $(call COMPILE,CC)
43COMPILE_S = $(call COMPILE,AS)
9f57f134 44COMPILE_M = $(call COMPILE,OBJCC)
3c0efbd0 45COMPILE_X86ASM = $(call COMPILE,X86ASM)
ad477710 46COMPILE_HOSTC = $(call COMPILE,HOSTCC)
bc877faf 47
bb524924 48%.o: %.c
bc877faf 49 $(COMPILE_C)
bb524924
MR
50
51%.o: %.S
bc877faf 52 $(COMPILE_S)
bb524924 53
9f57f134
LB
54%.o: %.m
55 $(COMPILE_M)
56
5a9fcc7d
DB
57%_host.o: %.c
58 $(COMPILE_HOSTC)
59
93d5b022 60%.o: %.asm
3c0efbd0 61 $(COMPILE_X86ASM)
93d5b022
DB
62 -$(STRIP) $(STRIPFLAGS) $@
63
c2626492
MR
64%.i: %.c
65 $(CC) $(CCFLAGS) $(CC_E) $<
66
dfd9159f
MR
67%.h.c:
68 $(Q)echo '#include "$*.h"' >$@
bb524924 69
92db5083 70%.c %.h %.pc %.ver %.version: TAG = GEN
bb524924 71
3d157bf3 72TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
0d0b81f9 73HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
bde51e6a 74
5e2ba41d
JG
75# $(FFLIBS-yes) needs to be in linking order
76FFLIBS-$(CONFIG_AVDEVICE) += avdevice
77FFLIBS-$(CONFIG_AVFILTER) += avfilter
78FFLIBS-$(CONFIG_AVFORMAT) += avformat
79FFLIBS-$(CONFIG_AVCODEC) += avcodec
c8af852b 80FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
5e2ba41d 81FFLIBS-$(CONFIG_SWSCALE) += swscale
bde51e6a 82
5a0f7131 83FFLIBS := avutil
bde51e6a 84
8096fdf0 85DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
a1a84f69 86
122de16d 87SKIPHEADERS = compat/w32pthreads.h
9b55e2e7 88
c833c203
DB
89# first so "all" becomes default target
90all: all-yes
91
3e105d08 92include $(SRC_PATH)/tools/Makefile
11a9320d 93include $(SRC_PATH)/avbuild/common.mak
bde51e6a 94
bde51e6a
JR
95FF_EXTRALIBS := $(FFEXTRALIBS)
96FF_DEP_LIBS := $(DEP_LIBS)
3ae0e721 97FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
bde51e6a 98
3794062a 99$(TOOLS): %$(EXESUF): %.o
7cb1d9e2 100 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS-$(*F)) $(EXTRALIBS) $(ELIBS)
28e1c979 101
7c9e2b29
AK
102CONFIGURABLE_COMPONENTS = \
103 $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \
104 $(SRC_PATH)/libavcodec/bitstream_filters.c \
105 $(SRC_PATH)/libavformat/protocols.c \
106
11a9320d
DB
107config.h: avbuild/.config
108avbuild/.config: $(CONFIGURABLE_COMPONENTS)
9d0b3042 109 @-tput bold 2>/dev/null
4104cc56 110 @-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
9d0b3042 111 @-tput sgr0 2>/dev/null
86601915 112
533339bd 113SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
121604b0 114 HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
8675bcb0 115 ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
39e208f4 116 ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
24d3796d 117 OBJS HOSTOBJS TESTOBJS
bde51e6a
JR
118
119define RESET
120$(1) :=
121$(1)-yes :=
122endef
123
124define DOSUBDIR
125$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
126SUBDIR := $(1)/
57b4a3dd 127include $(SRC_PATH)/$(1)/Makefile
07a873a2 128-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
d45ebd48 129-include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
11a9320d 130include $(SRC_PATH)/avbuild/library.mak
bde51e6a
JR
131endef
132
133$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
134
c95169f0 135include $(SRC_PATH)/avtools/Makefile
ab81f24a 136include $(SRC_PATH)/doc/Makefile
acb0dea2 137include $(SRC_PATH)/doc/examples/Makefile
ab81f24a 138
c95169f0 139$(PROGS): %$(EXESUF): $(FF_DEP_LIBS)
bb0babd7 140 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
bde51e6a 141
11a9320d 142VERSION_SH = $(SRC_PATH)/avbuild/version.sh
f038cf3c 143GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
6a53fffd 144
11a9320d 145.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) avbuild/config.mak
6a53fffd
MR
146.version: M=@
147
c95169f0 148libavutil/utils.o: avversion.h
1316df7a 149avversion.h .version:
150 $(M)$(VERSION_SH) $(SRC_PATH) avversion.h $(EXTRA_VERSION)
6a53fffd
MR
151 $(Q)touch .version
152
153# force version.sh to run whenever version might have changed
154-include .version
36798f1b 155
623ffe8c 156install: install-libs install-headers
d7a72d25
MR
157
158install-libs: install-libs-yes
bde51e6a 159
a1a84f69 160install-data: $(DATA_FILES)
63611f31 161 $(Q)mkdir -p "$(DATADIR)"
fd676deb 162 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
a1a84f69 163
c95169f0 164uninstall: uninstall-libs uninstall-headers uninstall-data
d3cb93b3
RP
165
166uninstall-data:
50e10cbd 167 $(RM) -r "$(DATADIR)"
d3cb93b3 168
698a183e 169clean::
50e10cbd 170 $(RM) $(CLEANSUFFIXES)
a862c7d3 171 $(RM) -rf coverage.info lcov
bde51e6a
JR
172
173distclean::
50e10cbd 174 $(RM) $(DISTCLEANSUFFIXES)
11a9320d
DB
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
bde51e6a 178
9d0b3042 179config:
29ba0911 180 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
0c3b2d65 181
d1d6230e 182build: all alltools checkheaders examples testprogs
4982e1dd
DB
183check: all alltools checkheaders examples testprogs fate
184
57b4a3dd 185include $(SRC_PATH)/tests/Makefile
d29d9ccc 186
5e27ec28
MR
187$(sort $(OBJDIRS)):
188 $(Q)mkdir -p $@
189
8d853efe
MR
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
d1d6230e
DB
198.PHONY: all all-yes alltools build check config testprogs
199.PHONY: *clean install* uninstall*