Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 20646267

History | View | Annotate | Download (7.02 KB)

1
#
2
# libavcodec Makefile
3
# (c) 2000-2003 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
11

    
12
OBJS= common.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 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 opts.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
24

    
25
ifeq ($(AMR_NB),yes)
26
ifeq ($(AMR_NB_FIXED),yes)
27
OBJS+= amr.o
28
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
endif
36

    
37
ifeq ($(HAVE_PTHREADS),yes)
38
OBJS+= pthread.o
39
endif
40

    
41
ifeq ($(HAVE_W32THREADS),yes)
42
OBJS+= w32thread.o
43
endif
44

    
45
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
ASM_OBJS=
55

    
56
# codecs which are patented in some non free countries like the us
57
ifeq ($(CONFIG_RISKY),yes)
58
OBJS+= h263.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o
59
endif
60

    
61
ifeq ($(HAVE_XVMC_ACCEL),yes)
62
OBJS+= xvmcvideo.o
63
endif
64

    
65
# currently using liba52 for ac3 decoding
66
ifeq ($(CONFIG_AC3),yes)
67
OBJS+= a52dec.o
68

    
69
# using builtin liba52 or runtime linked liba52.so.0
70
ifneq ($(CONFIG_A52BIN),yes)
71
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
72
	liba52/imdct.o  liba52/parse.o liba52/crc.o liba52/resample.o
73
endif
74
endif
75

    
76
ifeq ($(CONFIG_FAAD),yes)
77
OBJS+= faad.o
78
ifeq ($(CONFIG_FAADBIN),yes)
79
# no libs needed
80
else
81
EXTRALIBS += -lfaad
82
endif
83
endif
84

    
85
ifeq ($(CONFIG_FAAC),yes)
86
OBJS+= faac.o
87
EXTRALIBS += -lfaac
88
endif
89

    
90
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
ifeq ($(CONFIG_MP3LAME),yes)
100
OBJS += mp3lameaudio.o
101
EXTRALIBS += -lmp3lame
102
endif
103

    
104
ifeq ($(CONFIG_VORBIS),yes)
105
OBJS += oggvorbis.o
106
EXTRALIBS += -lvorbis -lvorbisenc
107
endif
108

    
109
ifeq ($(TARGET_GPROF),yes)
110
CFLAGS+=-p
111
LDFLAGS+=-p
112
endif
113

    
114
# i386 mmx specific stuff
115
ifeq ($(TARGET_MMX),yes)
116
OBJS += i386/fdct_mmx.o i386/cputest.o \
117
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
118
	i386/idct_mmx.o i386/motion_est_mmx.o \
119
	i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
120
	i386/vp3dsp_sse2.o
121
ifdef TARGET_BUILTIN_VECTOR
122
i386/fft_sse.o: CFLAGS+= -msse
123
depend: CFLAGS+= -msse
124
endif
125
endif
126

    
127
# armv4l specific stuff
128
ifeq ($(TARGET_ARCH_ARMV4L),yes)
129
ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o
130
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
131
endif
132

    
133
# 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
# alpha specific stuff
141
ifeq ($(TARGET_ARCH_ALPHA),yes)
142
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
143
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
144
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
145
CFLAGS += -fforce-addr -freduce-all-givs
146
endif
147

    
148
ifeq ($(TARGET_ARCH_POWERPC),yes)
149
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
150
endif
151

    
152
ifeq ($(TARGET_MMI),yes)
153
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
154
endif
155

    
156
ifeq ($(TARGET_ALTIVEC),yes)
157
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
158
        ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o
159
endif
160

    
161
ifeq ($(TARGET_ARCH_SH4),yes)
162
OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
163
endif
164

    
165
ifeq ($(TARGET_ARCH_SPARC),yes)
166
OBJS+=sparc/dsputil_vis.o
167
sparc/%.o: sparc/%.c
168
	$(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $< 
169
endif
170
ifeq ($(TARGET_ARCH_SPARC64),yes)
171
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
172
endif
173

    
174
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
175
OBJS := $(OBJS) $(ASM_OBJS)
176

    
177
LIB= $(LIBPREF)avcodec$(LIBSUF)
178
ifeq ($(BUILD_SHARED),yes)
179
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
180
endif
181
TESTS= imgresample-test dct-test motion-test fft-test
182

    
183
all: $(LIB) $(SLIB)
184

    
185
amrlibs:
186
	$(MAKE) -C amr spclib fipoplib
187

    
188
tests: apiexample cpuid_test $(TESTS)
189

    
190
$(LIB): $(OBJS) $(AMRLIBS)
191
	rm -f $@
192
	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
193
	$(RANLIB) $@
194

    
195
$(SLIB): $(OBJS)
196
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
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
201
endif
202

    
203
dsputil.o: dsputil.c dsputil.h
204

    
205
libpostproc/libpostproc.a:
206
	$(MAKE) -C libpostproc
207

    
208
%.o: %.c
209
	$(CC) $(CFLAGS) -c -o $@ $< 
210

    
211
%.o: %.S
212
	$(CC) $(CFLAGS) -c -o $@ $<
213

    
214
depend: $(SRCS)
215
	$(CC) -MM $(CFLAGS) $^ 1>.depend
216

    
217
dep:	depend
218

    
219
clean: $(CLEANAMR)
220
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
221
	   armv4l/*.o armv4l/*~ \
222
	   mlib/*.o mlib/*~ \
223
	   alpha/*.o alpha/*~ \
224
	   ppc/*.o ppc/*~ \
225
	   ps2/*.o ps2/*~ \
226
	   sh4/*.o sh4/*~ \
227
	   sparc/*.o sparc/*~ \
228
	   liba52/*.o liba52/*~ \
229
	   apiexample $(TESTS)
230
	$(MAKE) -C libpostproc clean
231

    
232
distclean: clean
233
	rm -f Makefile.bak .depend
234

    
235
cleanamr:
236
	$(MAKE) -C amr clean
237

    
238
cleanamrfloat:
239
	rm -f amr_float/*.o
240

    
241
cleanamrwbfloat:
242
	$(MAKE) -C amrwb_float -f makefile.gcc clean
243

    
244
# api example program
245
apiexample: apiexample.c $(LIB)
246
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
247

    
248
# cpuid test
249
cpuid_test: i386/cputest.c
250
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
251

    
252
# testing progs
253

    
254
imgresample-test: imgresample.c
255
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
256

    
257
dct-test: dct-test.o fdctref.o $(LIB)
258
	$(CC) -o $@ $^ -lm
259

    
260
motion-test: motion_test.o $(LIB)
261
	$(CC) -o $@ $^ -lm
262

    
263
fft-test: fft-test.o $(LIB)
264
	$(CC) -o $@ $^ -lm
265

    
266
ifeq ($(BUILD_SHARED),yes)
267
install: all install-headers
268
ifeq ($(CONFIG_WIN32),yes)
269
	install -s -m 755 $(SLIB) "$(prefix)"
270
else
271
	install -d $(prefix)/lib
272
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
273
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
274
	ldconfig || true
275
endif
276
else
277
install:
278
endif
279

    
280
installlib: all install-headers
281
	install -m 644 $(LIB) $(prefix)/lib
282

    
283
install-headers:
284
	mkdir -p "$(prefix)/include/ffmpeg"
285
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
286
	               $(SRC_PATH)/libavcodec/common.h \
287
	               $(SRC_PATH)/libavcodec/rational.h \
288
                "$(prefix)/include/ffmpeg"
289

    
290
#
291
# include dependency files if they exist
292
#
293
ifneq ($(wildcard .depend),)
294
include .depend
295
endif