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