Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 5917d17c

History | View | Annotate | Download (4.52 KB)

1 4cc281d9 Fabrice Bellard
#
2
# libavcodec Makefile
3 ff4ec49e Fabrice Bellard
# (c) 2000, 2001, 2002 Fabrice Bellard
4 4cc281d9 Fabrice Bellard
#
5 980fc7b8 Fabrice Bellard
include ../config.mak
6
7 4cc281d9 Fabrice Bellard
VPATH=$(SRC_PATH)/libavcodec
8
9 ff4ec49e Fabrice Bellard
# NOTE: -I.. is needed to include config.h
10 eddbd7e5 Roy Sigurd Karlsbakk
CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
11 de6d9b64 Fabrice Bellard
LDFLAGS= -g
12
13 773cefc6 Fabrice Bellard
OBJS= common.o utils.o mem.o allcodecs.o \
14 28db7fce Michael Niedermayer
      mpegvideo.o h263.o jrevdct.o jfdctfst.o jfdctint.o\
15 10b7b472 Fabrice Bellard
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
16 de6d9b64 Fabrice Bellard
      motion_est.o imgconvert.o imgresample.o msmpeg4.o \
17 be8ffec9 Nick Kurshev
      mpeg12.o h263dec.o svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
18 3aa102be Michael Niedermayer
      ratecontrol.o adpcm.o eval.o
19 980fc7b8 Fabrice Bellard
ASM_OBJS=
20 de6d9b64 Fabrice Bellard
21 57514323 Zdenek Kabelac
# currently using liba52 for ac3 decoding
22 d771bcae Fabrice Bellard
ifeq ($(CONFIG_AC3),yes)
23 57514323 Zdenek Kabelac
OBJS+= a52dec.o
24
25
# using builtin liba52 or runtime linked liba52.so.0
26 ff4ec49e Fabrice Bellard
ifneq ($(CONFIG_A52BIN),yes)
27 57514323 Zdenek Kabelac
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
28
	liba52/imdct.o  liba52/parse.o
29 d771bcae Fabrice Bellard
endif
30 ff4ec49e Fabrice Bellard
endif
31 de6d9b64 Fabrice Bellard
32 5798368b Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
33
OBJS += mp3lameaudio.o
34 2a2a98c0 Zdenek Kabelac
EXTRALIBS += -lmp3lame
35 5798368b Juanjo
endif
36
37 81e0d0b4 Mark Hills
ifeq ($(CONFIG_VORBIS),yes)
38
OBJS += oggvorbis.o
39
EXTRALIBS += -lvorbis -lvorbisenc
40
endif
41
42 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
43
CFLAGS+=-p
44
LDFLAGS+=-p
45
endif
46
47 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
48 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
49 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
50 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
51 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
52 d962f6fd Arpi
	i386/simple_idct_mmx.o
53 de6d9b64 Fabrice Bellard
endif
54
55 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
56
ifeq ($(TARGET_ARCH_ARMV4L),yes)
57
ASM_OBJS += armv4l/jrevdct_arm.o
58
OBJS += armv4l/dsputil_arm.o
59
endif
60
61 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
62
# currently only works when libavcodec is used in mplayer
63
ifeq ($(HAVE_MLIB),yes)
64
OBJS += mlib/dsputil_mlib.o
65
CFLAGS += $(MLIB_INC)
66
endif
67
68 1e98dffb Nick Kurshev
# alpha specific stuff
69
ifeq ($(TARGET_ARCH_ALPHA),yes)
70 57d2bce1 Falk Hüffner
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o alpha/motion_est_alpha.o
71 f9bb4bdf Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
72 0af65aac Falk Hüffner
CFLAGS += -fforce-addr -freduce-all-givs
73 1e98dffb Nick Kurshev
endif
74
75 59925ef2 Brian Foley
ifeq ($(TARGET_ARCH_POWERPC),yes)
76 ab6c65f6 Brian Foley
OBJS += ppc/dsputil_ppc.o
77
endif
78
79 d46aba26 Leon van Stuivenberg
ifeq ($(TARGET_MMI),yes)
80 5917d17c Leon van Stuivenberg
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
81 d46aba26 Leon van Stuivenberg
endif
82
83 ab6c65f6 Brian Foley
ifeq ($(TARGET_ALTIVEC),yes)
84 59925ef2 Brian Foley
CFLAGS += -faltivec
85
OBJS += ppc/dsputil_altivec.o
86
endif
87
88 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
89 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
90 980fc7b8 Fabrice Bellard
91 de6d9b64 Fabrice Bellard
LIB= libavcodec.a
92 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
93 ff4ec49e Fabrice Bellard
SLIB= libavcodec.so
94 0fd94442 Nick Kurshev
endif
95 4300403e Fabrice Bellard
TESTS= imgresample-test dct-test motion-test
96 de6d9b64 Fabrice Bellard
97 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
98 ff4ec49e Fabrice Bellard
99 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
100 de6d9b64 Fabrice Bellard
101 ff4ec49e Fabrice Bellard
$(LIB): $(OBJS)
102 de6d9b64 Fabrice Bellard
	rm -f $@
103 be7109c1 Michael Niedermayer
	$(AR) rc $@ $(OBJS)
104
	$(RANLIB) $@
105 ff4ec49e Fabrice Bellard
106
$(SLIB): $(OBJS)
107 e1707f52 Michael Niedermayer
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
108 de6d9b64 Fabrice Bellard
109
dsputil.o: dsputil.c dsputil.h
110
111
%.o: %.c
112
	$(CC) $(CFLAGS) -c -o $@ $< 
113
114 3d03c0a2 Fabrice Bellard
%.o: %.S
115
	$(CC) $(CFLAGS) -c -o $@ $<
116
117 0af65aac Falk Hüffner
# motion_est_alpha uses the MVI extension, which is not available with
118
# -mcpu=ev4 (default) or ev5/ev56. Thus, force -mcpu=pca56 in those
119
# cases.
120
ifeq ($(TARGET_ARCH_ALPHA),yes)
121
alpha/motion_est_alpha.o: alpha/motion_est_alpha.c
122
	cpu=`echo "$(CFLAGS)" | sed -n 's,.*-mcpu=\([a-zA-Z0-9]*\).*,\1,p'`; \
123
	case x"$$cpu" in x|xev[45]*) newcpu=pca56;; *) newcpu=$$cpu;; esac; \
124
	echo $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<;\
125
	$(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<
126
endif
127
128 980fc7b8 Fabrice Bellard
# depend only used by mplayer now
129
dep:	depend
130
131
depend:
132
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
133
134 de6d9b64 Fabrice Bellard
clean: 
135 1ac9248b Zdenek Kabelac
	rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
136 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
137 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
138 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
139 59925ef2 Brian Foley
	   ppc/*.o ppc/*~ \
140 d46aba26 Leon van Stuivenberg
	   ps2/*.o ps2/*~ \
141 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
142
	   apiexample $(TESTS)
143 de6d9b64 Fabrice Bellard
144 800d7ceb Felix Bünemann
distclean: clean
145 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
146
147 de6d9b64 Fabrice Bellard
# api example program
148
apiexample: apiexample.c $(LIB)
149 cfda33cb Michael Niedermayer
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
150 de6d9b64 Fabrice Bellard
151 c10e9f70 Nick Kurshev
# cpuid test
152
cpuid_test: i386/cputest.c
153
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
154
155 de6d9b64 Fabrice Bellard
# testing progs
156
157
imgresample-test: imgresample.c
158 6acce86b Michael Niedermayer
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
159 de6d9b64 Fabrice Bellard
160 86748dbc Michael Niedermayer
dct-test: dct-test.o jfdctfst.o jfdctint.o i386/fdct_mmx.o\
161
          fdctref.o jrevdct.o i386/idct_mmx.o simple_idct.o i386/simple_idct_mmx.o
162 90cee0c3 Michael Niedermayer
	$(CC) -o $@ $^ -lm
163 d771bcae Fabrice Bellard
164 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
165 6acce86b Michael Niedermayer
	$(CC) -o $@ $^ -lm
166 4300403e Fabrice Bellard
167 0fd94442 Nick Kurshev
install: all
168
ifeq ($(BUILD_SHARED),yes)
169 c1325d18 Volker Moell
	install -d $(prefix)/lib
170 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
171 c1325d18 Volker Moell
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
172
	ldconfig || true
173 ff4ec49e Fabrice Bellard
	mkdir -p $(prefix)/include/ffmpeg
174
	install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
175
	install -m 644 common.h $(prefix)/include/ffmpeg/common.h
176 0fd94442 Nick Kurshev
endif
177 773cefc6 Fabrice Bellard
178
installlib: all
179
	install -m 644 $(LIB) $(prefix)/lib
180
	mkdir -p $(prefix)/include/ffmpeg
181
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
182
                $(prefix)/include/ffmpeg
183
184 d771bcae Fabrice Bellard
#
185
# include dependency files if they exist
186
#
187
ifneq ($(wildcard .depend),)
188
include .depend
189
endif