consistent include usage
[libav.git] / libavcodec / Makefile
CommitLineData
4cc281d9
FB
1#
2# libavcodec Makefile
3# (c) 2000, 2001, 2002 Gerard Lantau
4#
980fc7b8
FB
5include ../config.mak
6
4cc281d9
FB
7VPATH=$(SRC_PATH)/libavcodec
8
ddad77fa 9CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I$(SRC_PATH) -I..
de6d9b64
FB
10LDFLAGS= -g
11
12OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
10b7b472 13 mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
de6d9b64 14 motion_est.o imgconvert.o imgresample.o msmpeg4.o \
8b4c7dbc
MN
15 mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
16 ratecontrol.o
980fc7b8 17ASM_OBJS=
de6d9b64 18
57514323 19# currently using liba52 for ac3 decoding
d771bcae 20ifeq ($(CONFIG_AC3),yes)
57514323
ZK
21OBJS+= a52dec.o
22endif
23
24# using builtin liba52 or runtime linked liba52.so.0
25ifeq ($(CONFIG_A52BIN),no)
26OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
27 liba52/imdct.o liba52/parse.o
d771bcae 28endif
de6d9b64 29
5798368b
J
30ifeq ($(CONFIG_MP3LAME),yes)
31OBJS += mp3lameaudio.o
2a2a98c0 32EXTRALIBS += -lmp3lame
5798368b
J
33endif
34
43f1708f
J
35ifeq ($(TARGET_GPROF),yes)
36CFLAGS+=-p
37LDFLAGS+=-p
38endif
39
de6d9b64 40# i386 mmx specific stuff
980fc7b8 41ifeq ($(TARGET_MMX),yes)
4300403e 42OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 43 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
57514323 44 i386/idct_mmx.o i386/motion_est_mmx.o \
d962f6fd 45 i386/simple_idct_mmx.o
de6d9b64
FB
46endif
47
3d03c0a2
FB
48# armv4l specific stuff
49ifeq ($(TARGET_ARCH_ARMV4L),yes)
50ASM_OBJS += armv4l/jrevdct_arm.o
51OBJS += armv4l/dsputil_arm.o
52endif
53
c34270f5
FB
54# sun mediaLib specific stuff
55# currently only works when libavcodec is used in mplayer
56ifeq ($(HAVE_MLIB),yes)
57OBJS += mlib/dsputil_mlib.o
58CFLAGS += $(MLIB_INC)
59endif
60
1e98dffb
NK
61# alpha specific stuff
62ifeq ($(TARGET_ARCH_ALPHA),yes)
63OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
64CFLAGS += -Wa,-mpca56
65endif
66
980fc7b8
FB
67SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
68
de6d9b64 69LIB= libavcodec.a
0fd94442
NK
70ifeq ($(BUILD_SHARED),yes)
71SLIB= libffmpeg-$(VERSION).so
72endif
4300403e 73TESTS= imgresample-test dct-test motion-test
de6d9b64 74
0fd94442 75all: $(LIB) $(SLIB)
c10e9f70 76tests: apiexample cpuid_test $(TESTS)
de6d9b64 77
980fc7b8 78$(LIB): $(OBJS) $(ASM_OBJS)
de6d9b64 79 rm -f $@
0f9400b4 80 $(AR) rc $@ $(OBJS) $(ASM_OBJS)
de6d9b64 81
0fd94442
NK
82$(SLIB): $(OBJS) $(ASM_OBJS)
83 rm -f $@
2a2a98c0 84 $(CC) -shared -o $@ $(OBJS) $(ASM_OBJS) $(EXTRALIBS)
0fd94442 85 ln -sf $@ libffmpeg.so
de6d9b64
FB
86dsputil.o: dsputil.c dsputil.h
87
88%.o: %.c
89 $(CC) $(CFLAGS) -c -o $@ $<
90
3d03c0a2
FB
91%.o: %.S
92 $(CC) $(CFLAGS) -c -o $@ $<
93
980fc7b8
FB
94# depend only used by mplayer now
95dep: depend
96
97depend:
98 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
99
de6d9b64 100clean:
1ac9248b 101 rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
3d03c0a2 102 armv4l/*.o armv4l/*~ \
c34270f5 103 mlib/*.o mlib/*~ \
1e98dffb 104 alpha/*.o alpha/*~ \
57514323
ZK
105 liba52/*.o liba52/*~ \
106 apiexample $(TESTS)
de6d9b64 107
980fc7b8
FB
108distclean: clean
109 rm -f Makefile.bak .depend
110
de6d9b64
FB
111# api example program
112apiexample: apiexample.c $(LIB)
113 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
114
c10e9f70
NK
115# cpuid test
116cpuid_test: i386/cputest.c
117 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
118
de6d9b64
FB
119# testing progs
120
121imgresample-test: imgresample.c
122 $(CC) $(CFLAGS) -DTEST -o $@ $^
123
4300403e 124dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
de1ee36a 125 fdctref.o jrevdct.o i386/idct_mmx.o
de6d9b64 126 $(CC) -o $@ $^
d771bcae 127
4300403e
FB
128motion-test: motion_test.o $(LIB)
129 $(CC) -o $@ $^
130
0fd94442 131install: all
f840692f 132# install -m 644 $(LIB) $(prefix)/lib
0fd94442
NK
133ifeq ($(BUILD_SHARED),yes)
134 install -s -m 755 $(SLIB) $(prefix)/lib
135 ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
136 ldconfig
f840692f
NK
137 mkdir -p $(prefix)/include/libffmpeg
138 install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
18c599db 139 install -m 644 common.h $(prefix)/include/libffmpeg/common.h
0fd94442 140endif
d771bcae
FB
141#
142# include dependency files if they exist
143#
144ifneq ($(wildcard .depend),)
145include .depend
146endif