alacdec: implement the 2-pass prediction type.
[libav.git] / Makefile
CommitLineData
bde51e6a
JR
1include config.mak
2
f038cf3c
MR
3vpath %.c $(SRC_PATH)
4vpath %.h $(SRC_PATH)
5vpath %.S $(SRC_PATH)
6vpath %.asm $(SRC_PATH)
7vpath %.v $(SRC_PATH)
8vpath %.texi $(SRC_PATH)
bde51e6a 9
bb524924
MR
10ifndef V
11Q = @
12ECHO = printf "$(1)\t%s\n" $(2)
13BRIEF = CC AS YASM AR LD HOSTCC
14SILENT = DEPCC YASMDEP RM RANLIB
15MSG = $@
16M = @$(call ECHO,$(TAG),$@);
17$(foreach VAR,$(BRIEF), \
18 $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
19$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
f038cf3c 20$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
bb524924
MR
21endif
22
371584c4
MR
23ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
24
bb524924
MR
25IFLAGS := -I. -I$(SRC_PATH)
26CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
27CFLAGS += $(ECFLAGS)
bc877faf 28CCFLAGS = $(CFLAGS)
cc73511e 29YASMFLAGS += $(IFLAGS) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
bb524924 30HOSTCFLAGS += $(IFLAGS)
371584c4 31LDFLAGS := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
bb524924 32
bc877faf
MR
33define COMPILE
34 $($(1)DEP)
35 $($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $<
36endef
37
38COMPILE_C = $(call COMPILE,CC)
39COMPILE_S = $(call COMPILE,AS)
40
bb524924 41%.o: %.c
bc877faf 42 $(COMPILE_C)
bb524924
MR
43
44%.o: %.S
bc877faf 45 $(COMPILE_S)
bb524924
MR
46
47%.ho: %.h
48 $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
49
50%.ver: %.v
51 $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
52
53%.c %.h: TAG = GEN
54
bde51e6a 55PROGS-$(CONFIG_FFMPEG) += ffmpeg
6291d7e4 56PROGS-$(CONFIG_AVCONV) += avconv
266463da 57PROGS-$(CONFIG_AVPLAY) += avplay
9e12f0bf 58PROGS-$(CONFIG_AVPROBE) += avprobe
4d58e4cb 59PROGS-$(CONFIG_AVSERVER) += avserver
bde51e6a 60
583fcb52 61PROGS := $(PROGS-yes:%=%$(EXESUF))
583fcb52 62OBJS = $(PROGS-yes:%=%.o) cmdutils.o
3d157bf3
MR
63TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
64HOSTPROGS := $(TESTTOOLS:%=tests/%)
28e1c979
MR
65TOOLS = qt-faststart trasher
66TOOLS-$(CONFIG_ZLIB) += cws2fws
bde51e6a 67
6291d7e4 68BASENAMES = ffmpeg avconv avplay avprobe avserver
583fcb52 69ALLPROGS = $(BASENAMES:%=%$(EXESUF))
583fcb52 70ALLMANPAGES = $(BASENAMES:%=%.1)
bde51e6a 71
5a0f7131 72FFLIBS-$(CONFIG_AVDEVICE) += avdevice
bde51e6a 73FFLIBS-$(CONFIG_AVFILTER) += avfilter
5a0f7131 74FFLIBS-$(CONFIG_AVFORMAT) += avformat
97d5fa38 75FFLIBS-$(CONFIG_AVCODEC) += avcodec
bde51e6a 76FFLIBS-$(CONFIG_POSTPROC) += postproc
5a0f7131 77FFLIBS-$(CONFIG_SWSCALE) += swscale
bde51e6a 78
5a0f7131 79FFLIBS := avutil
bde51e6a 80
8096fdf0 81DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
a1a84f69 82
9b55e2e7
MR
83SKIPHEADERS = cmdutils_common_opts.h
84
57b4a3dd 85include $(SRC_PATH)/common.mak
bde51e6a 86
bde51e6a
JR
87FF_EXTRALIBS := $(FFEXTRALIBS)
88FF_DEP_LIBS := $(DEP_LIBS)
89
1fef92fd 90all: $(PROGS)
bde51e6a 91
28e1c979
MR
92$(TOOLS): %$(EXESUF): %.o
93 $(LD) $(LDFLAGS) -o $@ $< $(ELIBS)
94
95tools/cws2fws$(EXESUF): ELIBS = -lz
96
86601915 97config.h: .config
f038cf3c 98.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
9d0b3042
MR
99 @-tput bold 2>/dev/null
100 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
101 @-tput sgr0 2>/dev/null
86601915 102
95f2c769 103SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
de4070b5 104 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
28e1c979 105 HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS TOOLS
bde51e6a
JR
106
107define RESET
108$(1) :=
109$(1)-yes :=
110endef
111
112define DOSUBDIR
113$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
114SUBDIR := $(1)/
57b4a3dd 115include $(SRC_PATH)/$(1)/Makefile
144904e9 116include $(SRC_PATH)/library.mak
bde51e6a
JR
117endef
118
119$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
120
266463da
AK
121avplay.o: CFLAGS += $(SDL_CFLAGS)
122avplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
4d58e4cb 123avserver$(EXESUF): LDFLAGS += $(AVSERVERLDFLAGS)
bde51e6a 124
6d170962 125$(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
ca903615 126 $(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 127
5e27ec28
MR
128OBJDIRS += tools
129
08df7f86 130-include $(wildcard tools/*.d)
bde51e6a 131
f038cf3c
MR
132VERSION_SH = $(SRC_PATH)/version.sh
133GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
6a53fffd 134
faa6f1c3 135.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
6a53fffd
MR
136.version: M=@
137
138version.h .version:
0853a2b4 139 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
6a53fffd
MR
140 $(Q)touch .version
141
142# force version.sh to run whenever version might have changed
143-include .version
36798f1b 144
623ffe8c
MR
145ifdef PROGS
146install: install-progs install-data
147endif
148
149install: install-libs install-headers
d7a72d25
MR
150
151install-libs: install-libs-yes
bde51e6a 152
151c5841 153install-progs-yes:
623ffe8c
MR
154install-progs-$(CONFIG_SHARED): install-libs
155
156install-progs: install-progs-yes $(PROGS)
63611f31 157 $(Q)mkdir -p "$(BINDIR)"
fd676deb 158 $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
bde51e6a 159
a1a84f69 160install-data: $(DATA_FILES)
63611f31 161 $(Q)mkdir -p "$(DATADIR)"
fd676deb 162 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
a1a84f69 163
f87b03b5 164uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
d3cb93b3
RP
165
166uninstall-progs:
50e10cbd 167 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
d3cb93b3
RP
168
169uninstall-data:
50e10cbd 170 $(RM) -r "$(DATADIR)"
d3cb93b3 171
698a183e 172clean::
e0be794a 173 $(RM) $(ALLPROGS)
50e10cbd 174 $(RM) $(CLEANSUFFIXES)
50e10cbd 175 $(RM) $(TOOLS)
40321376 176 $(RM) $(CLEANSUFFIXES:%=tools/%)
bde51e6a
JR
177
178distclean::
50e10cbd 179 $(RM) $(DISTCLEANSUFFIXES)
59748689 180 $(RM) config.* .version version.h libavutil/avconfig.h
bde51e6a 181
9d0b3042 182config:
29ba0911 183 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
0c3b2d65 184
57b4a3dd
MR
185include $(SRC_PATH)/doc/Makefile
186include $(SRC_PATH)/tests/Makefile
d29d9ccc 187
5e27ec28
MR
188$(sort $(OBJDIRS)):
189 $(Q)mkdir -p $@
190
8d853efe
MR
191# Dummy rule to stop make trying to rebuild removed or renamed headers
192%.h:
193 @:
194
195# Disable suffix rules. Most of the builtin rules are suffix rules,
196# so this saves some time on slow systems.
197.SUFFIXES:
198
db54be09 199.PHONY: all all-yes alltools *clean config examples install*
698a183e 200.PHONY: testprogs uninstall*