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