added win32 cross compile support
[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
3d03c0a2
FB
34# armv4l specific stuff
35ifeq ($(TARGET_ARCH_ARMV4L),yes)
36ASM_OBJS += armv4l/jrevdct_arm.o
37OBJS += armv4l/dsputil_arm.o
38endif
39
980fc7b8
FB
40SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
41
de6d9b64
FB
42LIB= libavcodec.a
43TESTS= imgresample-test dct-test
44
54329dd5 45all: $(LIB)
c10e9f70 46tests: apiexample cpuid_test $(TESTS)
de6d9b64 47
980fc7b8 48$(LIB): $(OBJS) $(ASM_OBJS)
de6d9b64 49 rm -f $@
980fc7b8 50 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
de6d9b64
FB
51
52dsputil.o: dsputil.c dsputil.h
53
54%.o: %.c
55 $(CC) $(CFLAGS) -c -o $@ $<
56
3d03c0a2
FB
57%.o: %.S
58 $(CC) $(CFLAGS) -c -o $@ $<
59
de6d9b64
FB
60%.o: %.s
61 nasm -f elf -o $@ $<
62
980fc7b8
FB
63# depend only used by mplayer now
64dep: depend
65
66depend:
67 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
68
de6d9b64
FB
69clean:
70 rm -f *.o *~ *.a i386/*.o i386/*~ \
3d03c0a2 71 armv4l/*.o armv4l/*~ \
de6d9b64
FB
72 libac3/*.o libac3/*~ \
73 mpglib/*.o mpglib/*~ \
74 apiexample $(TESTS)
75
980fc7b8
FB
76distclean: clean
77 rm -f Makefile.bak .depend
78
de6d9b64
FB
79# api example program
80apiexample: apiexample.c $(LIB)
81 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
82
c10e9f70
NK
83# cpuid test
84cpuid_test: i386/cputest.c
85 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
86
de6d9b64
FB
87# testing progs
88
89imgresample-test: imgresample.c
90 $(CC) $(CFLAGS) -DTEST -o $@ $^
91
de1ee36a
FB
92dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o i386/fdctdata.o \
93 fdctref.o jrevdct.o i386/idct_mmx.o
de6d9b64 94 $(CC) -o $@ $^
d771bcae
FB
95
96#
97# include dependency files if they exist
98#
99ifneq ($(wildcard .depend),)
100include .depend
101endif