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