Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 20646267

History | View | Annotate | Download (7.02 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 29adde83 Michael Niedermayer
      flac.o vp3dsp.o integer.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 38acbc3c Mike Melanson
	i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
120
	i386/vp3dsp_sse2.o
121 a968e365 Fabrice Bellard
ifdef TARGET_BUILTIN_VECTOR
122
i386/fft_sse.o: CFLAGS+= -msse
123 148beec7 Zdenek Kabelac
depend: CFLAGS+= -msse
124 a968e365 Fabrice Bellard
endif
125 de6d9b64 Fabrice Bellard
endif
126
127 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
128
ifeq ($(TARGET_ARCH_ARMV4L),yes)
129 bd7d1ea7 Alex Beregszaszi
ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o
130 676e200c Michael Niedermayer
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
131 3d03c0a2 Fabrice Bellard
endif
132
133 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
134
# currently only works when libavcodec is used in mplayer
135
ifeq ($(HAVE_MLIB),yes)
136
OBJS += mlib/dsputil_mlib.o
137
CFLAGS += $(MLIB_INC)
138
endif
139
140 1e98dffb Nick Kurshev
# alpha specific stuff
141
ifeq ($(TARGET_ARCH_ALPHA),yes)
142 8b313a47 Falk Hüffner
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
143
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
144 f9bb4bdf Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
145 0af65aac Falk Hüffner
CFLAGS += -fforce-addr -freduce-all-givs
146 1e98dffb Nick Kurshev
endif
147
148 59925ef2 Brian Foley
ifeq ($(TARGET_ARCH_POWERPC),yes)
149 05c4072b Michael Niedermayer
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
150 ab6c65f6 Brian Foley
endif
151
152 d46aba26 Leon van Stuivenberg
ifeq ($(TARGET_MMI),yes)
153 5917d17c Leon van Stuivenberg
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
154 d46aba26 Leon van Stuivenberg
endif
155
156 ab6c65f6 Brian Foley
ifeq ($(TARGET_ALTIVEC),yes)
157 8d268a7d Fabrice Bellard
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
158 14cabd40 James Klicman
        ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o
159 59925ef2 Brian Foley
endif
160
161 0c6bd2ea BERO
ifeq ($(TARGET_ARCH_SH4),yes)
162
OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
163
endif
164
165 bb476ff3 James Morrison
ifeq ($(TARGET_ARCH_SPARC),yes)
166 44f54ceb Michael Niedermayer
OBJS+=sparc/dsputil_vis.o
167 bb476ff3 James Morrison
sparc/%.o: sparc/%.c
168
	$(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $< 
169
endif
170
ifeq ($(TARGET_ARCH_SPARC64),yes)
171 44f54ceb Michael Niedermayer
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
172
endif
173
174 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
175 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
176 980fc7b8 Fabrice Bellard
177 f3ec2d46 Slavik Gnatenko
LIB= $(LIBPREF)avcodec$(LIBSUF)
178 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
179 f3ec2d46 Slavik Gnatenko
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
180 0fd94442 Nick Kurshev
endif
181 6d2abd6b Fabrice Bellard
TESTS= imgresample-test dct-test motion-test fft-test
182 de6d9b64 Fabrice Bellard
183 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
184 ff4ec49e Fabrice Bellard
185 bc634f6f Zdenek Kabelac
amrlibs:
186
	$(MAKE) -C amr spclib fipoplib
187
188 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
189 de6d9b64 Fabrice Bellard
190 bc634f6f Zdenek Kabelac
$(LIB): $(OBJS) $(AMRLIBS)
191 de6d9b64 Fabrice Bellard
	rm -f $@
192 bc634f6f Zdenek Kabelac
	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
193 be7109c1 Michael Niedermayer
	$(RANLIB) $@
194 ff4ec49e Fabrice Bellard
195 811b32ed Fabrice Bellard
$(SLIB): $(OBJS)
196 cf7412b5 Fabrice Bellard
ifeq ($(CONFIG_WIN32),yes)
197
	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
198
	-lib /machine:i386 /def:$(@:.dll=.def)
199
else
200 1b8b121f Michael T. Dean
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
201 cf7412b5 Fabrice Bellard
endif
202 de6d9b64 Fabrice Bellard
203
dsputil.o: dsputil.c dsputil.h
204
205 bba9b16c Michael Niedermayer
libpostproc/libpostproc.a:
206
	$(MAKE) -C libpostproc
207
208 de6d9b64 Fabrice Bellard
%.o: %.c
209
	$(CC) $(CFLAGS) -c -o $@ $< 
210
211 3d03c0a2 Fabrice Bellard
%.o: %.S
212
	$(CC) $(CFLAGS) -c -o $@ $<
213
214 811b32ed Fabrice Bellard
depend: $(SRCS)
215 a968e365 Fabrice Bellard
	$(CC) -MM $(CFLAGS) $^ 1>.depend
216 e51d4def Arpi
217 980fc7b8 Fabrice Bellard
dep:	depend
218
219 bc634f6f Zdenek Kabelac
clean: $(CLEANAMR)
220 77b71ddc Philip Gladstone
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
221 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
222 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
223 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
224 59925ef2 Brian Foley
	   ppc/*.o ppc/*~ \
225 d46aba26 Leon van Stuivenberg
	   ps2/*.o ps2/*~ \
226 0c6bd2ea BERO
	   sh4/*.o sh4/*~ \
227 bb476ff3 James Morrison
	   sparc/*.o sparc/*~ \
228 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
229
	   apiexample $(TESTS)
230 64094f37 Zdenek Kabelac
	$(MAKE) -C libpostproc clean
231 de6d9b64 Fabrice Bellard
232 800d7ceb Felix Bünemann
distclean: clean
233 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
234
235 bc634f6f Zdenek Kabelac
cleanamr:
236
	$(MAKE) -C amr clean
237
238
cleanamrfloat:
239
	rm -f amr_float/*.o
240
241 d663a1fd Michael Niedermayer
cleanamrwbfloat:
242
	$(MAKE) -C amrwb_float -f makefile.gcc clean
243
244 de6d9b64 Fabrice Bellard
# api example program
245
apiexample: apiexample.c $(LIB)
246 cfda33cb Michael Niedermayer
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
247 de6d9b64 Fabrice Bellard
248 c10e9f70 Nick Kurshev
# cpuid test
249
cpuid_test: i386/cputest.c
250
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
251
252 de6d9b64 Fabrice Bellard
# testing progs
253
254
imgresample-test: imgresample.c
255 6acce86b Michael Niedermayer
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
256 de6d9b64 Fabrice Bellard
257 9ebc63a9 Fabrice Bellard
dct-test: dct-test.o fdctref.o $(LIB)
258 90cee0c3 Michael Niedermayer
	$(CC) -o $@ $^ -lm
259 d771bcae Fabrice Bellard
260 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
261 6acce86b Michael Niedermayer
	$(CC) -o $@ $^ -lm
262 4300403e Fabrice Bellard
263 923ceff8 Fabrice Bellard
fft-test: fft-test.o $(LIB)
264 6d2abd6b Fabrice Bellard
	$(CC) -o $@ $^ -lm
265
266 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
267 cb728d79 Fabrice Bellard
install: all install-headers
268
ifeq ($(CONFIG_WIN32),yes)
269
	install -s -m 755 $(SLIB) "$(prefix)"
270
else
271 c1325d18 Volker Moell
	install -d $(prefix)/lib
272 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
273 c1325d18 Volker Moell
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
274
	ldconfig || true
275 cb728d79 Fabrice Bellard
endif
276
else
277
install:
278 0fd94442 Nick Kurshev
endif
279 773cefc6 Fabrice Bellard
280 cb728d79 Fabrice Bellard
installlib: all install-headers
281 773cefc6 Fabrice Bellard
	install -m 644 $(LIB) $(prefix)/lib
282 cb728d79 Fabrice Bellard
283
install-headers:
284
	mkdir -p "$(prefix)/include/ffmpeg"
285 07bd15c3 Fred Rothganger
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
286
	               $(SRC_PATH)/libavcodec/common.h \
287
	               $(SRC_PATH)/libavcodec/rational.h \
288 cb728d79 Fabrice Bellard
                "$(prefix)/include/ffmpeg"
289 773cefc6 Fabrice Bellard
290 d771bcae Fabrice Bellard
#
291
# include dependency files if they exist
292
#
293
ifneq ($(wildcard .depend),)
294
include .depend
295
endif