Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 4e8eed2f

History | View | Annotate | Download (6.01 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 1d0d55da Michael Niedermayer
      mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
15 10b7b472 Fabrice Bellard
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
16 1d0d55da Michael Niedermayer
      motion_est.o imgconvert.o imgresample.o \
17
      mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
18 6d2abd6b Fabrice Bellard
      ratecontrol.o adpcm.o eval.o dv.o error_resilience.o \
19 d86053a4 Mike Melanson
      fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o raw.o h264.o golomb.o \
20 b8414bbd Nick Kurshev
      vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o
21 891f64b3 joca@rixmail.se
22
ifeq ($(AMR_NB),yes)
23 bc634f6f Zdenek Kabelac
ifeq ($(AMR_NB_FIXED),yes)
24 891f64b3 joca@rixmail.se
OBJS+= amr.o
25 bc634f6f Zdenek Kabelac
AMREXTRALIBS+= amr/*.o
26
AMRLIBS=amrlibs
27
CLEANAMR=cleanamr
28
else
29
OBJS+= amr.o amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
30
CLEANAMR=cleanamrfloat
31
endif
32 891f64b3 joca@rixmail.se
endif
33
34 980fc7b8 Fabrice Bellard
ASM_OBJS=
35 de6d9b64 Fabrice Bellard
36 1d0d55da Michael Niedermayer
# codecs which are patented in some non free countries like the us
37
ifeq ($(CONFIG_RISKY),yes)
38 deabd4fd Mike Melanson
OBJS+= h263.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o
39 1d0d55da Michael Niedermayer
endif
40
41 57514323 Zdenek Kabelac
# currently using liba52 for ac3 decoding
42 d771bcae Fabrice Bellard
ifeq ($(CONFIG_AC3),yes)
43 57514323 Zdenek Kabelac
OBJS+= a52dec.o
44
45
# using builtin liba52 or runtime linked liba52.so.0
46 ff4ec49e Fabrice Bellard
ifneq ($(CONFIG_A52BIN),yes)
47 57514323 Zdenek Kabelac
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
48 521221cf Arpi
	liba52/imdct.o  liba52/parse.o liba52/crc.o liba52/resample.o
49 d771bcae Fabrice Bellard
endif
50 ff4ec49e Fabrice Bellard
endif
51 de6d9b64 Fabrice Bellard
52 280bd7b7 Zdenek Kabelac
ifeq ($(CONFIG_FAAD),yes)
53
OBJS+= faad.o
54 445ad18d Zdenek Kabelac
ifeq ($(CONFIG_FAADBIN),yes)
55
# no libs needed
56
else
57
EXTRALIBS += -lfaad
58
endif
59 280bd7b7 Zdenek Kabelac
endif
60
61 bba9b16c Michael Niedermayer
ifeq ($(CONFIG_PP),yes)
62
ifeq ($(SHARED_PP),yes)
63
EXTRALIBS += -lpostproc
64
else
65
# LIBS += libpostproc/libpostproc.a ... should be fixed
66
OBJS += libpostproc/postprocess.o
67
endif
68
endif
69
70 5798368b Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
71
OBJS += mp3lameaudio.o
72 2a2a98c0 Zdenek Kabelac
EXTRALIBS += -lmp3lame
73 5798368b Juanjo
endif
74
75 81e0d0b4 Mark Hills
ifeq ($(CONFIG_VORBIS),yes)
76
OBJS += oggvorbis.o
77
EXTRALIBS += -lvorbis -lvorbisenc
78
endif
79
80 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
81
CFLAGS+=-p
82
LDFLAGS+=-p
83
endif
84
85 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
86 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
87 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
88 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
89 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
90 923ceff8 Fabrice Bellard
	i386/simple_idct_mmx.o i386/fft_sse.o
91 a968e365 Fabrice Bellard
ifdef TARGET_BUILTIN_VECTOR
92
i386/fft_sse.o: CFLAGS+= -msse
93
endif
94 de6d9b64 Fabrice Bellard
endif
95
96 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
97
ifeq ($(TARGET_ARCH_ARMV4L),yes)
98
ASM_OBJS += armv4l/jrevdct_arm.o
99 676e200c Michael Niedermayer
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
100 3d03c0a2 Fabrice Bellard
endif
101
102 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
103
# currently only works when libavcodec is used in mplayer
104
ifeq ($(HAVE_MLIB),yes)
105
OBJS += mlib/dsputil_mlib.o
106
CFLAGS += $(MLIB_INC)
107
endif
108
109 1e98dffb Nick Kurshev
# alpha specific stuff
110
ifeq ($(TARGET_ARCH_ALPHA),yes)
111 8b313a47 Falk Hüffner
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
112
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
113 f9bb4bdf Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
114 0af65aac Falk Hüffner
CFLAGS += -fforce-addr -freduce-all-givs
115 1e98dffb Nick Kurshev
endif
116
117 59925ef2 Brian Foley
ifeq ($(TARGET_ARCH_POWERPC),yes)
118 05c4072b Michael Niedermayer
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
119 ab6c65f6 Brian Foley
endif
120
121 d46aba26 Leon van Stuivenberg
ifeq ($(TARGET_MMI),yes)
122 5917d17c Leon van Stuivenberg
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
123 d46aba26 Leon van Stuivenberg
endif
124
125 ab6c65f6 Brian Foley
ifeq ($(TARGET_ALTIVEC),yes)
126 3b991c54 Romain Dolbeau
ifeq ($(TARGET_OS),Darwin)
127 59925ef2 Brian Foley
CFLAGS += -faltivec
128 3b991c54 Romain Dolbeau
else
129
CFLAGS += -maltivec -mabi=altivec
130
endif
131 8d268a7d Fabrice Bellard
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
132 e629ab68 Romain Dolbeau
        ppc/fft_altivec.o ppc/gmc_altivec.o
133 59925ef2 Brian Foley
endif
134
135 0c6bd2ea BERO
ifeq ($(TARGET_ARCH_SH4),yes)
136
OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
137
endif
138
139
140 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
141 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
142 980fc7b8 Fabrice Bellard
143 f3ec2d46 Slavik Gnatenko
LIB= $(LIBPREF)avcodec$(LIBSUF)
144 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
145 f3ec2d46 Slavik Gnatenko
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
146 0fd94442 Nick Kurshev
endif
147 6d2abd6b Fabrice Bellard
TESTS= imgresample-test dct-test motion-test fft-test
148 de6d9b64 Fabrice Bellard
149 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
150 ff4ec49e Fabrice Bellard
151 bc634f6f Zdenek Kabelac
amrlibs:
152
	$(MAKE) -C amr spclib fipoplib
153
154 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
155 de6d9b64 Fabrice Bellard
156 bc634f6f Zdenek Kabelac
$(LIB): $(OBJS) $(AMRLIBS)
157 de6d9b64 Fabrice Bellard
	rm -f $@
158 bc634f6f Zdenek Kabelac
	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
159 be7109c1 Michael Niedermayer
	$(RANLIB) $@
160 ff4ec49e Fabrice Bellard
161 811b32ed Fabrice Bellard
$(SLIB): $(OBJS)
162 bc634f6f Zdenek Kabelac
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
163 de6d9b64 Fabrice Bellard
164
dsputil.o: dsputil.c dsputil.h
165
166 bba9b16c Michael Niedermayer
libpostproc/libpostproc.a:
167
	$(MAKE) -C libpostproc
168
169 de6d9b64 Fabrice Bellard
%.o: %.c
170
	$(CC) $(CFLAGS) -c -o $@ $< 
171
172 3d03c0a2 Fabrice Bellard
%.o: %.S
173
	$(CC) $(CFLAGS) -c -o $@ $<
174
175 0af65aac Falk Hüffner
# motion_est_alpha uses the MVI extension, which is not available with
176
# -mcpu=ev4 (default) or ev5/ev56. Thus, force -mcpu=pca56 in those
177
# cases.
178
ifeq ($(TARGET_ARCH_ALPHA),yes)
179
alpha/motion_est_alpha.o: alpha/motion_est_alpha.c
180
	cpu=`echo "$(CFLAGS)" | sed -n 's,.*-mcpu=\([a-zA-Z0-9]*\).*,\1,p'`; \
181
	case x"$$cpu" in x|xev[45]*) newcpu=pca56;; *) newcpu=$$cpu;; esac; \
182
	echo $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<;\
183
	$(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<
184
endif
185
186 811b32ed Fabrice Bellard
depend: $(SRCS)
187 a968e365 Fabrice Bellard
	$(CC) -MM $(CFLAGS) $^ 1>.depend
188 e51d4def Arpi
189 980fc7b8 Fabrice Bellard
dep:	depend
190
191 bc634f6f Zdenek Kabelac
clean: $(CLEANAMR)
192 77b71ddc Philip Gladstone
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
193 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
194 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
195 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
196 59925ef2 Brian Foley
	   ppc/*.o ppc/*~ \
197 d46aba26 Leon van Stuivenberg
	   ps2/*.o ps2/*~ \
198 0c6bd2ea BERO
	   sh4/*.o sh4/*~ \
199 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
200
	   apiexample $(TESTS)
201 64094f37 Zdenek Kabelac
	$(MAKE) -C libpostproc clean
202 de6d9b64 Fabrice Bellard
203 800d7ceb Felix Bünemann
distclean: clean
204 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
205
206 bc634f6f Zdenek Kabelac
cleanamr:
207
	$(MAKE) -C amr clean
208
209
cleanamrfloat:
210
	rm -f amr_float/*.o
211
212 de6d9b64 Fabrice Bellard
# api example program
213
apiexample: apiexample.c $(LIB)
214 cfda33cb Michael Niedermayer
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
215 de6d9b64 Fabrice Bellard
216 c10e9f70 Nick Kurshev
# cpuid test
217
cpuid_test: i386/cputest.c
218
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
219
220 de6d9b64 Fabrice Bellard
# testing progs
221
222
imgresample-test: imgresample.c
223 6acce86b Michael Niedermayer
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
224 de6d9b64 Fabrice Bellard
225 9ebc63a9 Fabrice Bellard
dct-test: dct-test.o fdctref.o $(LIB)
226 90cee0c3 Michael Niedermayer
	$(CC) -o $@ $^ -lm
227 d771bcae Fabrice Bellard
228 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
229 6acce86b Michael Niedermayer
	$(CC) -o $@ $^ -lm
230 4300403e Fabrice Bellard
231 923ceff8 Fabrice Bellard
fft-test: fft-test.o $(LIB)
232 6d2abd6b Fabrice Bellard
	$(CC) -o $@ $^ -lm
233
234 0fd94442 Nick Kurshev
install: all
235
ifeq ($(BUILD_SHARED),yes)
236 c1325d18 Volker Moell
	install -d $(prefix)/lib
237 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
238 c1325d18 Volker Moell
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
239
	ldconfig || true
240 ff4ec49e Fabrice Bellard
	mkdir -p $(prefix)/include/ffmpeg
241 3565eeaa Falk Hüffner
	install -m 644 $(VPATH)/avcodec.h $(prefix)/include/ffmpeg/avcodec.h
242
	install -m 644 $(VPATH)/common.h $(prefix)/include/ffmpeg/common.h
243 0fd94442 Nick Kurshev
endif
244 773cefc6 Fabrice Bellard
245
installlib: all
246
	install -m 644 $(LIB) $(prefix)/lib
247
	mkdir -p $(prefix)/include/ffmpeg
248
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
249
                $(prefix)/include/ffmpeg
250
251 d771bcae Fabrice Bellard
#
252
# include dependency files if they exist
253
#
254
ifneq ($(wildcard .depend),)
255
include .depend
256
endif