* using some small char buffer - needed for sprintf
[libav.git] / libavcodec / Makefile
CommitLineData
980fc7b8
FB
1include ../config.mak
2
2b0c1a44 3CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H
de6d9b64
FB
4LDFLAGS= -g
5
6OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
10b7b472 7 mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
de6d9b64 8 motion_est.o imgconvert.o imgresample.o msmpeg4.o \
8b4c7dbc
MN
9 mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
10 ratecontrol.o
980fc7b8 11ASM_OBJS=
de6d9b64
FB
12
13# currently using libac3 for ac3 decoding
d771bcae 14ifeq ($(CONFIG_AC3),yes)
de6d9b64
FB
15OBJS+= ac3dec.o \
16 libac3/bit_allocate.o libac3/bitstream.o libac3/downmix.o \
17 libac3/imdct.o libac3/parse.o
d771bcae 18endif
de6d9b64 19
5798368b
J
20ifeq ($(CONFIG_MP3LAME),yes)
21OBJS += mp3lameaudio.o
22endif
23
43f1708f
J
24ifeq ($(TARGET_GPROF),yes)
25CFLAGS+=-p
26LDFLAGS+=-p
27endif
28
de6d9b64 29# i386 mmx specific stuff
980fc7b8 30ifeq ($(TARGET_MMX),yes)
4300403e 31OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 32 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
d962f6fd
A
33 i386/idct_mmx.o i386/motion_est_mmx.o \
34 i386/simple_idct_mmx.o
de6d9b64
FB
35endif
36
3d03c0a2
FB
37# armv4l specific stuff
38ifeq ($(TARGET_ARCH_ARMV4L),yes)
39ASM_OBJS += armv4l/jrevdct_arm.o
40OBJS += armv4l/dsputil_arm.o
41endif
42
c34270f5
FB
43# sun mediaLib specific stuff
44# currently only works when libavcodec is used in mplayer
45ifeq ($(HAVE_MLIB),yes)
46OBJS += mlib/dsputil_mlib.o
47CFLAGS += $(MLIB_INC)
48endif
49
1e98dffb
NK
50# alpha specific stuff
51ifeq ($(TARGET_ARCH_ALPHA),yes)
52OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
53CFLAGS += -Wa,-mpca56
54endif
55
980fc7b8
FB
56SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
57
de6d9b64 58LIB= libavcodec.a
0fd94442
NK
59ifeq ($(BUILD_SHARED),yes)
60SLIB= libffmpeg-$(VERSION).so
61endif
4300403e 62TESTS= imgresample-test dct-test motion-test
de6d9b64 63
0fd94442 64all: $(LIB) $(SLIB)
c10e9f70 65tests: apiexample cpuid_test $(TESTS)
de6d9b64 66
980fc7b8 67$(LIB): $(OBJS) $(ASM_OBJS)
de6d9b64 68 rm -f $@
980fc7b8 69 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
de6d9b64 70
0fd94442
NK
71$(SLIB): $(OBJS) $(ASM_OBJS)
72 rm -f $@
73 $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS)
74 ln -sf $@ libffmpeg.so
de6d9b64
FB
75dsputil.o: dsputil.c dsputil.h
76
77%.o: %.c
78 $(CC) $(CFLAGS) -c -o $@ $<
79
3d03c0a2
FB
80%.o: %.S
81 $(CC) $(CFLAGS) -c -o $@ $<
82
980fc7b8
FB
83# depend only used by mplayer now
84dep: depend
85
86depend:
87 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
88
de6d9b64 89clean:
0fd94442 90 rm -f *.o *~ $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
3d03c0a2 91 armv4l/*.o armv4l/*~ \
c34270f5 92 mlib/*.o mlib/*~ \
1e98dffb 93 alpha/*.o alpha/*~ \
de6d9b64 94 libac3/*.o libac3/*~ \
de6d9b64
FB
95 apiexample $(TESTS)
96
980fc7b8
FB
97distclean: clean
98 rm -f Makefile.bak .depend
99
de6d9b64
FB
100# api example program
101apiexample: apiexample.c $(LIB)
102 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
103
c10e9f70
NK
104# cpuid test
105cpuid_test: i386/cputest.c
106 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
107
de6d9b64
FB
108# testing progs
109
110imgresample-test: imgresample.c
111 $(CC) $(CFLAGS) -DTEST -o $@ $^
112
4300403e 113dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
de1ee36a 114 fdctref.o jrevdct.o i386/idct_mmx.o
de6d9b64 115 $(CC) -o $@ $^
d771bcae 116
4300403e
FB
117motion-test: motion_test.o $(LIB)
118 $(CC) -o $@ $^
119
0fd94442 120install: all
f840692f 121# install -m 644 $(LIB) $(prefix)/lib
0fd94442
NK
122ifeq ($(BUILD_SHARED),yes)
123 install -s -m 755 $(SLIB) $(prefix)/lib
124 ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
125 ldconfig
f840692f
NK
126 mkdir -p $(prefix)/include/libffmpeg
127 install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
18c599db 128 install -m 644 common.h $(prefix)/include/libffmpeg/common.h
0fd94442 129endif
d771bcae
FB
130#
131# include dependency files if they exist
132#
133ifneq ($(wildcard .depend),)
134include .depend
135endif