dct cleanup
[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 9# NOTE: -I.. is needed to include config.h
eddbd7e5 10CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
de6d9b64
FB
11LDFLAGS= -g
12
773cefc6 13OBJS= common.o utils.o mem.o allcodecs.o \
28db7fce 14 mpegvideo.o h263.o jrevdct.o jfdctfst.o jfdctint.o\
10b7b472 15 mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
de6d9b64 16 motion_est.o imgconvert.o imgresample.o msmpeg4.o \
be8ffec9 17 mpeg12.o h263dec.o svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
3aa102be 18 ratecontrol.o adpcm.o eval.o
980fc7b8 19ASM_OBJS=
de6d9b64 20
57514323 21# currently using liba52 for ac3 decoding
d771bcae 22ifeq ($(CONFIG_AC3),yes)
57514323 23OBJS+= a52dec.o
57514323
ZK
24
25# using builtin liba52 or runtime linked liba52.so.0
ff4ec49e 26ifneq ($(CONFIG_A52BIN),yes)
57514323
ZK
27OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
28 liba52/imdct.o liba52/parse.o
d771bcae 29endif
ff4ec49e 30endif
de6d9b64 31
5798368b
J
32ifeq ($(CONFIG_MP3LAME),yes)
33OBJS += mp3lameaudio.o
2a2a98c0 34EXTRALIBS += -lmp3lame
5798368b
J
35endif
36
43f1708f
J
37ifeq ($(TARGET_GPROF),yes)
38CFLAGS+=-p
39LDFLAGS+=-p
40endif
41
de6d9b64 42# i386 mmx specific stuff
980fc7b8 43ifeq ($(TARGET_MMX),yes)
4300403e 44OBJS += i386/fdct_mmx.o i386/cputest.o \
de1ee36a 45 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
57514323 46 i386/idct_mmx.o i386/motion_est_mmx.o \
d962f6fd 47 i386/simple_idct_mmx.o
de6d9b64
FB
48endif
49
3d03c0a2
FB
50# armv4l specific stuff
51ifeq ($(TARGET_ARCH_ARMV4L),yes)
52ASM_OBJS += armv4l/jrevdct_arm.o
53OBJS += armv4l/dsputil_arm.o
54endif
55
c34270f5
FB
56# sun mediaLib specific stuff
57# currently only works when libavcodec is used in mplayer
58ifeq ($(HAVE_MLIB),yes)
59OBJS += mlib/dsputil_mlib.o
60CFLAGS += $(MLIB_INC)
61endif
62
1e98dffb
NK
63# alpha specific stuff
64ifeq ($(TARGET_ARCH_ALPHA),yes)
57d2bce1 65OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o alpha/motion_est_alpha.o
bb7d4939 66ASM_OBJS += alpha/dsputil_alpha_asm.o
14ac09bf 67CFLAGS += -Wa,-mpca56 -finline-limit=8000 -fforce-addr -freduce-all-givs
1e98dffb
NK
68endif
69
59925ef2
BF
70ifeq ($(TARGET_ARCH_POWERPC),yes)
71CFLAGS += -faltivec
72OBJS += ppc/dsputil_altivec.o
73endif
74
bb7d4939 75SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
ff4ec49e 76OBJS := $(OBJS) $(ASM_OBJS)
980fc7b8 77
de6d9b64 78LIB= libavcodec.a
0fd94442 79ifeq ($(BUILD_SHARED),yes)
ff4ec49e 80SLIB= libavcodec.so
0fd94442 81endif
4300403e 82TESTS= imgresample-test dct-test motion-test
de6d9b64 83
0fd94442 84all: $(LIB) $(SLIB)
ff4ec49e 85
c10e9f70 86tests: apiexample cpuid_test $(TESTS)
de6d9b64 87
ff4ec49e 88$(LIB): $(OBJS)
de6d9b64 89 rm -f $@
90cee0c3 90 $(AR) rcs $@ $(OBJS)
ff4ec49e
FB
91
92$(SLIB): $(OBJS)
e1707f52 93 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
de6d9b64
FB
94
95dsputil.o: dsputil.c dsputil.h
96
97%.o: %.c
98 $(CC) $(CFLAGS) -c -o $@ $<
99
3d03c0a2
FB
100%.o: %.S
101 $(CC) $(CFLAGS) -c -o $@ $<
102
980fc7b8
FB
103# depend only used by mplayer now
104dep: depend
105
106depend:
107 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
108
de6d9b64 109clean:
1ac9248b 110 rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
3d03c0a2 111 armv4l/*.o armv4l/*~ \
c34270f5 112 mlib/*.o mlib/*~ \
1e98dffb 113 alpha/*.o alpha/*~ \
59925ef2 114 ppc/*.o ppc/*~ \
57514323
ZK
115 liba52/*.o liba52/*~ \
116 apiexample $(TESTS)
de6d9b64 117
800d7ceb 118distclean: clean
980fc7b8
FB
119 rm -f Makefile.bak .depend
120
de6d9b64
FB
121# api example program
122apiexample: apiexample.c $(LIB)
123 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
124
c10e9f70
NK
125# cpuid test
126cpuid_test: i386/cputest.c
127 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
128
de6d9b64
FB
129# testing progs
130
131imgresample-test: imgresample.c
132 $(CC) $(CFLAGS) -DTEST -o $@ $^
133
86748dbc
MN
134dct-test: dct-test.o jfdctfst.o jfdctint.o i386/fdct_mmx.o\
135 fdctref.o jrevdct.o i386/idct_mmx.o simple_idct.o i386/simple_idct_mmx.o
90cee0c3 136 $(CC) -o $@ $^ -lm
d771bcae 137
4300403e
FB
138motion-test: motion_test.o $(LIB)
139 $(CC) -o $@ $^
140
0fd94442 141install: all
0fd94442 142ifeq ($(BUILD_SHARED),yes)
c1325d18 143 install -d $(prefix)/lib
ff4ec49e 144 install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
c1325d18
VM
145 ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
146 ldconfig || true
ff4ec49e
FB
147 mkdir -p $(prefix)/include/ffmpeg
148 install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
149 install -m 644 common.h $(prefix)/include/ffmpeg/common.h
0fd94442 150endif
773cefc6
FB
151
152installlib: all
153 install -m 644 $(LIB) $(prefix)/lib
154 mkdir -p $(prefix)/include/ffmpeg
155 install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
156 $(prefix)/include/ffmpeg
157
d771bcae
FB
158#
159# include dependency files if they exist
160#
161ifneq ($(wildcard .depend),)
162include .depend
163endif