Add new yuv444 pixfmts to avcodec_align_dimensions2
[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
23IFLAGS := -I. -I$(SRC_PATH)
24CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
25CFLAGS += $(ECFLAGS)
bc877faf 26CCFLAGS = $(CFLAGS)
bb524924
MR
27YASMFLAGS += $(IFLAGS) -Pconfig.asm
28HOSTCFLAGS += $(IFLAGS)
29
bc877faf
MR
30define COMPILE
31 $($(1)DEP)
32 $($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $<
33endef
34
35COMPILE_C = $(call COMPILE,CC)
36COMPILE_S = $(call COMPILE,AS)
37
bb524924 38%.o: %.c
bc877faf 39 $(COMPILE_C)
bb524924
MR
40
41%.o: %.S
bc877faf 42 $(COMPILE_S)
bb524924
MR
43
44%.ho: %.h
45 $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
46
47%.ver: %.v
48 $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
49
50%.c %.h: TAG = GEN
51
bde51e6a
JR
52PROGS-$(CONFIG_FFMPEG) += ffmpeg
53PROGS-$(CONFIG_FFPLAY) += ffplay
336ce917 54PROGS-$(CONFIG_FFPROBE) += ffprobe
bde51e6a
JR
55PROGS-$(CONFIG_FFSERVER) += ffserver
56
583fcb52 57PROGS := $(PROGS-yes:%=%$(EXESUF))
583fcb52 58OBJS = $(PROGS-yes:%=%.o) cmdutils.o
cd6a5a57 59TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws graph2dot lavfi-showfiltfmts pktdumper probetest qt-faststart trasher))
3d157bf3
MR
60TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
61HOSTPROGS := $(TESTTOOLS:%=tests/%)
bde51e6a 62
336ce917 63BASENAMES = ffmpeg ffplay ffprobe ffserver
583fcb52 64ALLPROGS = $(BASENAMES:%=%$(EXESUF))
583fcb52 65ALLMANPAGES = $(BASENAMES:%=%.1)
bde51e6a 66
cf53c486
MR
67ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
68
5a0f7131 69FFLIBS-$(CONFIG_AVDEVICE) += avdevice
bde51e6a 70FFLIBS-$(CONFIG_AVFILTER) += avfilter
5a0f7131 71FFLIBS-$(CONFIG_AVFORMAT) += avformat
97d5fa38 72FFLIBS-$(CONFIG_AVCODEC) += avcodec
bde51e6a 73FFLIBS-$(CONFIG_POSTPROC) += postproc
5a0f7131 74FFLIBS-$(CONFIG_SWSCALE) += swscale
bde51e6a 75
5a0f7131 76FFLIBS := avutil
bde51e6a 77
f038cf3c 78DATA_FILES := $(wildcard $(SRC_PATH)/ffpresets/*.ffpreset)
a1a84f69 79
9b55e2e7
MR
80SKIPHEADERS = cmdutils_common_opts.h
81
57b4a3dd 82include $(SRC_PATH)/common.mak
bde51e6a
JR
83
84FF_LDFLAGS := $(FFLDFLAGS)
85FF_EXTRALIBS := $(FFEXTRALIBS)
86FF_DEP_LIBS := $(DEP_LIBS)
87
623ffe8c 88all: $(FF_DEP_LIBS) $(PROGS)
bde51e6a 89
86601915 90config.h: .config
f038cf3c 91.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
9d0b3042
MR
92 @-tput bold 2>/dev/null
93 @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
94 @-tput sgr0 2>/dev/null
86601915 95
95f2c769 96SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
de4070b5 97 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
a7878c9f 98 HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS
bde51e6a
JR
99
100define RESET
101$(1) :=
102$(1)-yes :=
103endef
104
105define DOSUBDIR
106$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
107SUBDIR := $(1)/
57b4a3dd 108include $(SRC_PATH)/$(1)/Makefile
bde51e6a
JR
109endef
110
111$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
112
d93d7349 113ffplay.o: CFLAGS += $(SDL_CFLAGS)
e0be794a
MR
114ffplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
115ffserver$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
bde51e6a 116
6d170962 117$(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
684b28e0 118 $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 119
d93d7349
MR
120alltools: $(TOOLS)
121
2dfa3054
MR
122tools/%$(EXESUF): tools/%.o
123 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
124
2205da0d 125tools/%.o: tools/%.c
4d1156cb 126 $(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
08df7f86
MR
127
128-include $(wildcard tools/*.d)
bde51e6a 129
f038cf3c
MR
130VERSION_SH = $(SRC_PATH)/version.sh
131GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
6a53fffd 132
faa6f1c3 133.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
6a53fffd
MR
134.version: M=@
135
136version.h .version:
0853a2b4 137 $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
6a53fffd
MR
138 $(Q)touch .version
139
140# force version.sh to run whenever version might have changed
141-include .version
36798f1b 142
623ffe8c
MR
143ifdef PROGS
144install: install-progs install-data
145endif
146
147install: install-libs install-headers
d7a72d25
MR
148
149install-libs: install-libs-yes
bde51e6a 150
151c5841 151install-progs-yes:
623ffe8c
MR
152install-progs-$(CONFIG_SHARED): install-libs
153
154install-progs: install-progs-yes $(PROGS)
63611f31 155 $(Q)mkdir -p "$(BINDIR)"
fd676deb 156 $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
bde51e6a 157
a1a84f69 158install-data: $(DATA_FILES)
63611f31 159 $(Q)mkdir -p "$(DATADIR)"
fd676deb 160 $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
a1a84f69 161
f87b03b5 162uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
d3cb93b3
RP
163
164uninstall-progs:
50e10cbd 165 $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
d3cb93b3
RP
166
167uninstall-data:
50e10cbd 168 $(RM) -r "$(DATADIR)"
d3cb93b3 169
698a183e 170clean::
e0be794a 171 $(RM) $(ALLPROGS)
50e10cbd 172 $(RM) $(CLEANSUFFIXES)
50e10cbd 173 $(RM) $(TOOLS)
40321376 174 $(RM) $(CLEANSUFFIXES:%=tools/%)
bde51e6a
JR
175
176distclean::
50e10cbd 177 $(RM) $(DISTCLEANSUFFIXES)
59748689 178 $(RM) config.* .version version.h libavutil/avconfig.h
bde51e6a 179
9d0b3042 180config:
29ba0911 181 $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
0c3b2d65 182
5bab8536
DB
183check: test checkheaders
184
57b4a3dd
MR
185include $(SRC_PATH)/doc/Makefile
186include $(SRC_PATH)/tests/Makefile
d29d9ccc 187
8d853efe
MR
188# Dummy rule to stop make trying to rebuild removed or renamed headers
189%.h:
190 @:
191
192# Disable suffix rules. Most of the builtin rules are suffix rules,
193# so this saves some time on slow systems.
194.SUFFIXES:
195
f87b03b5 196.PHONY: all alltools *clean check config examples install*
698a183e 197.PHONY: testprogs uninstall*