e6dbe85bec257ea53e0d77bc79136fdf739b0ca1
[libav.git] / libavcodec / Makefile
1 include ../config.mak
2
3 CFLAGS= $(OPTFLAGS) -Wall -g
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 OBJS+= ac3dec.o \
14 libac3/bit_allocate.o libac3/bitstream.o libac3/downmix.o \
15 libac3/imdct.o libac3/parse.o
16
17 # currently using mpglib for mpeg audio decoding
18 OBJS+= mpegaudiodec.o \
19 mpglib/layer1.o mpglib/layer2.o mpglib/layer3.o \
20 mpglib/dct64_i386.o mpglib/decode_i386.o mpglib/tabinit.o
21
22 # i386 mmx specific stuff
23 ifeq ($(TARGET_MMX),yes)
24 ASM_OBJS += i386/fdct_mmx.o i386/sad_mmx.o
25 OBJS += i386/fdctdata.o i386/cputest.o \
26 i386/dsputil_mmx.o
27 endif
28
29 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
30
31 LIB= libavcodec.a
32 TESTS= imgresample-test dct-test
33
34 all: $(LIB) apiexample
35
36 $(LIB): $(OBJS) $(ASM_OBJS)
37 rm -f $@
38 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
39
40 dsputil.o: dsputil.c dsputil.h
41
42 %.o: %.c
43 $(CC) $(CFLAGS) -c -o $@ $<
44
45 %.o: %.s
46 nasm -f elf -o $@ $<
47
48 # depend only used by mplayer now
49 dep: depend
50
51 depend:
52 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
53
54 clean:
55 rm -f *.o *~ *.a i386/*.o i386/*~ \
56 libac3/*.o libac3/*~ \
57 mpglib/*.o mpglib/*~ \
58 apiexample $(TESTS)
59
60 distclean: clean
61 rm -f Makefile.bak .depend
62
63 # api example program
64 apiexample: apiexample.c $(LIB)
65 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
66
67 # testing progs
68
69 imgresample-test: imgresample.c
70 $(CC) $(CFLAGS) -DTEST -o $@ $^
71
72 dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o i386/fdctdata.o fdctref.o
73 $(CC) -o $@ $^