Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ a8a15e9d

History | View | Annotate | Download (7.75 KB)

1
#
2
# libavcodec Makefile
3
# (c) 2000-2005 Fabrice Bellard
4
#
5
include ../config.mak
6

    
7
VPATH=$(SRC_PATH)/libavcodec
8

    
9
# NOTE: -I.. is needed to include config.h
10
CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS)
11

    
12
OBJS= bitstream.o utils.o mem.o allcodecs.o \
13
      mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
14
      mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \
15
      motion_est.o imgconvert.o imgresample.o \
16
      mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
17
      ratecontrol.o adpcm.o eval.o dv.o error_resilience.o \
18
      fft.o mdct.o mace.o huffyuv.o cyuv.o raw.o h264.o golomb.o \
19
      vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o vcr1.o cljr.o \
20
      roqvideo.o dpcm.o interplayvideo.o xan.o rpza.o cinepak.o msrle.o \
21
      msvideo1.o vqavideo.o idcinvideo.o adx.o rational.o faandct.o 8bps.o \
22
      smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o g726.o \
23
      flac.o vp3dsp.o integer.o snow.o tscc.o sonic.o ulti.o h264idct.o \
24
      qdrw.o xl.o rangecoder.o png.o pnm.o qpeg.o vc9.o h263.o h261.o \
25
      msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o shorten.o loco.o \
26
      alac.o wnv1.o
27

    
28
AMROBJS=
29
ifeq ($(AMR_NB),yes)
30
ifeq ($(AMR_NB_FIXED),yes)
31
AMROBJS= amr.o
32
AMREXTRALIBS+= amr/*.o
33
AMRLIBS=amrlibs
34
CLEANAMR=cleanamr
35
else
36
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
CLEANAMR=cleanamrfloat
39
endif
40
endif
41

    
42
ifeq ($(HAVE_PTHREADS),yes)
43
OBJS+= pthread.o
44
endif
45

    
46
ifeq ($(HAVE_W32THREADS),yes)
47
OBJS+= w32thread.o
48
endif
49

    
50
ifeq ($(HAVE_BEOSTHREADS),yes)
51
OBJS+= beosthread.o
52
endif
53

    
54
ifeq ($(AMR_WB),yes)
55
AMROBJS= amr.o
56
OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
57
		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
OBJS+= $(AMROBJS)
64
CLEANAMRWB=cleanamrwbfloat
65
ASM_OBJS=
66

    
67
ifeq ($(HAVE_XVMC_ACCEL),yes)
68
OBJS+= xvmcvideo.o
69
endif
70

    
71
# currently using liba52 for ac3 decoding
72
ifeq ($(CONFIG_AC3),yes)
73
OBJS+= a52dec.o
74

    
75
# using builtin liba52 or runtime linked liba52.so.0
76
ifneq ($(CONFIG_A52BIN),yes)
77
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
78
	liba52/imdct.o  liba52/parse.o liba52/crc.o liba52/resample.o
79
endif
80
endif
81

    
82
# currently using libdts for dts decoding
83
ifeq ($(CONFIG_DTS),yes)
84
OBJS+= dtsdec.o
85
CFLAGS += $(DTS_INC)
86
EXTRALIBS += -ldts
87
endif
88

    
89
ifeq ($(CONFIG_FAAD),yes)
90
OBJS+= faad.o
91
ifeq ($(CONFIG_FAADBIN),yes)
92
# no libs needed
93
else
94
EXTRALIBS += -lfaad
95
endif
96
endif
97

    
98
ifeq ($(CONFIG_FAAC),yes)
99
OBJS+= faac.o
100
EXTRALIBS += -lfaac
101
endif
102

    
103
ifeq ($(CONFIG_XVID),yes)
104
OBJS+= xvidff.o
105
EXTRALIBS += -lxvidcore
106
endif
107

    
108
ifeq ($(CONFIG_X264),yes)
109
OBJS+= x264.o
110
EXTRALIBS += -lx264
111
endif
112

    
113
ifeq ($(CONFIG_PP),yes)
114
ifeq ($(SHARED_PP),yes)
115
EXTRALIBS += -L$(VPATH)/libpostproc -lpostproc
116
else
117
# LIBS += libpostproc/libpostproc.a ... should be fixed
118
OBJS += libpostproc/postprocess.o
119
endif
120
endif
121

    
122
ifeq ($(CONFIG_MP3LAME),yes)
123
OBJS += mp3lameaudio.o
124
EXTRALIBS += -lmp3lame
125
endif
126

    
127
ifeq ($(CONFIG_LIBOGG),yes)
128
ifeq ($(CONFIG_LIBVORBIS),yes)
129
OBJS += oggvorbis.o
130
EXTRALIBS += -lvorbisenc -lvorbis
131
endif
132
ifeq ($(CONFIG_LIBTHEORA), yes)
133
OBJS += oggtheora.o
134
EXTRALIBS += -ltheora
135
endif
136
EXTRALIBS += -logg
137
endif
138

    
139
ifeq ($(TARGET_GPROF),yes)
140
CFLAGS+=-p
141
LDFLAGS+=-p
142
endif
143

    
144
# i386 mmx specific stuff
145
ifeq ($(TARGET_MMX),yes)
146
OBJS += i386/fdct_mmx.o i386/cputest.o \
147
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
148
	i386/idct_mmx.o i386/motion_est_mmx.o \
149
	i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
150
	i386/vp3dsp_sse2.o
151
ifdef TARGET_BUILTIN_VECTOR
152
i386/fft_sse.o: CFLAGS+= -msse
153
depend: CFLAGS+= -msse
154
endif
155
endif
156

    
157
# armv4l specific stuff
158
ifeq ($(TARGET_ARCH_ARMV4L),yes)
159
ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o
160
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
161
endif
162

    
163
# 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
# alpha specific stuff
171
ifeq ($(TARGET_ARCH_ALPHA),yes)
172
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
173
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
174
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
175
CFLAGS += -fforce-addr
176
endif
177

    
178
ifeq ($(TARGET_ARCH_POWERPC),yes)
179
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
180
endif
181

    
182
ifeq ($(TARGET_MMI),yes)
183
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
184
endif
185

    
186
ifeq ($(TARGET_ALTIVEC),yes)
187
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
188
        ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o \
189
        ppc/dsputil_h264_altivec.o
190
endif
191

    
192
ifeq ($(TARGET_ARCH_SH4),yes)
193
OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
194
endif
195

    
196
ifeq ($(TARGET_ARCH_SPARC),yes)
197
OBJS+=sparc/dsputil_vis.o
198
sparc/%.o: sparc/%.c
199
	$(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $< 
200
endif
201
ifeq ($(TARGET_ARCH_SPARC64),yes)
202
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
203
endif
204

    
205
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
206
OBJS := $(OBJS) $(ASM_OBJS)
207

    
208
LIB= $(LIBPREF)avcodec$(LIBSUF)
209
ifeq ($(BUILD_SHARED),yes)
210
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
211
endif
212
TESTS= imgresample-test dct-test motion-test fft-test
213

    
214
all: $(LIB) $(SLIB)
215

    
216
amrlibs:
217
	$(MAKE) -C amr spclib fipoplib
218

    
219
tests: apiexample cpuid_test $(TESTS)
220

    
221
$(LIB): $(OBJS) $(AMRLIBS)
222
	rm -f $@
223
	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
224
	$(RANLIB) $@
225

    
226
$(SLIB): $(OBJS)
227
ifeq ($(CONFIG_PP),yes)
228
	$(MAKE) -C libpostproc
229
endif
230
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
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
235
endif
236

    
237
dsputil.o: dsputil.c dsputil.h
238

    
239
libpostproc/libpostproc.a:
240
	$(MAKE) -C libpostproc
241

    
242
%.o: %.c
243
	$(CC) $(CFLAGS) -c -o $@ $< 
244

    
245
%.o: %.S
246
	$(CC) $(CFLAGS) -c -o $@ $<
247

    
248
depend: $(SRCS)
249
	$(CC) -MM $(CFLAGS) $^ 1>.depend
250

    
251
dep:	depend
252

    
253
clean: $(CLEANAMR)
254
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
255
	   armv4l/*.o armv4l/*~ \
256
	   mlib/*.o mlib/*~ \
257
	   alpha/*.o alpha/*~ \
258
	   ppc/*.o ppc/*~ \
259
	   ps2/*.o ps2/*~ \
260
	   sh4/*.o sh4/*~ \
261
	   sparc/*.o sparc/*~ \
262
	   liba52/*.o liba52/*~ \
263
	   apiexample $(TESTS)
264
	$(MAKE) -C libpostproc clean
265

    
266
distclean: clean
267
	rm -f Makefile.bak .depend
268

    
269
cleanamr:
270
	$(MAKE) -C amr clean
271

    
272
cleanamrfloat:
273
	rm -f amr_float/*.o
274

    
275
cleanamrwbfloat:
276
	$(MAKE) -C amrwb_float -f makefile.gcc clean
277

    
278
# api example program
279
apiexample: apiexample.c $(LIB)
280
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
281

    
282
# cpuid test
283
cpuid_test: i386/cputest.c
284
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
285

    
286
# testing progs
287

    
288
imgresample-test: imgresample.c
289
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
290

    
291
dct-test: dct-test.o fdctref.o $(LIB)
292
	$(CC) -o $@ $^ -lm
293

    
294
motion-test: motion_test.o $(LIB)
295
	$(CC) -o $@ $^ -lm
296

    
297
fft-test: fft-test.o $(LIB)
298
	$(CC) -o $@ $^ -lm
299

    
300
ifeq ($(BUILD_SHARED),yes)
301
install: all install-headers
302
ifeq ($(CONFIG_WIN32),yes)
303
	install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
304
else
305
	install -d $(libdir)
306
	install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavcodec-$(VERSION).so
307
	ln -sf libavcodec-$(VERSION).so $(libdir)/libavcodec.so
308
	ldconfig || true
309
endif
310
ifeq ($(CONFIG_PP),yes)
311
	$(MAKE) -C libpostproc $@
312
endif
313
else
314
install:
315
endif
316

    
317
installlib: all install-headers
318
	install -m 644 $(LIB) "$(libdir)"
319

    
320
install-headers:
321
	mkdir -p "$(prefix)/include/ffmpeg"
322
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
323
	               $(SRC_PATH)/libavcodec/common.h \
324
	               $(SRC_PATH)/libavcodec/rational.h \
325
                "$(prefix)/include/ffmpeg"
326

    
327
#
328
# include dependency files if they exist
329
#
330
ifneq ($(wildcard .depend),)
331
include .depend
332
endif