updated
[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
FB
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 27ifeq ($(TARGET_MMX),yes)
1d20b11a 28ASM_OBJS += i386/fdct_mmx.o i386/sad_mmx.o
980fc7b8 29OBJS += i386/fdctdata.o i386/cputest.o \
de1ee36a
FB
30 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
31 i386/idct_mmx.o
de6d9b64
FB
32endif
33
980fc7b8
FB
34SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
35
de6d9b64
FB
36LIB= libavcodec.a
37TESTS= imgresample-test dct-test
38
54329dd5
NK
39all: $(LIB)
40tests: apiexample $(TESTS)
de6d9b64 41
980fc7b8 42$(LIB): $(OBJS) $(ASM_OBJS)
de6d9b64 43 rm -f $@
980fc7b8 44 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
de6d9b64
FB
45
46dsputil.o: dsputil.c dsputil.h
47
48%.o: %.c
49 $(CC) $(CFLAGS) -c -o $@ $<
50
51%.o: %.s
52 nasm -f elf -o $@ $<
53
980fc7b8
FB
54# depend only used by mplayer now
55dep: depend
56
57depend:
58 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
59
de6d9b64
FB
60clean:
61 rm -f *.o *~ *.a i386/*.o i386/*~ \
62 libac3/*.o libac3/*~ \
63 mpglib/*.o mpglib/*~ \
64 apiexample $(TESTS)
65
980fc7b8
FB
66distclean: clean
67 rm -f Makefile.bak .depend
68
de6d9b64
FB
69# api example program
70apiexample: apiexample.c $(LIB)
71 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
72
73# testing progs
74
75imgresample-test: imgresample.c
76 $(CC) $(CFLAGS) -DTEST -o $@ $^
77
de1ee36a
FB
78dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o i386/fdctdata.o \
79 fdctref.o jrevdct.o i386/idct_mmx.o
de6d9b64 80 $(CC) -o $@ $^
d771bcae
FB
81
82#
83# include dependency files if they exist
84#
85ifneq ($(wildcard .depend),)
86include .depend
87endif