Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 44f54ceb

History | View | Annotate | Download (6.85 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
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
ifdef TARGET_BUILTIN_VECTOR
121
i386/fft_sse.o: CFLAGS+= -msse
122
depend: CFLAGS+= -msse
123
endif
124
endif
125

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

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

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

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

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

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

    
164
ifeq ($(TARGET_ARCH_SPARC),yes)
165
OBJS+=sparc/dsputil_vis.o
166
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
167
endif
168

    
169

    
170
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
171
OBJS := $(OBJS) $(ASM_OBJS)
172

    
173
LIB= $(LIBPREF)avcodec$(LIBSUF)
174
ifeq ($(BUILD_SHARED),yes)
175
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
176
endif
177
TESTS= imgresample-test dct-test motion-test fft-test
178

    
179
all: $(LIB) $(SLIB)
180

    
181
amrlibs:
182
	$(MAKE) -C amr spclib fipoplib
183

    
184
tests: apiexample cpuid_test $(TESTS)
185

    
186
$(LIB): $(OBJS) $(AMRLIBS)
187
	rm -f $@
188
	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
189
	$(RANLIB) $@
190

    
191
$(SLIB): $(OBJS)
192
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
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
197
endif
198

    
199
dsputil.o: dsputil.c dsputil.h
200

    
201
libpostproc/libpostproc.a:
202
	$(MAKE) -C libpostproc
203

    
204
%.o: %.c
205
	$(CC) $(CFLAGS) -c -o $@ $< 
206

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

    
210
depend: $(SRCS)
211
	$(CC) -MM $(CFLAGS) $^ 1>.depend
212

    
213
dep:	depend
214

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

    
227
distclean: clean
228
	rm -f Makefile.bak .depend
229

    
230
cleanamr:
231
	$(MAKE) -C amr clean
232

    
233
cleanamrfloat:
234
	rm -f amr_float/*.o
235

    
236
cleanamrwbfloat:
237
	$(MAKE) -C amrwb_float -f makefile.gcc clean
238

    
239
# api example program
240
apiexample: apiexample.c $(LIB)
241
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
242

    
243
# cpuid test
244
cpuid_test: i386/cputest.c
245
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
246

    
247
# testing progs
248

    
249
imgresample-test: imgresample.c
250
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
251

    
252
dct-test: dct-test.o fdctref.o $(LIB)
253
	$(CC) -o $@ $^ -lm
254

    
255
motion-test: motion_test.o $(LIB)
256
	$(CC) -o $@ $^ -lm
257

    
258
fft-test: fft-test.o $(LIB)
259
	$(CC) -o $@ $^ -lm
260

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

    
275
installlib: all install-headers
276
	install -m 644 $(LIB) $(prefix)/lib
277

    
278
install-headers:
279
	mkdir -p "$(prefix)/include/ffmpeg"
280
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
281
	               $(SRC_PATH)/libavcodec/common.h \
282
	               $(SRC_PATH)/libavcodec/rational.h \
283
                "$(prefix)/include/ffmpeg"
284

    
285
#
286
# include dependency files if they exist
287
#
288
ifneq ($(wildcard .depend),)
289
include .depend
290
endif