fixed windows build
[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
cddf3f45 10CFLAGS= $(OPTFLAGS) -Wall -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
de6d9b64 11
773cefc6 12OBJS= common.o utils.o mem.o allcodecs.o \
1d0d55da 13 mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
10b7b472 14 mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
1d0d55da 15 motion_est.o imgconvert.o imgresample.o \
4f1bb8a9 16 mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
6d2abd6b 17 ratecontrol.o adpcm.o eval.o dv.o error_resilience.o \
d86053a4 18 fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o raw.o h264.o golomb.o \
3ef8be2b 19 vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o vcr1.o cljr.o \
9937e686 20 roqvideo.o dpcm.o interplayvideo.o xan.o
891f64b3 21
22ifeq ($(AMR_NB),yes)
bc634f6f 23ifeq ($(AMR_NB_FIXED),yes)
891f64b3 24OBJS+= amr.o
bc634f6f
ZK
25AMREXTRALIBS+= amr/*.o
26AMRLIBS=amrlibs
27CLEANAMR=cleanamr
28else
29OBJS+= amr.o amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
30CLEANAMR=cleanamrfloat
31endif
891f64b3 32endif
33
980fc7b8 34ASM_OBJS=
de6d9b64 35
1d0d55da
MN
36# codecs which are patented in some non free countries like the us
37ifeq ($(CONFIG_RISKY),yes)
deabd4fd 38OBJS+= h263.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o
1d0d55da
MN
39endif
40
4f1bb8a9
IK
41ifeq ($(HAVE_XVMC_ACCEL),yes)
42OBJS+= xvmcvideo.o
43endif
44
57514323 45# currently using liba52 for ac3 decoding
d771bcae 46ifeq ($(CONFIG_AC3),yes)
57514323 47OBJS+= a52dec.o
57514323
ZK
48
49# using builtin liba52 or runtime linked liba52.so.0
ff4ec49e 50ifneq ($(CONFIG_A52BIN),yes)
57514323 51OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
521221cf 52 liba52/imdct.o liba52/parse.o liba52/crc.o liba52/resample.o
d771bcae 53endif
ff4ec49e 54endif
de6d9b64 55
280bd7b7
ZK
56ifeq ($(CONFIG_FAAD),yes)
57OBJS+= faad.o
445ad18d
ZK
58ifeq ($(CONFIG_FAADBIN),yes)
59# no libs needed
60else
61EXTRALIBS += -lfaad
62endif
280bd7b7
ZK
63endif
64
bba9b16c
MN
65ifeq ($(CONFIG_PP),yes)
66ifeq ($(SHARED_PP),yes)
67EXTRALIBS += -lpostproc
68else
69# LIBS += libpostproc/libpostproc.a ... should be fixed
70OBJS += libpostproc/postprocess.o
71endif
72endif
73
5798368b
J
74ifeq ($(CONFIG_MP3LAME),yes)
75OBJS += mp3lameaudio.o
2a2a98c0 76EXTRALIBS += -lmp3lame
5798368b
J
77endif
78
81e0d0b4
MH
79ifeq ($(CONFIG_VORBIS),yes)
80OBJS += oggvorbis.o
81EXTRALIBS += -lvorbis -lvorbisenc
82endif
83
43f1708f
J
84ifeq ($(TARGET_GPROF),yes)
85CFLAGS+=-p
86LDFLAGS+=-p
87endif
88
de6d9b64 89# i386 mmx specific stuff
980fc7b8 90ifeq ($(TARGET_MMX),yes)
4300403e 91OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 92 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
57514323 93 i386/idct_mmx.o i386/motion_est_mmx.o \
923ceff8 94 i386/simple_idct_mmx.o i386/fft_sse.o
a968e365
FB
95ifdef TARGET_BUILTIN_VECTOR
96i386/fft_sse.o: CFLAGS+= -msse
97endif
de6d9b64
FB
98endif
99
3d03c0a2
FB
100# armv4l specific stuff
101ifeq ($(TARGET_ARCH_ARMV4L),yes)
bd7d1ea7 102ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o
676e200c 103OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
3d03c0a2
FB
104endif
105
c34270f5
FB
106# sun mediaLib specific stuff
107# currently only works when libavcodec is used in mplayer
108ifeq ($(HAVE_MLIB),yes)
109OBJS += mlib/dsputil_mlib.o
110CFLAGS += $(MLIB_INC)
111endif
112
1e98dffb
NK
113# alpha specific stuff
114ifeq ($(TARGET_ARCH_ALPHA),yes)
8b313a47
FH
115OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
116 alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
f9bb4bdf 117ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
0af65aac 118CFLAGS += -fforce-addr -freduce-all-givs
1e98dffb
NK
119endif
120
59925ef2 121ifeq ($(TARGET_ARCH_POWERPC),yes)
05c4072b 122OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
ab6c65f6
BF
123endif
124
d46aba26 125ifeq ($(TARGET_MMI),yes)
5917d17c 126OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
d46aba26
LS
127endif
128
ab6c65f6 129ifeq ($(TARGET_ALTIVEC),yes)
8d268a7d 130OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
e629ab68 131 ppc/fft_altivec.o ppc/gmc_altivec.o
59925ef2
BF
132endif
133
0c6bd2ea
B
134ifeq ($(TARGET_ARCH_SH4),yes)
135OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
136endif
137
138
bb7d4939 139SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
ff4ec49e 140OBJS := $(OBJS) $(ASM_OBJS)
980fc7b8 141
f3ec2d46 142LIB= $(LIBPREF)avcodec$(LIBSUF)
0fd94442 143ifeq ($(BUILD_SHARED),yes)
f3ec2d46 144SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
0fd94442 145endif
6d2abd6b 146TESTS= imgresample-test dct-test motion-test fft-test
de6d9b64 147
0fd94442 148all: $(LIB) $(SLIB)
ff4ec49e 149
bc634f6f
ZK
150amrlibs:
151 $(MAKE) -C amr spclib fipoplib
152
c10e9f70 153tests: apiexample cpuid_test $(TESTS)
de6d9b64 154
bc634f6f 155$(LIB): $(OBJS) $(AMRLIBS)
de6d9b64 156 rm -f $@
bc634f6f 157 $(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
be7109c1 158 $(RANLIB) $@
ff4ec49e 159
811b32ed 160$(SLIB): $(OBJS)
bc634f6f 161 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
de6d9b64
FB
162
163dsputil.o: dsputil.c dsputil.h
164
bba9b16c
MN
165libpostproc/libpostproc.a:
166 $(MAKE) -C libpostproc
167
de6d9b64
FB
168%.o: %.c
169 $(CC) $(CFLAGS) -c -o $@ $<
170
3d03c0a2
FB
171%.o: %.S
172 $(CC) $(CFLAGS) -c -o $@ $<
173
811b32ed 174depend: $(SRCS)
a968e365 175 $(CC) -MM $(CFLAGS) $^ 1>.depend
e51d4def 176
980fc7b8
FB
177dep: depend
178
bc634f6f 179clean: $(CLEANAMR)
77b71ddc 180 rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
3d03c0a2 181 armv4l/*.o armv4l/*~ \
c34270f5 182 mlib/*.o mlib/*~ \
1e98dffb 183 alpha/*.o alpha/*~ \
59925ef2 184 ppc/*.o ppc/*~ \
d46aba26 185 ps2/*.o ps2/*~ \
0c6bd2ea 186 sh4/*.o sh4/*~ \
57514323
ZK
187 liba52/*.o liba52/*~ \
188 apiexample $(TESTS)
64094f37 189 $(MAKE) -C libpostproc clean
de6d9b64 190
800d7ceb 191distclean: clean
980fc7b8
FB
192 rm -f Makefile.bak .depend
193
bc634f6f
ZK
194cleanamr:
195 $(MAKE) -C amr clean
196
197cleanamrfloat:
198 rm -f amr_float/*.o
199
de6d9b64
FB
200# api example program
201apiexample: apiexample.c $(LIB)
cfda33cb 202 $(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
de6d9b64 203
c10e9f70
NK
204# cpuid test
205cpuid_test: i386/cputest.c
206 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
207
de6d9b64
FB
208# testing progs
209
210imgresample-test: imgresample.c
6acce86b 211 $(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
de6d9b64 212
9ebc63a9 213dct-test: dct-test.o fdctref.o $(LIB)
90cee0c3 214 $(CC) -o $@ $^ -lm
d771bcae 215
4300403e 216motion-test: motion_test.o $(LIB)
6acce86b 217 $(CC) -o $@ $^ -lm
4300403e 218
923ceff8 219fft-test: fft-test.o $(LIB)
6d2abd6b
FB
220 $(CC) -o $@ $^ -lm
221
0fd94442 222install: all
0fd94442 223ifeq ($(BUILD_SHARED),yes)
c1325d18 224 install -d $(prefix)/lib
ff4ec49e 225 install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
c1325d18
VM
226 ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
227 ldconfig || true
ff4ec49e 228 mkdir -p $(prefix)/include/ffmpeg
3565eeaa
FH
229 install -m 644 $(VPATH)/avcodec.h $(prefix)/include/ffmpeg/avcodec.h
230 install -m 644 $(VPATH)/common.h $(prefix)/include/ffmpeg/common.h
0fd94442 231endif
773cefc6
FB
232
233installlib: all
234 install -m 644 $(LIB) $(prefix)/lib
235 mkdir -p $(prefix)/include/ffmpeg
236 install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
237 $(prefix)/include/ffmpeg
238
d771bcae
FB
239#
240# include dependency files if they exist
241#
242ifneq ($(wildcard .depend),)
243include .depend
244endif