get seek regression test filenames from reference file
[libav.git] / Makefile
CommitLineData
a1b63811 1#
85f07f22 2# Main ffmpeg Makefile
38100e8c 3# (c) 2000-2004 Fabrice Bellard
85f07f22 4#
980fc7b8 5include config.mak
85f07f22 6
997baf01 7VPATH=$(SRC_PATH_BARE)
dd9ca370 8
cbeee4d8 9CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
a163ed1a 10 -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
c721d803 11 -I$(SRC_PATH)/libavdevice \
364a9607 12 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -DHAVE_AV_CONFIG_H
115329f1 13LDFLAGS+= -g
37736979 14
0cb8579a
MR
15PROGS-$(CONFIG_FFMPEG) += ffmpeg
16PROGS-$(CONFIG_FFPLAY) += ffplay
17PROGS-$(CONFIG_FFSERVER) += ffserver
01310af2 18
bb8fe69a
DB
19PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
20PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
21MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
85f07f22 22
bb8fe69a
DB
23BASENAMES = ffmpeg ffplay ffserver
24ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
25ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
26ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
6b991cb2 27
0fd94442 28ifeq ($(BUILD_SHARED),yes)
c721d803 29DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF) libavdevice/$(SLIBPREF)avdevice$(SLIBSUF)
0fd94442 30else
c721d803 31DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF) libavdevice/$(LIBPREF)avdevice$(LIBSUF)
f02be79d
RS
32endif
33
7d6ac9a3
MR
34ALL_TARGETS-$(CONFIG_VHOOK) += videohook
35ALL_TARGETS-$(BUILD_DOC) += documentation
36
37INSTALL_TARGETS-$(CONFIG_VHOOK) += install-vhook
1217916b
DB
38ifneq ($(PROGS),)
39INSTALL_TARGETS-yes += install-progs
282db5fd 40INSTALL_TARGETS-$(BUILD_DOC) += install-man
1217916b 41endif
dd9f3d97 42
3b26ee47 43VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
dd9f3d97
MR
44
45BASEHOOKS = fish null watermark
46ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm
47ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS)))
48
49HOOKS-$(HAVE_FORK) += ppm
50HOOKS-$(HAVE_IMLIB2) += imlib2
51HOOKS-$(HAVE_FREETYPE2) += drawtext
52
53HOOKS = $(addprefix vhook/, $(addsuffix $(SLIBSUF), $(BASEHOOKS) $(HOOKS-yes)))
54
55VHOOKCFLAGS-$(HAVE_IMLIB2) += `imlib2-config --cflags`
cbefadbd 56LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs`
dd9f3d97
MR
57
58VHOOKCFLAGS-$(HAVE_FREETYPE2) += `freetype-config --cflags`
cbefadbd 59LIBS_drawtext$(SLIBSUF) = `freetype-config --libs`
dd9f3d97
MR
60
61VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
142fc6b9 62
7f0f6e13 63SRCS = $(addsuffix .c, $(PROGS-yes)) cmdutils.c
c721d803
LA
64LDFLAGS := -L$(BUILD_ROOT)/libavdevice -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
65EXTRALIBS := -lavdevice$(BUILDSUF) -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
57514323 66
790c9ca7 67ifeq ($(CONFIG_SWSCALER),yes)
06694949 68LDFLAGS+=-L$(BUILD_ROOT)/libswscale
6de9e506 69EXTRALIBS+=-lswscale$(BUILDSUF)
790c9ca7
LA
70endif
71
a11f43a4
MR
72MAKE-yes = $(MAKE)
73MAKE- = : $(MAKE)
74
7d6ac9a3 75all: lib $(PROGS) $(ALL_TARGETS-yes)
85f07f22 76
951bf3e6 77lib:
20963a71
MR
78 $(MAKE) -C libavutil all
79 $(MAKE) -C libavcodec all
80 $(MAKE) -C libavformat all
81 $(MAKE) -C libavdevice all
82 $(MAKE-$(CONFIG_PP)) -C libpostproc all
a11f43a4 83 $(MAKE-$(CONFIG_SWSCALER)) -C libswscale all
85f07f22 84
951bf3e6 85ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
6de9e506 86 $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
85f07f22 87
4ce5df08
SS
88ffserver$(EXESUF): ffserver.o cmdutils.o .libs
89 $(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o cmdutils.o $(EXTRALIBS)
85f07f22 90
951bf3e6 91ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
6de9e506 92 $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
01310af2 93
0cfd96cc 94%$(EXESUF): %_g$(EXESUF)
01310af2
FB
95 cp -p $< $@
96 $(STRIP) $@
97
a4da50e1
MR
98SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
99ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
100version.h: $(SVN_ENTRIES)
101endif
102
f1cc88a5 103version.h:
997baf01 104 $(SRC_PATH)/version.sh $(SRC_PATH)
f1cc88a5 105
951bf3e6 106output_example$(EXESUF): output_example.o .libs
18caf192 107 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(EXTRALIBS)
8de65d4f 108
1521c500
DB
109tools/%$(EXESUF): tools/%.c
110 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(EXTRALIBS)
6da7cc81 111
4566de57 112ffplay.o: CFLAGS += $(SDL_CFLAGS)
2744a37f 113
496cfa3c
MR
114ffmpeg.o ffplay.o ffserver.o: version.h
115
ed5614eb
DB
116videohook: .libs $(HOOKS)
117
118vhook/%$(SLIBSUF): vhook/%.o
3b26ee47 119 $(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
ed5614eb 120
3b26ee47
MR
121vhook/%.o: vhook/%.c
122 $(CC) $(VHOOKCFLAGS) -c -o $@ $<
123
124%.o: %.c
125 $(CC) $(CFLAGS) -c -o $@ $<
142fc6b9 126
e9b19db8 127documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
d0e1cd3d
DB
128 ffplay-doc.html general.html hooks.html \
129 $(ALLMANPAGES))
e9b19db8
DB
130
131doc/%.html: doc/%.texi
132 texi2html -monolithic -number $<
133 mv $(@F) $@
134
135doc/%.pod: doc/%-doc.texi
136 doc/texi2pod.pl $< $@
137
138doc/%.1: doc/%.pod
139 pod2man --section=1 --center=" " --release=" " $< > $@
146ea952 140
1217916b 141install: install-libs install-headers $(INSTALL_TARGETS-yes)
81dcdc53 142
a4848db6 143ifeq ($(BUILD_SHARED),yes)
e1a3a63f 144install-progs: install-libs
a4848db6 145endif
c4fa7ebc 146install-progs: $(PROGS)
22a324da
DB
147 install -d "$(BINDIR)"
148 install -c -m 755 $(PROGS) "$(BINDIR)"
85f07f22 149
7a7be126 150# Create the Windows installer.
d35ff76b
FB
151wininstaller: all install
152 makensis ffinstall.nsi
153
23a65308 154install-man:
22a324da
DB
155 install -d "$(MANDIR)/man1"
156 install -m 644 $(MANPAGES) "$(MANDIR)/man1"
23a65308 157
ed5614eb 158install-vhook: videohook
22a324da
DB
159 install -d "$(SHLIBDIR)/vhook"
160 install -m 755 $(HOOKS) "$(SHLIBDIR)/vhook"
142fc6b9 161
b12f8273 162install-libs:
20963a71
MR
163 $(MAKE) -C libavutil install-libs
164 $(MAKE) -C libavcodec install-libs
165 $(MAKE) -C libavformat install-libs
166 $(MAKE) -C libavdevice install-libs
167 $(MAKE-$(CONFIG_PP)) -C libpostproc install-libs
a11f43a4 168 $(MAKE-$(CONFIG_SWSCALER)) -C libswscale install-libs
8b2121e3 169ifeq ($(BUILD_SHARED),yes)
1e7ffa50 170 -$(LDCONFIG)
b12f8273 171endif
37736979 172
f29f3b5d 173install-headers:
20963a71
MR
174 $(MAKE) -C libavutil install-headers
175 $(MAKE) -C libavcodec install-headers
176 $(MAKE) -C libavformat install-headers
177 $(MAKE) -C libavdevice install-headers
a11f43a4 178 $(MAKE-$(CONFIG_PP)) -C libpostproc install-headers
20963a71 179 $(MAKE) -C libswscale install-headers
f29f3b5d 180
f9edb717
DB
181uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
182
f9edb717 183uninstall-progs:
1c2211bd 184 rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
f9edb717 185
f9edb717 186uninstall-man:
1c2211bd 187 rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
f9edb717
DB
188
189uninstall-vhook:
1c2211bd 190 rm -f $(addprefix "$(SHLIBDIR)/",$(ALLHOOKS_SRCS:.c=$(SLIBSUF)))
22a324da 191 -rmdir "$(SHLIBDIR)/vhook/"
f9edb717
DB
192
193uninstall-libs:
194 $(MAKE) -C libavutil uninstall-libs
195 $(MAKE) -C libavcodec uninstall-libs
196 $(MAKE) -C libavformat uninstall-libs
c721d803 197 $(MAKE) -C libavdevice uninstall-libs
6d9a2421 198 $(MAKE) -C libpostproc uninstall-libs
65f37992 199 $(MAKE) -C libswscale uninstall-libs
f9edb717
DB
200
201uninstall-headers:
202 $(MAKE) -C libavutil uninstall-headers
203 $(MAKE) -C libavcodec uninstall-headers
204 $(MAKE) -C libavformat uninstall-headers
c721d803 205 $(MAKE) -C libavdevice uninstall-headers
6d9a2421 206 $(MAKE) -C libpostproc uninstall-headers
65f37992 207 $(MAKE) -C libswscale uninstall-headers
22a324da 208 -rmdir "$(INCDIR)"
f9edb717 209
3b26ee47 210depend dep: .depend .vhookdep
20963a71
MR
211 $(MAKE) -C libavutil depend
212 $(MAKE) -C libavcodec depend
213 $(MAKE) -C libavformat depend
214 $(MAKE) -C libavdevice depend
215 $(MAKE-$(CONFIG_PP)) -C libpostproc depend
a11f43a4 216 $(MAKE-$(CONFIG_SWSCALER)) -C libswscale depend
4b8b2edb 217
fd071c26 218.depend: $(SRCS) version.h
0032cac2 219 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
3b26ee47 220
2a4592fe 221# gcc stupidly only outputs the basename of targets with -MM
fc900b7b 222.vhookdep: $(ALLHOOKS_SRCS) version.h
3b26ee47 223 $(CC) $(VHOOKCFLAGS) -MM $^ | sed 's,^\([a-z]\),vhook/\1,' > $@
57514323 224
da34f7ac
MR
225$(DEP_LIBS): lib
226
227.libs: $(DEP_LIBS)
228 touch $@
cf2818b0 229
98013cc1 230clean:
5d22ccf7
DB
231 $(MAKE) -C libavutil clean
232 $(MAKE) -C libavcodec clean
abac6175 233 $(MAKE) -C libavformat clean
c721d803 234 $(MAKE) -C libavdevice clean
6d9a2421 235 $(MAKE) -C libpostproc clean
790c9ca7 236 $(MAKE) -C libswscale clean
b8d40825 237 rm -f *.o *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
2b258bba 238 output_example$(EXESUF)
e9b19db8 239 rm -f doc/*.html doc/*.pod doc/*.1
4fbd52f0
DB
240 rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
241 rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
2b258bba 242 rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
ed5614eb 243 rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
142fc6b9 244
85f07f22 245distclean: clean
98013cc1
DB
246 $(MAKE) -C libavutil distclean
247 $(MAKE) -C libavcodec distclean
248 $(MAKE) -C libavformat distclean
c721d803 249 $(MAKE) -C libavdevice distclean
6d9a2421 250 $(MAKE) -C libpostproc distclean
790c9ca7 251 $(MAKE) -C libswscale distclean
2c8c5021 252 rm -f .depend .vhookdep version.h config.* *.pc
85f07f22
FB
253
254TAGS:
abac6175 255 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 256
dd9ca370
FB
257# regression tests
258
4fbd52f0 259fulltest test: codectest libavtest seektest
4fbd52f0
DB
260
261FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
262FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
263LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
264ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
265SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
266
b13cdd33 267test-server: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
4fbd52f0
DB
268 @echo
269 @echo "Unfortunately ffserver is broken and therefore its regression"
270 @echo "test fails randomly. Treat the results accordingly."
271 @echo
272 $(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
273
b13cdd33 274codectest mpeg4 mpeg ac3 snow snowll: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw tests/tiny_psnr$(EXESUF)
4fbd52f0
DB
275 $(SRC_PATH)/tests/regression.sh $@ $(FFMPEG_REFFILE) tests/vsynth1
276 $(SRC_PATH)/tests/regression.sh $@ $(ROTOZOOM_REFFILE) tests/vsynth2
277
b13cdd33 278libavtest: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
4fbd52f0 279 $(SRC_PATH)/tests/regression.sh $@ $(LIBAV_REFFILE) tests/vsynth1
a5a5984a 280
b15136b7 281seektest: codectest libavtest tests/seek_test$(EXESUF)
4fbd52f0 282 $(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE)
4fbd52f0
DB
283
284ifeq ($(CONFIG_SWSCALER),yes)
285test-server codectest mpeg4 mpeg ac3 snow snowll libavtest: swscale_error
286swscale_error:
287 @echo
288 @echo "This regression test is incompatible with --enable-swscaler."
289 @echo
290 @exit 1
291endif
292
293tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
294 mkdir -p tests/vsynth1
295 $(BUILD_ROOT)/$< 'tests/vsynth1/'
296
297tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
298 mkdir -p tests/vsynth2
299 $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
300
301tests/asynth1.sw: tests/audiogen$(EXESUF)
302 $(BUILD_ROOT)/$< $@
303
304%$(EXESUF): %.c
305 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
306
06396e11 307tests/seek_test$(EXESUF): tests/seek_test.c .libs
ff21c1b0 308 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $< $(EXTRALIBS)
4fbd52f0 309
dd9ca370 310
3263626f 311.PHONY: all lib videohook documentation install* wininstaller uninstall*
bedb3550 312.PHONY: dep depend clean distclean TAGS
5e2dfd39 313.PHONY: codectest libavtest seektest test-server fulltest test
4fbd52f0 314.PHONY: mpeg4 mpeg ac3 snow snowll swscale-error
cf2818b0 315
6ca0c110 316-include .depend
3b26ee47 317-include .vhookdep