added CONFIG_AC3, CONFIG_MPGLIB, CONFIG_DECODERS and CONFIG_ENCODERS (Arpi: don't...
[libav.git] / libavcodec / Makefile
CommitLineData
980fc7b8
FB
1include ../config.mak
2
3CFLAGS= $(OPTFLAGS) -Wall -g
de6d9b64
FB
4LDFLAGS= -g
5
6OBJS= 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
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
FB
18
19# currently using mpglib for mpeg audio decoding
d771bcae 20ifeq ($(CONFIG_MPGLIB),yes)
de6d9b64
FB
21OBJS+= mpegaudiodec.o \
22 mpglib/layer1.o mpglib/layer2.o mpglib/layer3.o \
23 mpglib/dct64_i386.o mpglib/decode_i386.o mpglib/tabinit.o
d771bcae 24endif
de6d9b64
FB
25
26# i386 mmx specific stuff
980fc7b8
FB
27ifeq ($(TARGET_MMX),yes)
28ASM_OBJS += i386/fdct_mmx.o i386/sad_mmx.o
29OBJS += i386/fdctdata.o i386/cputest.o \
de6d9b64
FB
30 i386/dsputil_mmx.o
31endif
32
980fc7b8
FB
33SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
34
de6d9b64
FB
35LIB= libavcodec.a
36TESTS= imgresample-test dct-test
37
38all: $(LIB) apiexample
39
980fc7b8 40$(LIB): $(OBJS) $(ASM_OBJS)
de6d9b64 41 rm -f $@
980fc7b8 42 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
de6d9b64
FB
43
44dsputil.o: dsputil.c dsputil.h
45
46%.o: %.c
47 $(CC) $(CFLAGS) -c -o $@ $<
48
49%.o: %.s
50 nasm -f elf -o $@ $<
51
980fc7b8
FB
52# depend only used by mplayer now
53dep: depend
54
55depend:
56 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
57
de6d9b64
FB
58clean:
59 rm -f *.o *~ *.a i386/*.o i386/*~ \
60 libac3/*.o libac3/*~ \
61 mpglib/*.o mpglib/*~ \
62 apiexample $(TESTS)
63
980fc7b8
FB
64distclean: clean
65 rm -f Makefile.bak .depend
66
de6d9b64
FB
67# api example program
68apiexample: apiexample.c $(LIB)
69 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
70
71# testing progs
72
73imgresample-test: imgresample.c
74 $(CC) $(CFLAGS) -DTEST -o $@ $^
75
76dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o i386/fdctdata.o fdctref.o
77 $(CC) -o $@ $^
d771bcae
FB
78
79#
80# include dependency files if they exist
81#
82ifneq ($(wildcard .depend),)
83include .depend
84endif