checkasm: aarch64: Add filler args to make sure all parameters are passed on the...
[libav.git] / Makefile
CommitLineData
bde51e6a
JR
1include config.mak
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)
095792f2 14BRIEF = CC HOSTCC HOSTLD AS YASM AR LD
c7f25d4c 15SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM 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)
04581c8c 33YASMFLAGS += $(IFLAGS:%=%/) -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)
ad477710 45COMPILE_HOSTC = $(call COMPILE,HOSTCC)
bc877faf 46
bb524924 47%.o: %.c
bc877faf 48 $(COMPILE_C)
bb524924
MR
49
50%.o: %.S
bc877faf 51 $(COMPILE_S)
bb524924 52
9f57f134
LB
53%.o: %.m
54 $(COMPILE_M)
55
5a9fcc7d
DB
56%_host.o: %.c
57 $(COMPILE_HOSTC)
58
c2626492
MR
59%.i: %.c
60 $(CC) $(CCFLAGS) $(CC_E) $<
61
dfd9159f
MR
62%.h.c:
63 $(Q)echo '#include "$*.h"' >$@
bb524924 64
5b1b495c 65%.c %.h %.ver: TAG = GEN
bb524924 66
14abeaa4
DB
67AVPROGS-$(CONFIG_AVCONV) += avconv
68AVPROGS-$(CONFIG_AVPLAY) += avplay
69AVPROGS-$(CONFIG_AVPROBE) += avprobe
bde51e6a 70
14abeaa4
DB
71AVPROGS := $(AVPROGS-yes:%=%$(EXESUF))
72PROGS += $(AVPROGS)
7671dd7c 73
894682a9 74AVBASENAMES = avconv avplay avprobe
14abeaa4
DB
75ALLAVPROGS = $(AVBASENAMES:%=%$(EXESUF))
76
dc80e2f7 77$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o))
14abeaa4
DB
78
79OBJS-avconv += avconv_opt.o avconv_filter.o
fb472e1a 80OBJS-avconv-$(CONFIG_LIBMFX) += avconv_qsv.o
5d273d3e 81OBJS-avconv-$(CONFIG_VAAPI) += avconv_vaapi.o
01621202
DB
82OBJS-avconv-$(CONFIG_VDA) += avconv_vda.o
83OBJS-avconv-$(HAVE_DXVA2_LIB) += avconv_dxva2.o
84OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o
7671dd7c 85
3d157bf3 86TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
0d0b81f9 87HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
28e1c979
MR
88TOOLS = qt-faststart trasher
89TOOLS-$(CONFIG_ZLIB) += cws2fws
bde51e6a 90
5e2ba41d
JG
91# $(FFLIBS-yes) needs to be in linking order
92FFLIBS-$(CONFIG_AVDEVICE) += avdevice
93FFLIBS-$(CONFIG_AVFILTER) += avfilter
94FFLIBS-$(CONFIG_AVFORMAT) += avformat
95FFLIBS-$(CONFIG_AVCODEC) += avcodec
c8af852b 96FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
5e2ba41d 97FFLIBS-$(CONFIG_SWSCALE) += swscale
bde51e6a 98
5a0f7131 99FFLIBS := avutil
bde51e6a 100
8096fdf0 101DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
a1a84f69 102
01621202
DB
103SKIPHEADERS = cmdutils_common_opts.h \
104 compat/w32pthreads.h
9b55e2e7 105
57b4a3dd 106include $(SRC_PATH)/common.mak
bde51e6a 107
bde51e6a
JR
108FF_EXTRALIBS := $(FFEXTRALIBS)
109FF_DEP_LIBS := $(DEP_LIBS)
3ae0e721 110FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
bde51e6a 111
14abeaa4 112all: $(AVPROGS)
bde51e6a 113
80521c19 114$(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
bb0babd7 115 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS)
28e1c979 116
7baa115a 117tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
28e1c979 118
86601915 119config.h: .config
f038cf3c 120.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
9d0b3042
MR
121 @-tput bold 2>/dev/null
122 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
123 @-tput sgr0 2>/dev/null
86601915 124
e7e19b15 125SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
121604b0 126 HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
8675bcb0 127 ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
b4dd424d 128 ALTIVEC-OBJS MMX-OBJS YASM-OBJS \
24d3796d 129 OBJS HOSTOBJS TESTOBJS
bde51e6a
JR
130
131define RESET
132$(1) :=
133$(1)-yes :=
134endef
135
136define DOSUBDIR
137$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
138SUBDIR := $(1)/
57b4a3dd 139include $(SRC_PATH)/$(1)/Makefile
07a873a2 140-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
d45ebd48 141-include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
144904e9 142include $(SRC_PATH)/library.mak
bde51e6a
JR
143endef
144
145$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
146
ab81f24a
DB
147include $(SRC_PATH)/doc/Makefile
148
baac24e6 149define DOPROG
14abeaa4 150OBJS-$(1) += $(1).o $(EXEOBJS) $(OBJS-$(1)-yes)
07b3790d 151$(1)$(EXESUF): $$(OBJS-$(1))
baac24e6
MR
152$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
153$(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
154$(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
155-include $$(OBJS-$(1):.o=.d)
156endef
157
dc80e2f7 158$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(EXESUF)=))))
bde51e6a 159
07b3790d 160$(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
bb0babd7 161 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
bde51e6a 162
5e27ec28
MR
163OBJDIRS += tools
164
08df7f86 165-include $(wildcard tools/*.d)
bde51e6a 166
f038cf3c
MR
167VERSION_SH = $(SRC_PATH)/version.sh
168GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
6a53fffd 169
faa6f1c3 170.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
6a53fffd
MR
171.version: M=@
172
1316df7a 173avversion.h .version:
174 $(M)$(VERSION_SH) $(SRC_PATH) avversion.h $(EXTRA_VERSION)
6a53fffd
MR
175 $(Q)touch .version
176
177# force version.sh to run whenever version might have changed
178-include .version
36798f1b 179
14abeaa4 180ifdef AVPROGS
623ffe8c
MR
181install: install-progs install-data
182endif
183
184install: install-libs install-headers
d7a72d25
MR
185
186install-libs: install-libs-yes
bde51e6a 187
151c5841 188install-progs-yes:
623ffe8c
MR
189install-progs-$(CONFIG_SHARED): install-libs
190
14abeaa4 191install-progs: install-progs-yes $(AVPROGS)
63611f31 192 $(Q)mkdir -p "$(BINDIR)"
14abeaa4 193 $(INSTALL) -c -m 755 $(AVPROGS) "$(BINDIR)"
bde51e6a 194
a1a84f69 195install-data: $(DATA_FILES)
63611f31 196 $(Q)mkdir -p "$(DATADIR)"
fd676deb 197 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
a1a84f69 198
f87b03b5 199uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
d3cb93b3
RP
200
201uninstall-progs:
14abeaa4 202 $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
d3cb93b3
RP
203
204uninstall-data:
50e10cbd 205 $(RM) -r "$(DATADIR)"
d3cb93b3 206
698a183e 207clean::
14abeaa4 208 $(RM) $(ALLAVPROGS)
50e10cbd 209 $(RM) $(CLEANSUFFIXES)
40321376 210 $(RM) $(CLEANSUFFIXES:%=tools/%)
a862c7d3 211 $(RM) -rf coverage.info lcov
bde51e6a
JR
212
213distclean::
50e10cbd 214 $(RM) $(DISTCLEANSUFFIXES)
06edef3d 215 $(RM) config.* .config libavutil/avconfig.h .version avversion.h \
6641819f 216 mapfile libavcodec/bsf_list.c libavformat/protocol_list.c
bde51e6a 217
9d0b3042 218config:
29ba0911 219 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
0c3b2d65 220
4982e1dd
DB
221check: all alltools checkheaders examples testprogs fate
222
57b4a3dd 223include $(SRC_PATH)/tests/Makefile
d29d9ccc 224
5e27ec28
MR
225$(sort $(OBJDIRS)):
226 $(Q)mkdir -p $@
227
8d853efe
MR
228# Dummy rule to stop make trying to rebuild removed or renamed headers
229%.h:
230 @:
231
232# Disable suffix rules. Most of the builtin rules are suffix rules,
233# so this saves some time on slow systems.
234.SUFFIXES:
235
4982e1dd 236.PHONY: all all-yes alltools check *clean config examples install*
698a183e 237.PHONY: testprogs uninstall*