moved dct init out from mpv_common_init to dct_common_init (for less-uglier way for dv)
[libav.git] / libavcodec / Makefile
CommitLineData
4cc281d9
FB
1#
2# libavcodec Makefile
ff4ec49e 3# (c) 2000, 2001, 2002 Fabrice Bellard
4cc281d9 4#
980fc7b8
FB
5include ../config.mak
6
4cc281d9
FB
7VPATH=$(SRC_PATH)/libavcodec
8
ff4ec49e 9# NOTE: -I.. is needed to include config.h
eddbd7e5 10CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
de6d9b64
FB
11LDFLAGS= -g
12
773cefc6 13OBJS= common.o utils.o mem.o allcodecs.o \
28db7fce 14 mpegvideo.o h263.o jrevdct.o jfdctfst.o jfdctint.o\
10b7b472 15 mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
de6d9b64 16 motion_est.o imgconvert.o imgresample.o msmpeg4.o \
be8ffec9 17 mpeg12.o h263dec.o svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
020fcc94 18 ratecontrol.o adpcm.o eval.o dv.o
980fc7b8 19ASM_OBJS=
de6d9b64 20
57514323 21# currently using liba52 for ac3 decoding
d771bcae 22ifeq ($(CONFIG_AC3),yes)
57514323 23OBJS+= a52dec.o
57514323
ZK
24
25# using builtin liba52 or runtime linked liba52.so.0
ff4ec49e 26ifneq ($(CONFIG_A52BIN),yes)
57514323
ZK
27OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
28 liba52/imdct.o liba52/parse.o
d771bcae 29endif
ff4ec49e 30endif
de6d9b64 31
5798368b
J
32ifeq ($(CONFIG_MP3LAME),yes)
33OBJS += mp3lameaudio.o
2a2a98c0 34EXTRALIBS += -lmp3lame
5798368b
J
35endif
36
81e0d0b4
MH
37ifeq ($(CONFIG_VORBIS),yes)
38OBJS += oggvorbis.o
39EXTRALIBS += -lvorbis -lvorbisenc
40endif
41
43f1708f
J
42ifeq ($(TARGET_GPROF),yes)
43CFLAGS+=-p
44LDFLAGS+=-p
45endif
46
de6d9b64 47# i386 mmx specific stuff
980fc7b8 48ifeq ($(TARGET_MMX),yes)
4300403e 49OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 50 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
57514323 51 i386/idct_mmx.o i386/motion_est_mmx.o \
d962f6fd 52 i386/simple_idct_mmx.o
de6d9b64
FB
53endif
54
3d03c0a2
FB
55# armv4l specific stuff
56ifeq ($(TARGET_ARCH_ARMV4L),yes)
57ASM_OBJS += armv4l/jrevdct_arm.o
58OBJS += armv4l/dsputil_arm.o
59endif
60
c34270f5
FB
61# sun mediaLib specific stuff
62# currently only works when libavcodec is used in mplayer
63ifeq ($(HAVE_MLIB),yes)
64OBJS += mlib/dsputil_mlib.o
65CFLAGS += $(MLIB_INC)
66endif
67
1e98dffb
NK
68# alpha specific stuff
69ifeq ($(TARGET_ARCH_ALPHA),yes)
57d2bce1 70OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o alpha/motion_est_alpha.o
f9bb4bdf 71ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
0af65aac 72CFLAGS += -fforce-addr -freduce-all-givs
1e98dffb
NK
73endif
74
59925ef2 75ifeq ($(TARGET_ARCH_POWERPC),yes)
ab6c65f6
BF
76OBJS += ppc/dsputil_ppc.o
77endif
78
d46aba26 79ifeq ($(TARGET_MMI),yes)
5917d17c 80OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
d46aba26
LS
81endif
82
ab6c65f6 83ifeq ($(TARGET_ALTIVEC),yes)
59925ef2
BF
84CFLAGS += -faltivec
85OBJS += ppc/dsputil_altivec.o
86endif
87
bb7d4939 88SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
ff4ec49e 89OBJS := $(OBJS) $(ASM_OBJS)
980fc7b8 90
de6d9b64 91LIB= libavcodec.a
0fd94442 92ifeq ($(BUILD_SHARED),yes)
ff4ec49e 93SLIB= libavcodec.so
0fd94442 94endif
4300403e 95TESTS= imgresample-test dct-test motion-test
de6d9b64 96
0fd94442 97all: $(LIB) $(SLIB)
ff4ec49e 98
c10e9f70 99tests: apiexample cpuid_test $(TESTS)
de6d9b64 100
ff4ec49e 101$(LIB): $(OBJS)
de6d9b64 102 rm -f $@
be7109c1
MN
103 $(AR) rc $@ $(OBJS)
104 $(RANLIB) $@
ff4ec49e
FB
105
106$(SLIB): $(OBJS)
e1707f52 107 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
de6d9b64
FB
108
109dsputil.o: dsputil.c dsputil.h
110
111%.o: %.c
112 $(CC) $(CFLAGS) -c -o $@ $<
113
3d03c0a2
FB
114%.o: %.S
115 $(CC) $(CFLAGS) -c -o $@ $<
116
0af65aac
FH
117# motion_est_alpha uses the MVI extension, which is not available with
118# -mcpu=ev4 (default) or ev5/ev56. Thus, force -mcpu=pca56 in those
119# cases.
120ifeq ($(TARGET_ARCH_ALPHA),yes)
121alpha/motion_est_alpha.o: alpha/motion_est_alpha.c
122 cpu=`echo "$(CFLAGS)" | sed -n 's,.*-mcpu=\([a-zA-Z0-9]*\).*,\1,p'`; \
123 case x"$$cpu" in x|xev[45]*) newcpu=pca56;; *) newcpu=$$cpu;; esac; \
124 echo $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<;\
125 $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<
126endif
127
980fc7b8
FB
128# depend only used by mplayer now
129dep: depend
130
131depend:
132 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
133
de6d9b64 134clean:
1ac9248b 135 rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
3d03c0a2 136 armv4l/*.o armv4l/*~ \
c34270f5 137 mlib/*.o mlib/*~ \
1e98dffb 138 alpha/*.o alpha/*~ \
59925ef2 139 ppc/*.o ppc/*~ \
d46aba26 140 ps2/*.o ps2/*~ \
57514323
ZK
141 liba52/*.o liba52/*~ \
142 apiexample $(TESTS)
de6d9b64 143
800d7ceb 144distclean: clean
980fc7b8
FB
145 rm -f Makefile.bak .depend
146
de6d9b64
FB
147# api example program
148apiexample: apiexample.c $(LIB)
cfda33cb 149 $(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
de6d9b64 150
c10e9f70
NK
151# cpuid test
152cpuid_test: i386/cputest.c
153 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
154
de6d9b64
FB
155# testing progs
156
157imgresample-test: imgresample.c
6acce86b 158 $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
de6d9b64 159
86748dbc
MN
160dct-test: dct-test.o jfdctfst.o jfdctint.o i386/fdct_mmx.o\
161 fdctref.o jrevdct.o i386/idct_mmx.o simple_idct.o i386/simple_idct_mmx.o
90cee0c3 162 $(CC) -o $@ $^ -lm
d771bcae 163
4300403e 164motion-test: motion_test.o $(LIB)
6acce86b 165 $(CC) -o $@ $^ -lm
4300403e 166
0fd94442 167install: all
0fd94442 168ifeq ($(BUILD_SHARED),yes)
c1325d18 169 install -d $(prefix)/lib
ff4ec49e 170 install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
c1325d18
VM
171 ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
172 ldconfig || true
ff4ec49e
FB
173 mkdir -p $(prefix)/include/ffmpeg
174 install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
175 install -m 644 common.h $(prefix)/include/ffmpeg/common.h
0fd94442 176endif
773cefc6
FB
177
178installlib: all
179 install -m 644 $(LIB) $(prefix)/lib
180 mkdir -p $(prefix)/include/ffmpeg
181 install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
182 $(prefix)/include/ffmpeg
183
d771bcae
FB
184#
185# include dependency files if they exist
186#
187ifneq ($(wildcard .depend),)
188include .depend
189endif