Cygwin's mangling by Felix Buenemann <atmosfear@users.sourceforge.net>
[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 8 motion_est.o imgconvert.o imgresample.o msmpeg4.o \
d962f6fd 9 mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.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 18
de6d9b64 19# i386 mmx specific stuff
980fc7b8 20ifeq ($(TARGET_MMX),yes)
4300403e 21OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 22 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
d962f6fd
A
23 i386/idct_mmx.o i386/motion_est_mmx.o \
24 i386/simple_idct_mmx.o
de6d9b64
FB
25endif
26
3d03c0a2
FB
27# armv4l specific stuff
28ifeq ($(TARGET_ARCH_ARMV4L),yes)
29ASM_OBJS += armv4l/jrevdct_arm.o
30OBJS += armv4l/dsputil_arm.o
31endif
32
c34270f5
FB
33# sun mediaLib specific stuff
34# currently only works when libavcodec is used in mplayer
35ifeq ($(HAVE_MLIB),yes)
36OBJS += mlib/dsputil_mlib.o
37CFLAGS += $(MLIB_INC)
38endif
39
980fc7b8
FB
40SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
41
de6d9b64 42LIB= libavcodec.a
0fd94442
NK
43ifeq ($(BUILD_SHARED),yes)
44SLIB= libffmpeg-$(VERSION).so
45endif
4300403e 46TESTS= imgresample-test dct-test motion-test
de6d9b64 47
0fd94442 48all: $(LIB) $(SLIB)
c10e9f70 49tests: apiexample cpuid_test $(TESTS)
de6d9b64 50
980fc7b8 51$(LIB): $(OBJS) $(ASM_OBJS)
de6d9b64 52 rm -f $@
980fc7b8 53 $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
de6d9b64 54
0fd94442
NK
55$(SLIB): $(OBJS) $(ASM_OBJS)
56 rm -f $@
57 $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS)
58 ln -sf $@ libffmpeg.so
de6d9b64
FB
59dsputil.o: dsputil.c dsputil.h
60
61%.o: %.c
62 $(CC) $(CFLAGS) -c -o $@ $<
63
3d03c0a2
FB
64%.o: %.S
65 $(CC) $(CFLAGS) -c -o $@ $<
66
980fc7b8
FB
67# depend only used by mplayer now
68dep: depend
69
70depend:
71 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
72
de6d9b64 73clean:
0fd94442 74 rm -f *.o *~ $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
3d03c0a2 75 armv4l/*.o armv4l/*~ \
c34270f5 76 mlib/*.o mlib/*~ \
de6d9b64 77 libac3/*.o libac3/*~ \
de6d9b64
FB
78 apiexample $(TESTS)
79
980fc7b8
FB
80distclean: clean
81 rm -f Makefile.bak .depend
82
de6d9b64
FB
83# api example program
84apiexample: apiexample.c $(LIB)
85 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
86
c10e9f70
NK
87# cpuid test
88cpuid_test: i386/cputest.c
89 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
90
de6d9b64
FB
91# testing progs
92
93imgresample-test: imgresample.c
94 $(CC) $(CFLAGS) -DTEST -o $@ $^
95
4300403e 96dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
de1ee36a 97 fdctref.o jrevdct.o i386/idct_mmx.o
de6d9b64 98 $(CC) -o $@ $^
d771bcae 99
4300403e
FB
100motion-test: motion_test.o $(LIB)
101 $(CC) -o $@ $^
102
0fd94442 103install: all
f840692f 104# install -m 644 $(LIB) $(prefix)/lib
0fd94442
NK
105ifeq ($(BUILD_SHARED),yes)
106 install -s -m 755 $(SLIB) $(prefix)/lib
107 ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
108 ldconfig
f840692f
NK
109 mkdir -p $(prefix)/include/libffmpeg
110 install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
18c599db 111 install -m 644 common.h $(prefix)/include/libffmpeg/common.h
0fd94442 112endif
d771bcae
FB
113#
114# include dependency files if they exist
115#
116ifneq ($(wildcard .depend),)
117include .depend
118endif