Tweak Alpha compiler flags.
[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
773cefc6
FB
13OBJS= common.o utils.o mem.o allcodecs.o \
14 mpegvideo.o h263.o jrevdct.o jfdctfst.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 \
8b4c7dbc 18 ratecontrol.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)
65OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_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
bb7d4939 70SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
ff4ec49e 71OBJS := $(OBJS) $(ASM_OBJS)
980fc7b8 72
de6d9b64 73LIB= libavcodec.a
0fd94442 74ifeq ($(BUILD_SHARED),yes)
ff4ec49e 75SLIB= libavcodec.so
0fd94442 76endif
4300403e 77TESTS= imgresample-test dct-test motion-test
de6d9b64 78
0fd94442 79all: $(LIB) $(SLIB)
ff4ec49e 80
c10e9f70 81tests: apiexample cpuid_test $(TESTS)
de6d9b64 82
ff4ec49e 83$(LIB): $(OBJS)
de6d9b64 84 rm -f $@
ff4ec49e
FB
85 $(AR) rc $@ $(OBJS)
86
87$(SLIB): $(OBJS)
88 $(CC) -shared -o $@ $(OBJS) $(EXTRALIBS)
de6d9b64
FB
89
90dsputil.o: dsputil.c dsputil.h
91
92%.o: %.c
93 $(CC) $(CFLAGS) -c -o $@ $<
94
3d03c0a2
FB
95%.o: %.S
96 $(CC) $(CFLAGS) -c -o $@ $<
97
980fc7b8
FB
98# depend only used by mplayer now
99dep: depend
100
101depend:
102 $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
103
de6d9b64 104clean:
1ac9248b 105 rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
3d03c0a2 106 armv4l/*.o armv4l/*~ \
c34270f5 107 mlib/*.o mlib/*~ \
1e98dffb 108 alpha/*.o alpha/*~ \
57514323
ZK
109 liba52/*.o liba52/*~ \
110 apiexample $(TESTS)
de6d9b64 111
800d7ceb 112distclean: clean
980fc7b8
FB
113 rm -f Makefile.bak .depend
114
de6d9b64
FB
115# api example program
116apiexample: apiexample.c $(LIB)
117 $(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
118
c10e9f70
NK
119# cpuid test
120cpuid_test: i386/cputest.c
121 $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
122
de6d9b64
FB
123# testing progs
124
125imgresample-test: imgresample.c
126 $(CC) $(CFLAGS) -DTEST -o $@ $^
127
4300403e 128dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
de1ee36a 129 fdctref.o jrevdct.o i386/idct_mmx.o
de6d9b64 130 $(CC) -o $@ $^
d771bcae 131
4300403e
FB
132motion-test: motion_test.o $(LIB)
133 $(CC) -o $@ $^
134
0fd94442 135install: all
0fd94442 136ifeq ($(BUILD_SHARED),yes)
ff4ec49e
FB
137 install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
138 ln -sf $(prefix)/lib/libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
0fd94442 139 ldconfig
ff4ec49e
FB
140 mkdir -p $(prefix)/include/ffmpeg
141 install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
142 install -m 644 common.h $(prefix)/include/ffmpeg/common.h
0fd94442 143endif
773cefc6
FB
144
145installlib: all
146 install -m 644 $(LIB) $(prefix)/lib
147 mkdir -p $(prefix)/include/ffmpeg
148 install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
149 $(prefix)/include/ffmpeg
150
d771bcae
FB
151#
152# include dependency files if they exist
153#
154ifneq ($(wildcard .depend),)
155include .depend
156endif