Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ cbdd9b53

History | View | Annotate | Download (6.85 KB)

1 4cc281d9 Fabrice Bellard
#
2
# libavcodec Makefile
3 cf7412b5 Fabrice Bellard
# (c) 2000-2003 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 cf9d24ad Dan Christiansen
CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
11 de6d9b64 Fabrice Bellard
12 773cefc6 Fabrice Bellard
OBJS= common.o utils.o mem.o allcodecs.o \
13 1d0d55da Michael Niedermayer
      mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
14 10b7b472 Fabrice Bellard
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
15 1d0d55da Michael Niedermayer
      motion_est.o imgconvert.o imgresample.o \
16 4f1bb8a9 Ivan Kalvachev
      mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
17 6d2abd6b Fabrice Bellard
      ratecontrol.o adpcm.o eval.o dv.o error_resilience.o \
18 d86053a4 Mike Melanson
      fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o raw.o h264.o golomb.o \
19 3ef8be2b Mike Melanson
      vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o vcr1.o cljr.o \
20 2fdf638b Mike Melanson
      roqvideo.o dpcm.o interplayvideo.o xan.o rpza.o cinepak.o msrle.o \
21 11e29a41 Mike Melanson
      msvideo1.o vqavideo.o idcinvideo.o adx.o rational.o faandct.o 8bps.o \
22 ac2570a8 Michael Niedermayer
      smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o g726.o \
23 44cb64ee Mike Melanson
      flac.o vp3dsp.o
24 891f64b3 joca@rixmail.se
25
ifeq ($(AMR_NB),yes)
26 bc634f6f Zdenek Kabelac
ifeq ($(AMR_NB_FIXED),yes)
27 891f64b3 joca@rixmail.se
OBJS+= amr.o
28 bc634f6f Zdenek Kabelac
AMREXTRALIBS+= amr/*.o
29
AMRLIBS=amrlibs
30
CLEANAMR=cleanamr
31
else
32
OBJS+= amr.o amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
33
CLEANAMR=cleanamrfloat
34
endif
35 891f64b3 joca@rixmail.se
endif
36
37 9c3d33d6 Michael Niedermayer
ifeq ($(HAVE_PTHREADS),yes)
38
OBJS+= pthread.o
39
endif
40
41 16806499 Michael Niedermayer
ifeq ($(HAVE_W32THREADS),yes)
42
OBJS+= w32thread.o
43
endif
44
45 d663a1fd Michael Niedermayer
ifeq ($(AMR_WB),yes)
46
OBJS+= amr.o amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
47
		amrwb_float/dec_if.o amrwb_float/dec_lpc.o amrwb_float/dec_main.o \
48
		amrwb_float/dec_rom.o amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
49
		amrwb_float/enc_dtx.o amrwb_float/enc_gain.o amrwb_float/enc_if.o \
50
		amrwb_float/enc_lpc.o amrwb_float/enc_main.o amrwb_float/enc_rom.o \
51
		amrwb_float/enc_util.o amrwb_float/if_rom.o
52
endif
53
CLEANAMRWB=cleanamrwbfloat
54 980fc7b8 Fabrice Bellard
ASM_OBJS=
55 de6d9b64 Fabrice Bellard
56 1d0d55da Michael Niedermayer
# codecs which are patented in some non free countries like the us
57
ifeq ($(CONFIG_RISKY),yes)
58 deabd4fd Mike Melanson
OBJS+= h263.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o
59 1d0d55da Michael Niedermayer
endif
60
61 4f1bb8a9 Ivan Kalvachev
ifeq ($(HAVE_XVMC_ACCEL),yes)
62
OBJS+= xvmcvideo.o
63
endif
64
65 57514323 Zdenek Kabelac
# currently using liba52 for ac3 decoding
66 d771bcae Fabrice Bellard
ifeq ($(CONFIG_AC3),yes)
67 57514323 Zdenek Kabelac
OBJS+= a52dec.o
68
69
# using builtin liba52 or runtime linked liba52.so.0
70 ff4ec49e Fabrice Bellard
ifneq ($(CONFIG_A52BIN),yes)
71 57514323 Zdenek Kabelac
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
72 521221cf Arpi
	liba52/imdct.o  liba52/parse.o liba52/crc.o liba52/resample.o
73 d771bcae Fabrice Bellard
endif
74 ff4ec49e Fabrice Bellard
endif
75 de6d9b64 Fabrice Bellard
76 280bd7b7 Zdenek Kabelac
ifeq ($(CONFIG_FAAD),yes)
77
OBJS+= faad.o
78 445ad18d Zdenek Kabelac
ifeq ($(CONFIG_FAADBIN),yes)
79
# no libs needed
80
else
81
EXTRALIBS += -lfaad
82
endif
83 280bd7b7 Zdenek Kabelac
endif
84
85 29d48296 Michael Niedermayer
ifeq ($(CONFIG_FAAC),yes)
86
OBJS+= faac.o
87
EXTRALIBS += -lfaac
88
endif
89
90 bba9b16c Michael Niedermayer
ifeq ($(CONFIG_PP),yes)
91
ifeq ($(SHARED_PP),yes)
92
EXTRALIBS += -lpostproc
93
else
94
# LIBS += libpostproc/libpostproc.a ... should be fixed
95
OBJS += libpostproc/postprocess.o
96
endif
97
endif
98
99 5798368b Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
100
OBJS += mp3lameaudio.o
101 2a2a98c0 Zdenek Kabelac
EXTRALIBS += -lmp3lame
102 5798368b Juanjo
endif
103
104 81e0d0b4 Mark Hills
ifeq ($(CONFIG_VORBIS),yes)
105
OBJS += oggvorbis.o
106
EXTRALIBS += -lvorbis -lvorbisenc
107
endif
108
109 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
110
CFLAGS+=-p
111
LDFLAGS+=-p
112
endif
113
114 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
115 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
116 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
117 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
118 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
119 44cb64ee Mike Melanson
	i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o
120 a968e365 Fabrice Bellard
ifdef TARGET_BUILTIN_VECTOR
121
i386/fft_sse.o: CFLAGS+= -msse
122 148beec7 Zdenek Kabelac
depend: CFLAGS+= -msse
123 a968e365 Fabrice Bellard
endif
124 de6d9b64 Fabrice Bellard
endif
125
126 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
127
ifeq ($(TARGET_ARCH_ARMV4L),yes)
128 bd7d1ea7 Alex Beregszaszi
ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o
129 676e200c Michael Niedermayer
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
130 3d03c0a2 Fabrice Bellard
endif
131
132 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
133
# currently only works when libavcodec is used in mplayer
134
ifeq ($(HAVE_MLIB),yes)
135
OBJS += mlib/dsputil_mlib.o
136
CFLAGS += $(MLIB_INC)
137
endif
138
139 1e98dffb Nick Kurshev
# alpha specific stuff
140
ifeq ($(TARGET_ARCH_ALPHA),yes)
141 8b313a47 Falk Hüffner
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
142
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
143 f9bb4bdf Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
144 0af65aac Falk Hüffner
CFLAGS += -fforce-addr -freduce-all-givs
145 1e98dffb Nick Kurshev
endif
146
147 59925ef2 Brian Foley
ifeq ($(TARGET_ARCH_POWERPC),yes)
148 05c4072b Michael Niedermayer
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
149 ab6c65f6 Brian Foley
endif
150
151 d46aba26 Leon van Stuivenberg
ifeq ($(TARGET_MMI),yes)
152 5917d17c Leon van Stuivenberg
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
153 d46aba26 Leon van Stuivenberg
endif
154
155 ab6c65f6 Brian Foley
ifeq ($(TARGET_ALTIVEC),yes)
156 8d268a7d Fabrice Bellard
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
157 14cabd40 James Klicman
        ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o
158 59925ef2 Brian Foley
endif
159
160 0c6bd2ea BERO
ifeq ($(TARGET_ARCH_SH4),yes)
161
OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
162
endif
163
164 cbdd9b53 Roman Shaposhnik
ifeq ($(TARGET_ARCH_SPARC64),yes)
165 44f54ceb Michael Niedermayer
OBJS+=sparc/dsputil_vis.o
166
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
167
endif
168
169 0c6bd2ea BERO
170 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
171 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
172 980fc7b8 Fabrice Bellard
173 f3ec2d46 Slavik Gnatenko
LIB= $(LIBPREF)avcodec$(LIBSUF)
174 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
175 f3ec2d46 Slavik Gnatenko
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
176 0fd94442 Nick Kurshev
endif
177 6d2abd6b Fabrice Bellard
TESTS= imgresample-test dct-test motion-test fft-test
178 de6d9b64 Fabrice Bellard
179 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
180 ff4ec49e Fabrice Bellard
181 bc634f6f Zdenek Kabelac
amrlibs:
182
	$(MAKE) -C amr spclib fipoplib
183
184 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
185 de6d9b64 Fabrice Bellard
186 bc634f6f Zdenek Kabelac
$(LIB): $(OBJS) $(AMRLIBS)
187 de6d9b64 Fabrice Bellard
	rm -f $@
188 bc634f6f Zdenek Kabelac
	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
189 be7109c1 Michael Niedermayer
	$(RANLIB) $@
190 ff4ec49e Fabrice Bellard
191 811b32ed Fabrice Bellard
$(SLIB): $(OBJS)
192 cf7412b5 Fabrice Bellard
ifeq ($(CONFIG_WIN32),yes)
193
	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
194
	-lib /machine:i386 /def:$(@:.dll=.def)
195
else
196 1b8b121f Michael T. Dean
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
197 cf7412b5 Fabrice Bellard
endif
198 de6d9b64 Fabrice Bellard
199
dsputil.o: dsputil.c dsputil.h
200
201 bba9b16c Michael Niedermayer
libpostproc/libpostproc.a:
202
	$(MAKE) -C libpostproc
203
204 de6d9b64 Fabrice Bellard
%.o: %.c
205
	$(CC) $(CFLAGS) -c -o $@ $< 
206
207 3d03c0a2 Fabrice Bellard
%.o: %.S
208
	$(CC) $(CFLAGS) -c -o $@ $<
209
210 811b32ed Fabrice Bellard
depend: $(SRCS)
211 a968e365 Fabrice Bellard
	$(CC) -MM $(CFLAGS) $^ 1>.depend
212 e51d4def Arpi
213 980fc7b8 Fabrice Bellard
dep:	depend
214
215 bc634f6f Zdenek Kabelac
clean: $(CLEANAMR)
216 77b71ddc Philip Gladstone
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
217 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
218 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
219 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
220 59925ef2 Brian Foley
	   ppc/*.o ppc/*~ \
221 d46aba26 Leon van Stuivenberg
	   ps2/*.o ps2/*~ \
222 0c6bd2ea BERO
	   sh4/*.o sh4/*~ \
223 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
224
	   apiexample $(TESTS)
225 64094f37 Zdenek Kabelac
	$(MAKE) -C libpostproc clean
226 de6d9b64 Fabrice Bellard
227 800d7ceb Felix Bünemann
distclean: clean
228 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
229
230 bc634f6f Zdenek Kabelac
cleanamr:
231
	$(MAKE) -C amr clean
232
233
cleanamrfloat:
234
	rm -f amr_float/*.o
235
236 d663a1fd Michael Niedermayer
cleanamrwbfloat:
237
	$(MAKE) -C amrwb_float -f makefile.gcc clean
238
239 de6d9b64 Fabrice Bellard
# api example program
240
apiexample: apiexample.c $(LIB)
241 cfda33cb Michael Niedermayer
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
242 de6d9b64 Fabrice Bellard
243 c10e9f70 Nick Kurshev
# cpuid test
244
cpuid_test: i386/cputest.c
245
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
246
247 de6d9b64 Fabrice Bellard
# testing progs
248
249
imgresample-test: imgresample.c
250 6acce86b Michael Niedermayer
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
251 de6d9b64 Fabrice Bellard
252 9ebc63a9 Fabrice Bellard
dct-test: dct-test.o fdctref.o $(LIB)
253 90cee0c3 Michael Niedermayer
	$(CC) -o $@ $^ -lm
254 d771bcae Fabrice Bellard
255 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
256 6acce86b Michael Niedermayer
	$(CC) -o $@ $^ -lm
257 4300403e Fabrice Bellard
258 923ceff8 Fabrice Bellard
fft-test: fft-test.o $(LIB)
259 6d2abd6b Fabrice Bellard
	$(CC) -o $@ $^ -lm
260
261 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
262 cb728d79 Fabrice Bellard
install: all install-headers
263
ifeq ($(CONFIG_WIN32),yes)
264
	install -s -m 755 $(SLIB) "$(prefix)"
265
else
266 c1325d18 Volker Moell
	install -d $(prefix)/lib
267 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
268 c1325d18 Volker Moell
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
269
	ldconfig || true
270 cb728d79 Fabrice Bellard
endif
271
else
272
install:
273 0fd94442 Nick Kurshev
endif
274 773cefc6 Fabrice Bellard
275 cb728d79 Fabrice Bellard
installlib: all install-headers
276 773cefc6 Fabrice Bellard
	install -m 644 $(LIB) $(prefix)/lib
277 cb728d79 Fabrice Bellard
278
install-headers:
279
	mkdir -p "$(prefix)/include/ffmpeg"
280 07bd15c3 Fred Rothganger
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
281
	               $(SRC_PATH)/libavcodec/common.h \
282
	               $(SRC_PATH)/libavcodec/rational.h \
283 cb728d79 Fabrice Bellard
                "$(prefix)/include/ffmpeg"
284 773cefc6 Fabrice Bellard
285 d771bcae Fabrice Bellard
#
286
# include dependency files if they exist
287
#
288
ifneq ($(wildcard .depend),)
289
include .depend
290
endif