use left_xy[1] in mbaff QP loop filter check, this improves the amount that can
[libav.git] / Makefile
CommitLineData
bde51e6a
JR
1include config.mak
2
3SRC_DIR = $(SRC_PATH_BARE)
4
5vpath %.texi $(SRC_PATH_BARE)
6
7PROGS-$(CONFIG_FFMPEG) += ffmpeg
8PROGS-$(CONFIG_FFPLAY) += ffplay
9PROGS-$(CONFIG_FFSERVER) += ffserver
10
00962aba 11PROGS := $(addsuffix $(EXESUF), $(PROGS-yes))
bde51e6a
JR
12PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
13OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
14MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
94f3c0e5 15TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
de4070b5 16HOSTPROGS = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
bde51e6a
JR
17
18BASENAMES = ffmpeg ffplay ffserver
19ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
20ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
21ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
22
23FFLIBS-$(CONFIG_AVFILTER) += avfilter
24FFLIBS-$(CONFIG_POSTPROC) += postproc
bde51e6a 25
6d4f53cb 26FFLIBS := avdevice avformat avcodec avutil swscale
bde51e6a 27
a1a84f69
RS
28DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
29
bde51e6a
JR
30include common.mak
31
32FF_LDFLAGS := $(FFLDFLAGS)
33FF_EXTRALIBS := $(FFEXTRALIBS)
34FF_DEP_LIBS := $(DEP_LIBS)
35
c73f65d9 36ALL_TARGETS-$(CONFIG_DOC) += documentation
bde51e6a 37
a48289c7 38ifdef PROGS
a1a84f69 39INSTALL_TARGETS-yes += install-progs install-data
c73f65d9 40INSTALL_TARGETS-$(CONFIG_DOC) += install-man
bde51e6a 41endif
bea81a52 42INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
bde51e6a
JR
43
44all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
45
46$(PROGS): %$(EXESUF): %_g$(EXESUF)
47 cp -p $< $@
48 $(STRIP) $@
49
95f2c769 50SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
de4070b5 51 ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
aa310a9f 52 HOSTPROGS BUILT_HEADERS
bde51e6a
JR
53
54define RESET
55$(1) :=
56$(1)-yes :=
57endef
58
59define DOSUBDIR
60$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
61SUBDIR := $(1)/
62include $(1)/Makefile
63endef
64
65$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
66
67ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
68ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
69
70%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
684b28e0 71 $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
bde51e6a 72
2dfa3054
MR
73tools/%$(EXESUF): tools/%.o
74 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
75
2205da0d 76tools/%.o: tools/%.c
2dfa3054 77 $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
bde51e6a
JR
78
79ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
80
36798f1b
MR
81cmdutils.o cmdutils.d: version.h
82
13b1c80b 83alltools: $(TOOLS)
9bce82fa 84
15674f12
DB
85documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
86 ffplay-doc.html ffserver-doc.html \
dba755fa 87 general.html libavfilter.html $(ALLMANPAGES))
bde51e6a
JR
88
89doc/%.html: doc/%.texi
90 texi2html -monolithic -number $<
91 mv $(@F) $@
92
93doc/%.pod: doc/%-doc.texi
94 doc/texi2pod.pl $< $@
95
96doc/%.1: doc/%.pod
97 pod2man --section=1 --center=" " --release=" " $< > $@
98
99install: $(INSTALL_TARGETS-yes)
100
101install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
102 install -d "$(BINDIR)"
103 install -c -m 755 $(PROGS) "$(BINDIR)"
104
a1a84f69
RS
105install-data: $(DATA_FILES)
106 install -d "$(DATADIR)"
107 install -m 644 $(DATA_FILES) "$(DATADIR)"
108
bde51e6a
JR
109install-man: $(MANPAGES)
110 install -d "$(MANDIR)/man1"
111 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
112
93fe7eb6
RP
113uninstall:
114 @echo "I'm sorry, Dave. I'm afraid I can't do that"
bde51e6a 115
250dd6f0 116testclean:
d7167f05 117 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/*~
250dd6f0
FC
118
119clean:: testclean
219a7185 120 rm -f $(ALLPROGS) $(ALLPROGS_G)
2b7a351e 121 rm -f $(CLEANSUFFIXES)
bde51e6a 122 rm -f doc/*.html doc/*.pod doc/*.1
4e67aedd 123 rm -f tests/seek_test$(EXESUF) tests/seek_test.o
82bb3329 124 rm -f $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
13b1c80b 125 rm -f $(TOOLS)
bde51e6a
JR
126
127distclean::
2b7a351e 128 rm -f $(DISTCLEANSUFFIXES)
fdf11906 129 rm -f version.h config.*
bde51e6a 130
0c3b2d65
MR
131config:
132 $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
133
bde51e6a
JR
134# regression tests
135
5bab8536
DB
136check: test checkheaders
137
1cde611d 138fulltest test: codectest lavftest seektest
bde51e6a 139
bde51e6a 140FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
bde51e6a
JR
141SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
142
05e24fa8
MR
143ENCDEC = $(and $(CONFIG_$(1)_ENCODER),$(CONFIG_$(1)_DECODER))
144MUXDEM = $(and $(CONFIG_$(1)_MUXER),$(CONFIG_$(or $(2),$(1))_DEMUXER))
145
146CODEC_TESTS =
147CODEC_TESTS-$(call ENCDEC,AC3) += ac3
148CODEC_TESTS-$(call ENCDEC,ADPCM_G726) += g726
149CODEC_TESTS-$(call ENCDEC,ADPCM_IMA_QT) += adpcm_ima_qt
150CODEC_TESTS-$(call ENCDEC,ADPCM_IMA_WAV) += adpcm_ima_wav
151CODEC_TESTS-$(call ENCDEC,ADPCM_MS) += adpcm_ms
152CODEC_TESTS-$(call ENCDEC,ADPCM_SWF) += adpcm_swf
153CODEC_TESTS-$(call ENCDEC,ADPCM_YAMAHA) += adpcm_yam
154CODEC_TESTS-$(call ENCDEC,ALAC) += alac
155CODEC_TESTS-$(call ENCDEC,ASV1) += asv1
156CODEC_TESTS-$(call ENCDEC,ASV2) += asv2
157CODEC_TESTS-$(call ENCDEC,DNXHD) += dnxhd_1080i dnxhd_720p dnxhd_720p_rd
158CODEC_TESTS-$(call ENCDEC,DVVIDEO) += dv dv50
159CODEC_TESTS-$(call ENCDEC,FFV1) += ffv1
160CODEC_TESTS-$(call ENCDEC,FLAC) += flac
161CODEC_TESTS-$(call ENCDEC,FLASHSV) += flashsv
162CODEC_TESTS-$(call ENCDEC,FLV) += flv
163CODEC_TESTS-$(call ENCDEC,H261) += h261
164CODEC_TESTS-$(call ENCDEC,H263) += h263 h263p
165CODEC_TESTS-$(call ENCDEC,HUFFYUV) += huffyuv
166CODEC_TESTS-$(call ENCDEC,JPEGLS) += jpegls
167CODEC_TESTS-$(call ENCDEC,MJPEG) += mjpeg ljpeg
168CODEC_TESTS-$(call ENCDEC,MP2) += mp2
169CODEC_TESTS-$(call ENCDEC,MPEG1VIDEO) += mpeg mpeg1b
170CODEC_TESTS-$(call ENCDEC,MPEG2VIDEO) += mpeg2 mpeg2thread
171CODEC_TESTS-$(call ENCDEC,MPEG4) += mpeg4 mpeg4adv mpeg4nr mpeg4thread error rc
172CODEC_TESTS-$(call ENCDEC,MSMPEG4V1) += msmpeg4
173CODEC_TESTS-$(call ENCDEC,MSMPEG4V2) += msmpeg4v2
174CODEC_TESTS-$(call ENCDEC,PCM_S16LE) += pcm # fixme
175CODEC_TESTS-$(call ENCDEC,ROQ) += roq
176CODEC_TESTS-$(call ENCDEC,RV10) += rv10
177CODEC_TESTS-$(call ENCDEC,RV20) += rv20
178CODEC_TESTS-$(call ENCDEC,SNOW) += snow snowll
179CODEC_TESTS-$(call ENCDEC,SVQ1) += svq1
180CODEC_TESTS-$(call ENCDEC,WMAV1) += wmav1
181CODEC_TESTS-$(call ENCDEC,WMAV1) += wmav2
182CODEC_TESTS-$(call ENCDEC,WMV1) += wmv1
183CODEC_TESTS-$(call ENCDEC,WMV2) += wmv2
184
185LAVF_TESTS =
186LAVF_TESTS-$(call MUXDEM,AIFF) += aiff
187LAVF_TESTS-$(call MUXDEM,PCM_ALAW) += alaw
188LAVF_TESTS-$(call MUXDEM,ASF) += asf
189LAVF_TESTS-$(call MUXDEM,AU) += au
190LAVF_TESTS-$(call MUXDEM,AVI) += avi
191LAVF_TESTS-$(call ENCDEC,BMP) += bmp
192LAVF_TESTS-$(call MUXDEM,DV) += dv_fmt
193LAVF_TESTS-$(call MUXDEM,FFM) += ffm
194LAVF_TESTS-$(call MUXDEM,FLV) += flv_fmt
195LAVF_TESTS-$(call ENCDEC,GIF) += gif
196LAVF_TESTS-$(call MUXDEM,GXF) += gxf
197LAVF_TESTS-$(call ENCDEC,MJPEG) += jpg
198LAVF_TESTS-$(call MUXDEM,MATROSKA) += mkv
199LAVF_TESTS-$(call MUXDEM,MMF) += mmf
200LAVF_TESTS-$(call MUXDEM,MOV) += mov
201LAVF_TESTS-$(call MUXDEM,MPEG1SYSTEM,MPEGPS) += mpg
202LAVF_TESTS-$(call MUXDEM,PCM_MULAW) += mulaw
203LAVF_TESTS-$(call MUXDEM,MXF) += mxf
204LAVF_TESTS-$(call MUXDEM,NUT) += nut
205LAVF_TESTS-$(call MUXDEM,OGG) += ogg
206LAVF_TESTS-$(call ENCDEC,PBM) += pbmpipe
207LAVF_TESTS-$(call ENCDEC,PCX) += pcx
208LAVF_TESTS-$(call ENCDEC,PGM) += pgm pgmpipe
209LAVF_TESTS-$(call MUXDEM,RAWVIDEO) += pixfmt
210LAVF_TESTS-$(call ENCDEC,PPM) += ppm ppmpipe
211LAVF_TESTS-$(call MUXDEM,RM) += rm
212LAVF_TESTS-$(call ENCDEC,SGI) += sgi
213LAVF_TESTS-$(call MUXDEM,SWF) += swf
214LAVF_TESTS-$(call ENCDEC,TARGA) += tga
215LAVF_TESTS-$(call ENCDEC,TIFF) += tiff
216LAVF_TESTS-$(call MUXDEM,MPEGTS) += ts
217LAVF_TESTS-$(call MUXDEM,VOC) += voc
218LAVF_TESTS-$(call MUXDEM,WAV) += wav
219LAVF_TESTS-$(call MUXDEM,YUV4MPEGPIPE) += yuv4mpeg
220
221LAVFI_TESTS =
222
223CODEC_TESTS := $(addprefix regtest-, $(CODEC_TESTS) $(CODEC_TESTS-yes))
224LAVF_TESTS := $(addprefix regtest-, $(LAVF_TESTS) $(LAVF_TESTS-yes))
225LAVFI_TESTS := $(addprefix regtest-, $(LAVFI_TESTS) $(LAVFI_TESTS-yes))
20a93972 226
eca478c3
MR
227codectest: $(CODEC_TESTS)
228lavftest: $(LAVF_TESTS)
bde51e6a 229
eca478c3 230# lavfitest: $(LAVFI_TESTS)
40e02409 231
eca478c3 232$(CODEC_TESTS) $(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
bde51e6a 233
eca478c3
MR
234REFFILE = $(SRC_PATH)/tests/ref/$(1)/$(2:regtest-%=%)
235RESFILE = tests/data/$(2:regtest-%=%).$(1).regression
bde51e6a 236
eca478c3
MR
237define CODECTEST_CMD
238 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth1 tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
239 $(SRC_PATH)/tests/codec-regression.sh $@ vsynth2 tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
240endef
bde51e6a 241
d7167f05 242regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/data/asynth1.sw
eca478c3 243 $(CODECTEST_CMD)
bde51e6a 244
eca478c3
MR
245$(CODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
246 @echo "TEST CODEC $(@:regtest-%=%)"
247 @$(CODECTEST_CMD)
248 @diff -u -w $(call REFFILE,vsynth1,$@) $(call RESFILE,vsynth1,$@)
249 @diff -u -w $(call REFFILE,vsynth2,$@) $(call RESFILE,vsynth2,$@)
bde51e6a
JR
250
251$(LAVF_TESTS):
eca478c3
MR
252 @echo "TEST LAVF $(@:regtest-%=%)"
253 @$(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
254 @diff -u -w $(call REFFILE,lavf,$@) $(call RESFILE,lavf,$@)
bde51e6a 255
40e02409 256$(LAVFI_TESTS):
eca478c3
MR
257 @echo "TEST LAVFI $(@:regtest-%=%)"
258 @$(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
259 @diff -u -w $(call REFFILE,lavfi,$@) $(call RESFILE,lavfi,$@)
40e02409 260
1cde611d 261seektest: codectest lavftest tests/seek_test$(EXESUF)
62cb577e 262 $(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
bde51e6a 263
d7167f05 264ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
bde51e6a
JR
265 @echo
266 @echo "Unfortunately ffserver is broken and therefore its regression"
267 @echo "test fails randomly. Treat the results accordingly."
268 @echo
767e14c3 269 $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
bde51e6a 270
82bb3329 271tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
bde51e6a
JR
272 mkdir -p tests/vsynth1
273 $(BUILD_ROOT)/$< 'tests/vsynth1/'
274
82bb3329 275tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
bde51e6a
JR
276 mkdir -p tests/vsynth2
277 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
278
d7167f05
DB
279tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
280 mkdir -p tests/data
bde51e6a
JR
281 $(BUILD_ROOT)/$< $@
282
684b28e0
MR
283tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
284 $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
bde51e6a
JR
285
286
0c3b2d65 287.PHONY: documentation *test regtest-* zlib-error alltools check config