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