]> git.sesse.net Git - ffmpeg/blob - libavcodec/Makefile
Adding fastmemcpy stuff to speedup mplayer project
[ffmpeg] / libavcodec / Makefile
1 include ../config.mak
2
3 CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H
4 LDFLAGS= -g
5
6 OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
7       mpegaudio.o ac3enc.o mjpegenc.o resample.o dsputil.o \
8       motion_est.o imgconvert.o imgresample.o msmpeg4.o \
9       mpeg12.o h263dec.o rv10.o
10 ASM_OBJS=
11
12 # currently using libac3 for ac3 decoding
13 ifeq ($(CONFIG_AC3),yes)
14 OBJS+= ac3dec.o \
15        libac3/bit_allocate.o libac3/bitstream.o libac3/downmix.o \
16        libac3/imdct.o  libac3/parse.o
17 endif
18
19 # currently using mpglib for mpeg audio decoding
20 ifeq ($(CONFIG_MPGLIB),yes)
21 OBJS+= mpegaudiodec.o \
22        mpglib/layer1.o mpglib/layer2.o mpglib/layer3.o \
23        mpglib/dct64_i386.o mpglib/decode_i386.o  mpglib/tabinit.o
24 endif
25
26 # i386 mmx specific stuff
27 ifeq ($(TARGET_MMX),yes)
28 ASM_OBJS += i386/fdct_mmx.o i386/sad_mmx.o i386/cpuid.o
29 OBJS += i386/fdctdata.o i386/cputest.o \
30         i386/dsputil_mmx.o i386/mpegvideo_mmx.o
31 endif
32
33 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
34
35 LIB= libavcodec.a
36 TESTS= imgresample-test dct-test
37
38 all: $(LIB)
39 tests: apiexample $(TESTS)
40
41 $(LIB): $(OBJS) $(ASM_OBJS)
42         rm -f $@
43         $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
44
45 dsputil.o: dsputil.c dsputil.h
46
47 %.o: %.c
48         $(CC) $(CFLAGS) -c -o $@ $< 
49
50 i386/cpuid.o: i386/cpuid.s
51         $(CC) -c -o $@ $< 
52
53 %.o: %.s
54         nasm -f elf -o $@ $<
55
56 # depend only used by mplayer now
57 dep:    depend
58
59 depend:
60         $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
61
62 clean: 
63         rm -f *.o *~ *.a i386/*.o i386/*~ \
64            libac3/*.o libac3/*~ \
65            mpglib/*.o mpglib/*~ \
66            apiexample $(TESTS)
67
68 distclean: clean
69         rm -f Makefile.bak .depend
70
71 # api example program
72 apiexample: apiexample.c $(LIB)
73         $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
74
75 # testing progs
76
77 imgresample-test: imgresample.c
78         $(CC) $(CFLAGS) -DTEST -o $@ $^ 
79
80 dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o i386/fdctdata.o fdctref.o
81         $(CC) -o $@ $^
82
83 #
84 # include dependency files if they exist
85 #
86 ifneq ($(wildcard .depend),)
87 include .depend
88 endif