FATE: avoid channel mixing in lavf-dv_fmt
[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
b315042c 23ALLFFLIBS = avcodec avdevice avfilter avformat avutil swscale
371584c4 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
6291d7e4 55PROGS-$(CONFIG_AVCONV) += avconv
266463da 56PROGS-$(CONFIG_AVPLAY) += avplay
9e12f0bf 57PROGS-$(CONFIG_AVPROBE) += avprobe
4d58e4cb 58PROGS-$(CONFIG_AVSERVER) += avserver
bde51e6a 59
583fcb52 60PROGS := $(PROGS-yes:%=%$(EXESUF))
583fcb52 61OBJS = $(PROGS-yes:%=%.o) cmdutils.o
3d157bf3 62TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
0d0b81f9 63HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
28e1c979
MR
64TOOLS = qt-faststart trasher
65TOOLS-$(CONFIG_ZLIB) += cws2fws
bde51e6a 66
0fec2cb1 67BASENAMES = avconv avplay avprobe avserver
583fcb52 68ALLPROGS = $(BASENAMES:%=%$(EXESUF))
583fcb52 69ALLMANPAGES = $(BASENAMES:%=%.1)
bde51e6a 70
5a0f7131 71FFLIBS-$(CONFIG_AVDEVICE) += avdevice
bde51e6a 72FFLIBS-$(CONFIG_AVFILTER) += avfilter
5a0f7131 73FFLIBS-$(CONFIG_AVFORMAT) += avformat
97d5fa38 74FFLIBS-$(CONFIG_AVCODEC) += avcodec
5a0f7131 75FFLIBS-$(CONFIG_SWSCALE) += swscale
bde51e6a 76
5a0f7131 77FFLIBS := avutil
bde51e6a 78
8096fdf0 79DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
a1a84f69 80
9b55e2e7
MR
81SKIPHEADERS = cmdutils_common_opts.h
82
57b4a3dd 83include $(SRC_PATH)/common.mak
bde51e6a 84
bde51e6a
JR
85FF_EXTRALIBS := $(FFEXTRALIBS)
86FF_DEP_LIBS := $(DEP_LIBS)
87
1fef92fd 88all: $(PROGS)
bde51e6a 89
28e1c979
MR
90$(TOOLS): %$(EXESUF): %.o
91 $(LD) $(LDFLAGS) -o $@ $< $(ELIBS)
92
93tools/cws2fws$(EXESUF): ELIBS = -lz
94
86601915 95config.h: .config
f038cf3c 96.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
9d0b3042
MR
97 @-tput bold 2>/dev/null
98 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
99 @-tput sgr0 2>/dev/null
86601915 100
e7e19b15 101SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
ad0e31f1 102 ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
7bb3a302
DB
103 ALTIVEC-OBJS ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS MMI-OBJS \
104 MMX-OBJS NEON-OBJS VIS-OBJS YASM-OBJS \
ad0e31f1 105 OBJS TESTOBJS
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
07a873a2 116-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
144904e9 117include $(SRC_PATH)/library.mak
bde51e6a
JR
118endef
119
120$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
121
266463da
AK
122avplay.o: CFLAGS += $(SDL_CFLAGS)
123avplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
4d58e4cb 124avserver$(EXESUF): LDFLAGS += $(AVSERVERLDFLAGS)
bde51e6a 125
6d170962 126$(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
ca903615 127 $(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 128
5e27ec28
MR
129OBJDIRS += tools
130
08df7f86 131-include $(wildcard tools/*.d)
bde51e6a 132
f038cf3c
MR
133VERSION_SH = $(SRC_PATH)/version.sh
134GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
6a53fffd 135
faa6f1c3 136.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
6a53fffd
MR
137.version: M=@
138
139version.h .version:
0853a2b4 140 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
6a53fffd
MR
141 $(Q)touch .version
142
143# force version.sh to run whenever version might have changed
144-include .version
36798f1b 145
623ffe8c
MR
146ifdef PROGS
147install: install-progs install-data
148endif
149
150install: install-libs install-headers
d7a72d25
MR
151
152install-libs: install-libs-yes
bde51e6a 153
151c5841 154install-progs-yes:
623ffe8c
MR
155install-progs-$(CONFIG_SHARED): install-libs
156
157install-progs: install-progs-yes $(PROGS)
63611f31 158 $(Q)mkdir -p "$(BINDIR)"
fd676deb 159 $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
bde51e6a 160
a1a84f69 161install-data: $(DATA_FILES)
63611f31 162 $(Q)mkdir -p "$(DATADIR)"
fd676deb 163 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
a1a84f69 164
f87b03b5 165uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
d3cb93b3
RP
166
167uninstall-progs:
50e10cbd 168 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
d3cb93b3
RP
169
170uninstall-data:
50e10cbd 171 $(RM) -r "$(DATADIR)"
d3cb93b3 172
698a183e 173clean::
e0be794a 174 $(RM) $(ALLPROGS)
50e10cbd 175 $(RM) $(CLEANSUFFIXES)
50e10cbd 176 $(RM) $(TOOLS)
40321376 177 $(RM) $(CLEANSUFFIXES:%=tools/%)
bde51e6a
JR
178
179distclean::
50e10cbd 180 $(RM) $(DISTCLEANSUFFIXES)
59748689 181 $(RM) config.* .version version.h libavutil/avconfig.h
bde51e6a 182
9d0b3042 183config:
29ba0911 184 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
0c3b2d65 185
57b4a3dd
MR
186include $(SRC_PATH)/doc/Makefile
187include $(SRC_PATH)/tests/Makefile
d29d9ccc 188
5e27ec28
MR
189$(sort $(OBJDIRS)):
190 $(Q)mkdir -p $@
191
8d853efe
MR
192# Dummy rule to stop make trying to rebuild removed or renamed headers
193%.h:
194 @:
195
196# Disable suffix rules. Most of the builtin rules are suffix rules,
197# so this saves some time on slow systems.
198.SUFFIXES:
199
db54be09 200.PHONY: all all-yes alltools *clean config examples install*
698a183e 201.PHONY: testprogs uninstall*