Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ fafa0b75

History | View | Annotate | Download (6.54 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
23

    
24
ifeq ($(AMR_NB),yes)
25
ifeq ($(AMR_NB_FIXED),yes)
26
OBJS+= amr.o
27
AMREXTRALIBS+= amr/*.o
28
AMRLIBS=amrlibs
29
CLEANAMR=cleanamr
30
else
31
OBJS+= amr.o amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
32
CLEANAMR=cleanamrfloat
33
endif
34
endif
35

    
36
ifeq ($(AMR_WB),yes)
37
OBJS+= amr.o amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
38
		amrwb_float/dec_if.o amrwb_float/dec_lpc.o amrwb_float/dec_main.o \
39
		amrwb_float/dec_rom.o amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
40
		amrwb_float/enc_dtx.o amrwb_float/enc_gain.o amrwb_float/enc_if.o \
41
		amrwb_float/enc_lpc.o amrwb_float/enc_main.o amrwb_float/enc_rom.o \
42
		amrwb_float/enc_util.o amrwb_float/if_rom.o
43
endif
44
CLEANAMRWB=cleanamrwbfloat
45
ASM_OBJS=
46

    
47
# codecs which are patented in some non free countries like the us
48
ifeq ($(CONFIG_RISKY),yes)
49
OBJS+= h263.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o
50
endif
51

    
52
ifeq ($(HAVE_XVMC_ACCEL),yes)
53
OBJS+= xvmcvideo.o
54
endif
55

    
56
# currently using liba52 for ac3 decoding
57
ifeq ($(CONFIG_AC3),yes)
58
OBJS+= a52dec.o
59

    
60
# using builtin liba52 or runtime linked liba52.so.0
61
ifneq ($(CONFIG_A52BIN),yes)
62
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
63
	liba52/imdct.o  liba52/parse.o liba52/crc.o liba52/resample.o
64
endif
65
endif
66

    
67
ifeq ($(CONFIG_FAAD),yes)
68
OBJS+= faad.o
69
ifeq ($(CONFIG_FAADBIN),yes)
70
# no libs needed
71
else
72
EXTRALIBS += -lfaad
73
endif
74
endif
75

    
76
ifeq ($(CONFIG_FAAC),yes)
77
OBJS+= faac.o
78
EXTRALIBS += -lfaac
79
endif
80

    
81
ifeq ($(CONFIG_PP),yes)
82
ifeq ($(SHARED_PP),yes)
83
EXTRALIBS += -lpostproc
84
else
85
# LIBS += libpostproc/libpostproc.a ... should be fixed
86
OBJS += libpostproc/postprocess.o
87
endif
88
endif
89

    
90
ifeq ($(CONFIG_MP3LAME),yes)
91
OBJS += mp3lameaudio.o
92
EXTRALIBS += -lmp3lame
93
endif
94

    
95
ifeq ($(CONFIG_VORBIS),yes)
96
OBJS += oggvorbis.o
97
EXTRALIBS += -lvorbis -lvorbisenc
98
endif
99

    
100
ifeq ($(TARGET_GPROF),yes)
101
CFLAGS+=-p
102
LDFLAGS+=-p
103
endif
104

    
105
# i386 mmx specific stuff
106
ifeq ($(TARGET_MMX),yes)
107
OBJS += i386/fdct_mmx.o i386/cputest.o \
108
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
109
	i386/idct_mmx.o i386/motion_est_mmx.o \
110
	i386/simple_idct_mmx.o i386/fft_sse.o
111
ifdef TARGET_BUILTIN_VECTOR
112
i386/fft_sse.o: CFLAGS+= -msse
113
endif
114
endif
115

    
116
# armv4l specific stuff
117
ifeq ($(TARGET_ARCH_ARMV4L),yes)
118
ASM_OBJS += armv4l/jrevdct_arm.o armv4l/simple_idct_arm.o
119
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
120
endif
121

    
122
# sun mediaLib specific stuff
123
# currently only works when libavcodec is used in mplayer
124
ifeq ($(HAVE_MLIB),yes)
125
OBJS += mlib/dsputil_mlib.o
126
CFLAGS += $(MLIB_INC)
127
endif
128

    
129
# alpha specific stuff
130
ifeq ($(TARGET_ARCH_ALPHA),yes)
131
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
132
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
133
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
134
CFLAGS += -fforce-addr -freduce-all-givs
135
endif
136

    
137
ifeq ($(TARGET_ARCH_POWERPC),yes)
138
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
139
endif
140

    
141
ifeq ($(TARGET_MMI),yes)
142
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
143
endif
144

    
145
ifeq ($(TARGET_ALTIVEC),yes)
146
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
147
        ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o
148
endif
149

    
150
ifeq ($(TARGET_ARCH_SH4),yes)
151
OBJS+= sh4/idct_sh4.o sh4/dsputil_sh4.o sh4/dsputil_align.o
152
endif
153

    
154

    
155
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
156
OBJS := $(OBJS) $(ASM_OBJS)
157

    
158
LIB= $(LIBPREF)avcodec$(LIBSUF)
159
ifeq ($(BUILD_SHARED),yes)
160
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
161
endif
162
TESTS= imgresample-test dct-test motion-test fft-test
163

    
164
all: $(LIB) $(SLIB)
165

    
166
amrlibs:
167
	$(MAKE) -C amr spclib fipoplib
168

    
169
tests: apiexample cpuid_test $(TESTS)
170

    
171
$(LIB): $(OBJS) $(AMRLIBS)
172
	rm -f $@
173
	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
174
	$(RANLIB) $@
175

    
176
$(SLIB): $(OBJS)
177
ifeq ($(CONFIG_WIN32),yes)
178
	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
179
	-lib /machine:i386 /def:$(@:.dll=.def)
180
else
181
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
182
endif
183

    
184
dsputil.o: dsputil.c dsputil.h
185

    
186
libpostproc/libpostproc.a:
187
	$(MAKE) -C libpostproc
188

    
189
%.o: %.c
190
	$(CC) $(CFLAGS) -c -o $@ $< 
191

    
192
%.o: %.S
193
	$(CC) $(CFLAGS) -c -o $@ $<
194

    
195
depend: $(SRCS)
196
	$(CC) -MM $(CFLAGS) $^ 1>.depend
197

    
198
dep:	depend
199

    
200
clean: $(CLEANAMR)
201
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
202
	   armv4l/*.o armv4l/*~ \
203
	   mlib/*.o mlib/*~ \
204
	   alpha/*.o alpha/*~ \
205
	   ppc/*.o ppc/*~ \
206
	   ps2/*.o ps2/*~ \
207
	   sh4/*.o sh4/*~ \
208
	   liba52/*.o liba52/*~ \
209
	   apiexample $(TESTS)
210
	$(MAKE) -C libpostproc clean
211

    
212
distclean: clean
213
	rm -f Makefile.bak .depend
214

    
215
cleanamr:
216
	$(MAKE) -C amr clean
217

    
218
cleanamrfloat:
219
	rm -f amr_float/*.o
220

    
221
cleanamrwbfloat:
222
	$(MAKE) -C amrwb_float -f makefile.gcc clean
223

    
224
# api example program
225
apiexample: apiexample.c $(LIB)
226
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
227

    
228
# cpuid test
229
cpuid_test: i386/cputest.c
230
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
231

    
232
# testing progs
233

    
234
imgresample-test: imgresample.c
235
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
236

    
237
dct-test: dct-test.o fdctref.o $(LIB)
238
	$(CC) -o $@ $^ -lm
239

    
240
motion-test: motion_test.o $(LIB)
241
	$(CC) -o $@ $^ -lm
242

    
243
fft-test: fft-test.o $(LIB)
244
	$(CC) -o $@ $^ -lm
245

    
246
ifeq ($(BUILD_SHARED),yes)
247
install: all install-headers
248
ifeq ($(CONFIG_WIN32),yes)
249
	install -s -m 755 $(SLIB) "$(prefix)"
250
else
251
	install -d $(prefix)/lib
252
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
253
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
254
	ldconfig || true
255
endif
256
else
257
install:
258
endif
259

    
260
installlib: all install-headers
261
	install -m 644 $(LIB) $(prefix)/lib
262

    
263
install-headers:
264
	mkdir -p "$(prefix)/include/ffmpeg"
265
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
266
	               $(SRC_PATH)/libavcodec/common.h \
267
	               $(SRC_PATH)/libavcodec/rational.h \
268
                "$(prefix)/include/ffmpeg"
269

    
270
#
271
# include dependency files if they exist
272
#
273
ifneq ($(wildcard .depend),)
274
include .depend
275
endif