Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 034eeaa1

History | View | Annotate | Download (7.76 KB)

1 4cc281d9 Fabrice Bellard
#
2
# libavcodec Makefile
3 6d6d7970 Mike Melanson
# (c) 2000-2005 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 2a515c08 Torsten Martinsen
CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS)
11 de6d9b64 Fabrice Bellard
12 caa336b4 Michael Niedermayer
OBJS= bitstream.o utils.o mem.o allcodecs.o \
13 1d0d55da Michael Niedermayer
      mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
14 7b1fa7db Michael Niedermayer
      mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.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 40c5fa26 Michael Niedermayer
      fft.o mdct.o mace.o huffyuv.o cyuv.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 d08d7142 Mike Melanson
      flac.o vp3dsp.o integer.o snow.o tscc.o sonic.o ulti.o h264idct.o \
24 fe533bb3 Josh Varner
      qdrw.o xl.o rangecoder.o png.o pnm.o qpeg.o vc9.o h263.o h261.o \
25 6d6d7970 Mike Melanson
      msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o shorten.o loco.o \
26 034eeaa1 Mike Melanson
      alac.o wnv1.o ws-snd1.o
27 891f64b3 joca@rixmail.se
28 4d4bb927 Roberto Togni
AMROBJS=
29 891f64b3 joca@rixmail.se
ifeq ($(AMR_NB),yes)
30 bc634f6f Zdenek Kabelac
ifeq ($(AMR_NB_FIXED),yes)
31 4d4bb927 Roberto Togni
AMROBJS= amr.o
32 bc634f6f Zdenek Kabelac
AMREXTRALIBS+= amr/*.o
33
AMRLIBS=amrlibs
34
CLEANAMR=cleanamr
35
else
36 4d4bb927 Roberto Togni
AMROBJS= amr.o
37
OBJS+= amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
38 bc634f6f Zdenek Kabelac
CLEANAMR=cleanamrfloat
39
endif
40 891f64b3 joca@rixmail.se
endif
41
42 9c3d33d6 Michael Niedermayer
ifeq ($(HAVE_PTHREADS),yes)
43
OBJS+= pthread.o
44
endif
45
46 16806499 Michael Niedermayer
ifeq ($(HAVE_W32THREADS),yes)
47
OBJS+= w32thread.o
48
endif
49
50 2450cff2 François Revol
ifeq ($(HAVE_BEOSTHREADS),yes)
51
OBJS+= beosthread.o
52
endif
53
54 d663a1fd Michael Niedermayer
ifeq ($(AMR_WB),yes)
55 4d4bb927 Roberto Togni
AMROBJS= amr.o
56
OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
57 d663a1fd Michael Niedermayer
		amrwb_float/dec_if.o amrwb_float/dec_lpc.o amrwb_float/dec_main.o \
58
		amrwb_float/dec_rom.o amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
59
		amrwb_float/enc_dtx.o amrwb_float/enc_gain.o amrwb_float/enc_if.o \
60
		amrwb_float/enc_lpc.o amrwb_float/enc_main.o amrwb_float/enc_rom.o \
61
		amrwb_float/enc_util.o amrwb_float/if_rom.o
62
endif
63 4d4bb927 Roberto Togni
OBJS+= $(AMROBJS)
64 d663a1fd Michael Niedermayer
CLEANAMRWB=cleanamrwbfloat
65 980fc7b8 Fabrice Bellard
ASM_OBJS=
66 de6d9b64 Fabrice Bellard
67 4f1bb8a9 Ivan Kalvachev
ifeq ($(HAVE_XVMC_ACCEL),yes)
68
OBJS+= xvmcvideo.o
69
endif
70
71 57514323 Zdenek Kabelac
# currently using liba52 for ac3 decoding
72 d771bcae Fabrice Bellard
ifeq ($(CONFIG_AC3),yes)
73 57514323 Zdenek Kabelac
OBJS+= a52dec.o
74
75
# using builtin liba52 or runtime linked liba52.so.0
76 ff4ec49e Fabrice Bellard
ifneq ($(CONFIG_A52BIN),yes)
77 57514323 Zdenek Kabelac
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
78 521221cf Arpi
	liba52/imdct.o  liba52/parse.o liba52/crc.o liba52/resample.o
79 d771bcae Fabrice Bellard
endif
80 ff4ec49e Fabrice Bellard
endif
81 de6d9b64 Fabrice Bellard
82 23c99253 Michael Niedermayer
# currently using libdts for dts decoding
83
ifeq ($(CONFIG_DTS),yes)
84
OBJS+= dtsdec.o
85 c5c97a8d Michael Niedermayer
CFLAGS += $(DTS_INC)
86
EXTRALIBS += -ldts
87 23c99253 Michael Niedermayer
endif
88
89 280bd7b7 Zdenek Kabelac
ifeq ($(CONFIG_FAAD),yes)
90
OBJS+= faad.o
91 445ad18d Zdenek Kabelac
ifeq ($(CONFIG_FAADBIN),yes)
92
# no libs needed
93
else
94
EXTRALIBS += -lfaad
95
endif
96 280bd7b7 Zdenek Kabelac
endif
97
98 29d48296 Michael Niedermayer
ifeq ($(CONFIG_FAAC),yes)
99
OBJS+= faac.o
100
EXTRALIBS += -lfaac
101
endif
102
103 1ddadfa9 Adam Thayer
ifeq ($(CONFIG_XVID),yes)
104
OBJS+= xvidff.o
105
EXTRALIBS += -lxvidcore
106
endif
107
108 6662ec29 Michael Niedermayer
ifeq ($(CONFIG_X264),yes)
109
OBJS+= x264.o
110 7c653cc9 Måns Rullgård
EXTRALIBS += -lx264
111 6662ec29 Michael Niedermayer
endif
112
113 bba9b16c Michael Niedermayer
ifeq ($(CONFIG_PP),yes)
114
ifeq ($(SHARED_PP),yes)
115 91378af4 Frantisek Dvorak
EXTRALIBS += -L$(VPATH)/libpostproc -lpostproc
116 bba9b16c Michael Niedermayer
else
117
# LIBS += libpostproc/libpostproc.a ... should be fixed
118
OBJS += libpostproc/postprocess.o
119
endif
120
endif
121
122 5798368b Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
123
OBJS += mp3lameaudio.o
124 2a2a98c0 Zdenek Kabelac
EXTRALIBS += -lmp3lame
125 5798368b Juanjo
endif
126
127 5c5dea3f Nilesh Bansal
ifeq ($(CONFIG_LIBOGG),yes)
128
ifeq ($(CONFIG_LIBVORBIS),yes)
129 81e0d0b4 Mark Hills
OBJS += oggvorbis.o
130 078a8dd6 Víctor Paesa
EXTRALIBS += -lvorbisenc -lvorbis
131 81e0d0b4 Mark Hills
endif
132 5c5dea3f Nilesh Bansal
ifeq ($(CONFIG_LIBTHEORA), yes)
133
OBJS += oggtheora.o
134
EXTRALIBS += -ltheora
135
endif
136 078a8dd6 Víctor Paesa
EXTRALIBS += -logg
137 5c5dea3f Nilesh Bansal
endif
138 81e0d0b4 Mark Hills
139 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
140
CFLAGS+=-p
141
LDFLAGS+=-p
142
endif
143
144 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
145 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
146 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
147 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
148 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
149 38acbc3c Mike Melanson
	i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
150
	i386/vp3dsp_sse2.o
151 a968e365 Fabrice Bellard
ifdef TARGET_BUILTIN_VECTOR
152
i386/fft_sse.o: CFLAGS+= -msse
153 148beec7 Zdenek Kabelac
depend: CFLAGS+= -msse
154 a968e365 Fabrice Bellard
endif
155 de6d9b64 Fabrice Bellard
endif
156
157 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
158
ifeq ($(TARGET_ARCH_ARMV4L),yes)
159 bd7d1ea7 Alex Beregszaszi
ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o
160 676e200c Michael Niedermayer
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
161 3d03c0a2 Fabrice Bellard
endif
162
163 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
164
# currently only works when libavcodec is used in mplayer
165
ifeq ($(HAVE_MLIB),yes)
166
OBJS += mlib/dsputil_mlib.o
167
CFLAGS += $(MLIB_INC)
168
endif
169
170 1e98dffb Nick Kurshev
# alpha specific stuff
171
ifeq ($(TARGET_ARCH_ALPHA),yes)
172 8b313a47 Falk Hüffner
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
173
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
174 f9bb4bdf Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
175 647b610c Falk Hüffner
CFLAGS += -fforce-addr
176 1e98dffb Nick Kurshev
endif
177
178 59925ef2 Brian Foley
ifeq ($(TARGET_ARCH_POWERPC),yes)
179 05c4072b Michael Niedermayer
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
180 ab6c65f6 Brian Foley
endif
181
182 d46aba26 Leon van Stuivenberg
ifeq ($(TARGET_MMI),yes)
183 5917d17c Leon van Stuivenberg
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
184 d46aba26 Leon van Stuivenberg
endif
185
186 ab6c65f6 Brian Foley
ifeq ($(TARGET_ALTIVEC),yes)
187 8d268a7d Fabrice Bellard
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
188 a6a12a8a Romain Dolbeau
        ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o \
189
        ppc/dsputil_h264_altivec.o
190 59925ef2 Brian Foley
endif
191
192 0c6bd2ea BERO
ifeq ($(TARGET_ARCH_SH4),yes)
193
OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
194
endif
195
196 bb476ff3 James Morrison
ifeq ($(TARGET_ARCH_SPARC),yes)
197 44f54ceb Michael Niedermayer
OBJS+=sparc/dsputil_vis.o
198 bb476ff3 James Morrison
sparc/%.o: sparc/%.c
199
	$(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $< 
200
endif
201
ifeq ($(TARGET_ARCH_SPARC64),yes)
202 44f54ceb Michael Niedermayer
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
203
endif
204
205 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
206 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
207 980fc7b8 Fabrice Bellard
208 f3ec2d46 Slavik Gnatenko
LIB= $(LIBPREF)avcodec$(LIBSUF)
209 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
210 f3ec2d46 Slavik Gnatenko
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
211 0fd94442 Nick Kurshev
endif
212 6d2abd6b Fabrice Bellard
TESTS= imgresample-test dct-test motion-test fft-test
213 de6d9b64 Fabrice Bellard
214 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
215 ff4ec49e Fabrice Bellard
216 bc634f6f Zdenek Kabelac
amrlibs:
217
	$(MAKE) -C amr spclib fipoplib
218
219 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
220 de6d9b64 Fabrice Bellard
221 bc634f6f Zdenek Kabelac
$(LIB): $(OBJS) $(AMRLIBS)
222 de6d9b64 Fabrice Bellard
	rm -f $@
223 bc634f6f Zdenek Kabelac
	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
224 be7109c1 Michael Niedermayer
	$(RANLIB) $@
225 ff4ec49e Fabrice Bellard
226 811b32ed Fabrice Bellard
$(SLIB): $(OBJS)
227 91378af4 Frantisek Dvorak
ifeq ($(CONFIG_PP),yes)
228 8b8e1c55 Philipp Matthias Hahn
	$(MAKE) -C libpostproc
229 91378af4 Frantisek Dvorak
endif
230 cf7412b5 Fabrice Bellard
ifeq ($(CONFIG_WIN32),yes)
231
	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
232
	-lib /machine:i386 /def:$(@:.dll=.def)
233
else
234 1b8b121f Michael T. Dean
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
235 cf7412b5 Fabrice Bellard
endif
236 de6d9b64 Fabrice Bellard
237
dsputil.o: dsputil.c dsputil.h
238
239 bba9b16c Michael Niedermayer
libpostproc/libpostproc.a:
240
	$(MAKE) -C libpostproc
241
242 de6d9b64 Fabrice Bellard
%.o: %.c
243
	$(CC) $(CFLAGS) -c -o $@ $< 
244
245 3d03c0a2 Fabrice Bellard
%.o: %.S
246
	$(CC) $(CFLAGS) -c -o $@ $<
247
248 811b32ed Fabrice Bellard
depend: $(SRCS)
249 a968e365 Fabrice Bellard
	$(CC) -MM $(CFLAGS) $^ 1>.depend
250 e51d4def Arpi
251 980fc7b8 Fabrice Bellard
dep:	depend
252
253 bc634f6f Zdenek Kabelac
clean: $(CLEANAMR)
254 77b71ddc Philip Gladstone
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
255 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
256 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
257 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
258 59925ef2 Brian Foley
	   ppc/*.o ppc/*~ \
259 d46aba26 Leon van Stuivenberg
	   ps2/*.o ps2/*~ \
260 0c6bd2ea BERO
	   sh4/*.o sh4/*~ \
261 bb476ff3 James Morrison
	   sparc/*.o sparc/*~ \
262 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
263
	   apiexample $(TESTS)
264 64094f37 Zdenek Kabelac
	$(MAKE) -C libpostproc clean
265 de6d9b64 Fabrice Bellard
266 800d7ceb Felix Bünemann
distclean: clean
267 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
268
269 bc634f6f Zdenek Kabelac
cleanamr:
270
	$(MAKE) -C amr clean
271
272
cleanamrfloat:
273
	rm -f amr_float/*.o
274
275 d663a1fd Michael Niedermayer
cleanamrwbfloat:
276
	$(MAKE) -C amrwb_float -f makefile.gcc clean
277
278 de6d9b64 Fabrice Bellard
# api example program
279
apiexample: apiexample.c $(LIB)
280 cfda33cb Michael Niedermayer
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
281 de6d9b64 Fabrice Bellard
282 c10e9f70 Nick Kurshev
# cpuid test
283
cpuid_test: i386/cputest.c
284
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
285
286 de6d9b64 Fabrice Bellard
# testing progs
287
288
imgresample-test: imgresample.c
289 6acce86b Michael Niedermayer
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
290 de6d9b64 Fabrice Bellard
291 9ebc63a9 Fabrice Bellard
dct-test: dct-test.o fdctref.o $(LIB)
292 90cee0c3 Michael Niedermayer
	$(CC) -o $@ $^ -lm
293 d771bcae Fabrice Bellard
294 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
295 6acce86b Michael Niedermayer
	$(CC) -o $@ $^ -lm
296 4300403e Fabrice Bellard
297 923ceff8 Fabrice Bellard
fft-test: fft-test.o $(LIB)
298 6d2abd6b Fabrice Bellard
	$(CC) -o $@ $^ -lm
299
300 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
301 cb728d79 Fabrice Bellard
install: all install-headers
302
ifeq ($(CONFIG_WIN32),yes)
303 65d1bea2 Michel Bardiaux
	install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
304 cb728d79 Fabrice Bellard
else
305 cc973ecb Luca Barbato
	install -d $(libdir)
306
	install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavcodec-$(VERSION).so
307
	ln -sf libavcodec-$(VERSION).so $(libdir)/libavcodec.so
308 c1325d18 Volker Moell
	ldconfig || true
309 cb728d79 Fabrice Bellard
endif
310 91378af4 Frantisek Dvorak
ifeq ($(CONFIG_PP),yes)
311 8b8e1c55 Philipp Matthias Hahn
	$(MAKE) -C libpostproc $@
312 91378af4 Frantisek Dvorak
endif
313 cb728d79 Fabrice Bellard
else
314
install:
315 0fd94442 Nick Kurshev
endif
316 773cefc6 Fabrice Bellard
317 cb728d79 Fabrice Bellard
installlib: all install-headers
318 cc973ecb Luca Barbato
	install -m 644 $(LIB) "$(libdir)"
319 cb728d79 Fabrice Bellard
320
install-headers:
321
	mkdir -p "$(prefix)/include/ffmpeg"
322 07bd15c3 Fred Rothganger
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
323
	               $(SRC_PATH)/libavcodec/common.h \
324
	               $(SRC_PATH)/libavcodec/rational.h \
325 cb728d79 Fabrice Bellard
                "$(prefix)/include/ffmpeg"
326 773cefc6 Fabrice Bellard
327 d771bcae Fabrice Bellard
#
328
# include dependency files if they exist
329
#
330
ifneq ($(wildcard .depend),)
331
include .depend
332
endif