fixed config for direct mplayer build compatibility
[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
13OBJS+= 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
18OBJS+= 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
980fc7b8
FB
23ifeq ($(TARGET_MMX),yes)
24ASM_OBJS += i386/fdct_mmx.o i386/sad_mmx.o
25OBJS += i386/fdctdata.o i386/cputest.o \
de6d9b64
FB
26 i386/dsputil_mmx.o
27endif
28
980fc7b8
FB
29SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
30
de6d9b64
FB
31LIB= libavcodec.a
32TESTS= imgresample-test dct-test
33
34all: $(LIB) apiexample
35
980fc7b8 36$(LIB): $(OBJS) $(ASM_OBJS)
de6d9b64 37 rm -f $@
980fc7b8 38 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
de6d9b64
FB
39
40dsputil.o: dsputil.c dsputil.h
41
42%.o: %.c
43 $(CC) $(CFLAGS) -c -o $@ $<
44
45%.o: %.s
46 nasm -f elf -o $@ $<
47
980fc7b8
FB
48# depend only used by mplayer now
49dep: depend
50
51depend:
52 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
53
de6d9b64
FB
54clean:
55 rm -f *.o *~ *.a i386/*.o i386/*~ \
56 libac3/*.o libac3/*~ \
57 mpglib/*.o mpglib/*~ \
58 apiexample $(TESTS)
59
980fc7b8
FB
60distclean: clean
61 rm -f Makefile.bak .depend
62
de6d9b64
FB
63# api example program
64apiexample: apiexample.c $(LIB)
65 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
66
67# testing progs
68
69imgresample-test: imgresample.c
70 $(CC) $(CFLAGS) -DTEST -o $@ $^
71
72dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o i386/fdctdata.o fdctref.o
73 $(CC) -o $@ $^