Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ bec89a84

History | View | Annotate | Download (5.28 KB)

1
#
2
# libavcodec Makefile
3
# (c) 2000, 2001, 2002 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) -Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
11
LDFLAGS= -g
12

    
13
OBJS= common.o utils.o mem.o allcodecs.o \
14
      mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
15
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
16
      motion_est.o imgconvert.o imgresample.o \
17
      mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
18
      ratecontrol.o adpcm.o eval.o dv.o error_resilience.o \
19
      fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o
20
ASM_OBJS=
21

    
22
# codecs which are patented in some non free countries like the us
23
ifeq ($(CONFIG_RISKY),yes)
24
OBJS+= h263.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o
25
endif
26

    
27
# currently using liba52 for ac3 decoding
28
ifeq ($(CONFIG_AC3),yes)
29
OBJS+= a52dec.o
30

    
31
# using builtin liba52 or runtime linked liba52.so.0
32
ifneq ($(CONFIG_A52BIN),yes)
33
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
34
	liba52/imdct.o  liba52/parse.o
35
endif
36
endif
37

    
38
ifeq ($(CONFIG_PP),yes)
39
ifeq ($(SHARED_PP),yes)
40
EXTRALIBS += -lpostproc
41
else
42
# LIBS += libpostproc/libpostproc.a ... should be fixed
43
OBJS += libpostproc/postprocess.o
44
endif
45
endif
46

    
47
ifeq ($(CONFIG_MP3LAME),yes)
48
OBJS += mp3lameaudio.o
49
EXTRALIBS += -lmp3lame
50
endif
51

    
52
ifeq ($(CONFIG_VORBIS),yes)
53
OBJS += oggvorbis.o
54
EXTRALIBS += -lvorbis -lvorbisenc
55
endif
56

    
57
ifeq ($(TARGET_GPROF),yes)
58
CFLAGS+=-p
59
LDFLAGS+=-p
60
endif
61

    
62
# i386 mmx specific stuff
63
ifeq ($(TARGET_MMX),yes)
64
OBJS += i386/fdct_mmx.o i386/cputest.o \
65
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
66
	i386/idct_mmx.o i386/motion_est_mmx.o \
67
	i386/simple_idct_mmx.o i386/fft_sse.o
68
ifdef TARGET_BUILTIN_VECTOR
69
i386/fft_sse.o: CFLAGS+= -msse
70
endif
71
endif
72

    
73
# armv4l specific stuff
74
ifeq ($(TARGET_ARCH_ARMV4L),yes)
75
ASM_OBJS += armv4l/jrevdct_arm.o
76
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
77
endif
78

    
79
# sun mediaLib specific stuff
80
# currently only works when libavcodec is used in mplayer
81
ifeq ($(HAVE_MLIB),yes)
82
OBJS += mlib/dsputil_mlib.o
83
CFLAGS += $(MLIB_INC)
84
endif
85

    
86
# alpha specific stuff
87
ifeq ($(TARGET_ARCH_ALPHA),yes)
88
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
89
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
90
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
91
CFLAGS += -fforce-addr -freduce-all-givs
92
endif
93

    
94
ifeq ($(TARGET_ARCH_POWERPC),yes)
95
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
96
endif
97

    
98
ifeq ($(TARGET_MMI),yes)
99
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
100
endif
101

    
102
ifeq ($(TARGET_ALTIVEC),yes)
103
ifeq ($(TARGET_OS),Darwin)
104
CFLAGS += -faltivec
105
else
106
CFLAGS += -maltivec -mabi=altivec
107
endif
108
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
109
        ppc/fft_altivec.o ppc/gmc_altivec.o
110
endif
111

    
112
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
113
OBJS := $(OBJS) $(ASM_OBJS)
114

    
115
LIB= $(LIBPREF)avcodec$(LIBSUF)
116
ifeq ($(BUILD_SHARED),yes)
117
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
118
endif
119
TESTS= imgresample-test dct-test motion-test fft-test
120

    
121
all: $(LIB) $(SLIB)
122

    
123
tests: apiexample cpuid_test $(TESTS)
124

    
125
$(LIB): $(OBJS)
126
	rm -f $@
127
	$(AR) rc $@ $(OBJS)
128
ifneq ($(CONFIG_OS2),yes)
129
	$(RANLIB) $@
130
endif
131

    
132
$(SLIB): $(OBJS)
133
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
134

    
135
dsputil.o: dsputil.c dsputil.h
136

    
137
libpostproc/libpostproc.a:
138
	$(MAKE) -C libpostproc
139

    
140
%.o: %.c
141
	$(CC) $(CFLAGS) -c -o $@ $< 
142

    
143
%.o: %.S
144
	$(CC) $(CFLAGS) -c -o $@ $<
145

    
146
# motion_est_alpha uses the MVI extension, which is not available with
147
# -mcpu=ev4 (default) or ev5/ev56. Thus, force -mcpu=pca56 in those
148
# cases.
149
ifeq ($(TARGET_ARCH_ALPHA),yes)
150
alpha/motion_est_alpha.o: alpha/motion_est_alpha.c
151
	cpu=`echo "$(CFLAGS)" | sed -n 's,.*-mcpu=\([a-zA-Z0-9]*\).*,\1,p'`; \
152
	case x"$$cpu" in x|xev[45]*) newcpu=pca56;; *) newcpu=$$cpu;; esac; \
153
	echo $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<;\
154
	$(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<
155
endif
156

    
157
depend: $(SRCS)
158
	$(CC) -MM $(CFLAGS) $^ 1>.depend
159

    
160
dep:	depend
161

    
162
clean: 
163
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
164
	   armv4l/*.o armv4l/*~ \
165
	   mlib/*.o mlib/*~ \
166
	   alpha/*.o alpha/*~ \
167
	   ppc/*.o ppc/*~ \
168
	   ps2/*.o ps2/*~ \
169
	   liba52/*.o liba52/*~ \
170
	   apiexample $(TESTS)
171
	$(MAKE) -C libpostproc clean
172

    
173
distclean: clean
174
	rm -f Makefile.bak .depend
175

    
176
# api example program
177
apiexample: apiexample.c $(LIB)
178
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
179

    
180
# cpuid test
181
cpuid_test: i386/cputest.c
182
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
183

    
184
# testing progs
185

    
186
imgresample-test: imgresample.c
187
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
188

    
189
dct-test: dct-test.o fdctref.o $(LIB)
190
	$(CC) -o $@ $^ -lm
191

    
192
motion-test: motion_test.o $(LIB)
193
	$(CC) -o $@ $^ -lm
194

    
195
fft-test: fft-test.o $(LIB)
196
	$(CC) -o $@ $^ -lm
197

    
198
install: all
199
ifeq ($(BUILD_SHARED),yes)
200
	install -d $(prefix)/lib
201
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
202
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
203
	ldconfig || true
204
	mkdir -p $(prefix)/include/ffmpeg
205
	install -m 644 $(VPATH)/avcodec.h $(prefix)/include/ffmpeg/avcodec.h
206
	install -m 644 $(VPATH)/common.h $(prefix)/include/ffmpeg/common.h
207
endif
208

    
209
installlib: all
210
	install -m 644 $(LIB) $(prefix)/lib
211
	mkdir -p $(prefix)/include/ffmpeg
212
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
213
                $(prefix)/include/ffmpeg
214

    
215
#
216
# include dependency files if they exist
217
#
218
ifneq ($(wildcard .depend),)
219
include .depend
220
endif