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