faster dering
[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 \
a96b68b7 9 mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.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
de6d9b64 19# i386 mmx specific stuff
980fc7b8 20ifeq ($(TARGET_MMX),yes)
4300403e 21OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 22 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
4300403e 23 i386/idct_mmx.o i386/motion_est_mmx.o
de6d9b64
FB
24endif
25
3d03c0a2
FB
26# armv4l specific stuff
27ifeq ($(TARGET_ARCH_ARMV4L),yes)
28ASM_OBJS += armv4l/jrevdct_arm.o
29OBJS += armv4l/dsputil_arm.o
30endif
31
c34270f5
FB
32# sun mediaLib specific stuff
33# currently only works when libavcodec is used in mplayer
34ifeq ($(HAVE_MLIB),yes)
35OBJS += mlib/dsputil_mlib.o
36CFLAGS += $(MLIB_INC)
37endif
38
980fc7b8
FB
39SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
40
de6d9b64 41LIB= libavcodec.a
4300403e 42TESTS= imgresample-test dct-test motion-test
de6d9b64 43
54329dd5 44all: $(LIB)
c10e9f70 45tests: apiexample cpuid_test $(TESTS)
de6d9b64 46
980fc7b8 47$(LIB): $(OBJS) $(ASM_OBJS)
de6d9b64 48 rm -f $@
980fc7b8 49 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
de6d9b64
FB
50
51dsputil.o: dsputil.c dsputil.h
52
53%.o: %.c
54 $(CC) $(CFLAGS) -c -o $@ $<
55
3d03c0a2
FB
56%.o: %.S
57 $(CC) $(CFLAGS) -c -o $@ $<
58
980fc7b8
FB
59# depend only used by mplayer now
60dep: depend
61
62depend:
63 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
64
de6d9b64
FB
65clean:
66 rm -f *.o *~ *.a i386/*.o i386/*~ \
3d03c0a2 67 armv4l/*.o armv4l/*~ \
c34270f5 68 mlib/*.o mlib/*~ \
de6d9b64 69 libac3/*.o libac3/*~ \
de6d9b64
FB
70 apiexample $(TESTS)
71
980fc7b8
FB
72distclean: clean
73 rm -f Makefile.bak .depend
74
de6d9b64
FB
75# api example program
76apiexample: apiexample.c $(LIB)
77 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
78
c10e9f70
NK
79# cpuid test
80cpuid_test: i386/cputest.c
81 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
82
de6d9b64
FB
83# testing progs
84
85imgresample-test: imgresample.c
86 $(CC) $(CFLAGS) -DTEST -o $@ $^
87
4300403e 88dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
de1ee36a 89 fdctref.o jrevdct.o i386/idct_mmx.o
de6d9b64 90 $(CC) -o $@ $^
d771bcae 91
4300403e
FB
92motion-test: motion_test.o $(LIB)
93 $(CC) -o $@ $^
94
d771bcae
FB
95#
96# include dependency files if they exist
97#
98ifneq ($(wildcard .depend),)
99include .depend
100endif