Don't run libavtest if CONFIG_GPL is not set.
[ffmpeg.git] / tests / Makefile
1 #
2 # Makefile for tests
3 # (c) 2002 Fabrice Bellard
4 #
5 include ../config.mak
6
7 VPATH=$(SRC_PATH)/tests
8 CFLAGS=-O2 -Wall -g
9
10 REFFILE1=$(VPATH)/ffmpeg.regression.ref
11 REFFILE2=$(VPATH)/rotozoom.regression.ref
12
13 SERVER_REFFILE=$(VPATH)/ffserver.regression.ref
14
15 LIBAV_REFFILE=$(VPATH)/libav.regression.ref
16
17 all fulltest test: codectest libavtest test-server
18
19 test-server: vsynth1/00.pgm asynth1.sw
20         @$(VPATH)/server-regression.sh $(SERVER_REFFILE) $(VPATH)/test.conf
21
22 # fast regression tests for all codecs
23 codectest mpeg4 mpeg ac3 snow snowll: vsynth1/00.pgm vsynth2/00.pgm asynth1.sw tiny_psnr$(EXESUF)
24         @$(VPATH)/regression.sh $@ $(REFFILE1) vsynth1
25         @$(VPATH)/regression.sh $@ $(REFFILE2) vsynth2
26
27 # fast regression for libav formats
28 ifeq ($(CONFIG_GPL),yes)
29 libavtest: vsynth1/00.pgm asynth1.sw
30         @$(VPATH)/regression.sh $@ $(LIBAV_REFFILE) vsynth1
31 else
32 libavtest:
33         @echo
34         @echo "This test requires FFmpeg to be compiled with --enable-gpl."
35         @echo
36 endif
37
38 # video generation
39
40 vsynth1/00.pgm: videogen$(EXESUF)
41         @mkdir -p vsynth1
42         ./videogen 'vsynth1/'
43
44 vsynth2/00.pgm: rotozoom$(EXESUF)
45         @mkdir -p vsynth2
46         ./rotozoom 'vsynth2/' $(VPATH)/lena.pnm
47
48 videogen$(EXESUF): videogen.c
49         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
50
51 rotozoom$(EXESUF): rotozoom.c
52         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
53
54 # audio generation
55
56 asynth1.sw: audiogen$(EXESUF)
57         ./audiogen $@
58
59 audiogen$(EXESUF): audiogen.c
60         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
61
62 tiny_psnr$(EXESUF): tiny_psnr.c
63         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
64
65 DSPDEPS = $(SRC_PATH)/libavcodec/i386/dsputil_mmx.c \
66  $(SRC_PATH)/libavcodec/i386/dsputil_mmx_avg.h \
67  $(SRC_PATH)/libavcodec/i386/dsputil_mmx_rnd.h \
68  $(SRC_PATH)/libavcodec/i386/fdct_mmx.c \
69  $(SRC_PATH)/libavcodec/i386/idct_mmx.c \
70  $(SRC_PATH)/libavcodec/i386/motion_est_mmx.c \
71  $(SRC_PATH)/libavcodec/i386/simple_idct_mmx.c \
72  $(SRC_PATH)/libavcodec/dsputil.c \
73  $(SRC_PATH)/libavcodec/dsputil.h \
74  $(SRC_PATH)/libavcodec/simple_idct.c
75
76 DSPCFLAGS = -O4 -fomit-frame-pointer -DHAVE_AV_CONFIG_H -I.. \
77  -I$(SRC_PATH)/libavutil/ -I$(SRC_PATH)/libavcodec/i386 \
78  -I$(SRC_PATH)/libavcodec/ -lm
79
80 dsptestpic: dsptest.c $(DSPDEPS)
81         $(CC) -fPIC -DPIC $(DSPCFLAGS) -o $@ $<
82 dsptest: dsptest.c $(DSPDEPS)
83         $(CC) $(DSPCFLAGS) -o $@ $<
84
85 distclean clean:
86         rm -rf vsynth1 vsynth2 data
87         rm -f asynth1.sw *~ audiogen$(EXESUF) videogen$(EXESUF) rotozoom$(EXESUF) tiny_psnr$(EXESUF)
88
89 .PHONY: all fulltest test codectest libavtest test-server
90 .PHONY: mpeg4 mpeg ac3 snow snowll distclean clean