Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ bec89a84

History | View | Annotate | Download (5.28 KB)

1 4cc281d9 Fabrice Bellard
#
2
# libavcodec Makefile
3 ff4ec49e Fabrice Bellard
# (c) 2000, 2001, 2002 Fabrice Bellard
4 4cc281d9 Fabrice Bellard
#
5 980fc7b8 Fabrice Bellard
include ../config.mak
6
7 4cc281d9 Fabrice Bellard
VPATH=$(SRC_PATH)/libavcodec
8
9 ff4ec49e Fabrice Bellard
# NOTE: -I.. is needed to include config.h
10 eddbd7e5 Roy Sigurd Karlsbakk
CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
11 de6d9b64 Fabrice Bellard
LDFLAGS= -g
12
13 773cefc6 Fabrice Bellard
OBJS= common.o utils.o mem.o allcodecs.o \
14 1d0d55da Michael Niedermayer
      mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
15 10b7b472 Fabrice Bellard
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
16 1d0d55da Michael Niedermayer
      motion_est.o imgconvert.o imgresample.o \
17
      mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
18 6d2abd6b Fabrice Bellard
      ratecontrol.o adpcm.o eval.o dv.o error_resilience.o \
19 f2598a19 Zdenek Kabelac
      fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o
20 980fc7b8 Fabrice Bellard
ASM_OBJS=
21 de6d9b64 Fabrice Bellard
22 1d0d55da Michael Niedermayer
# 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 57514323 Zdenek Kabelac
# currently using liba52 for ac3 decoding
28 d771bcae Fabrice Bellard
ifeq ($(CONFIG_AC3),yes)
29 57514323 Zdenek Kabelac
OBJS+= a52dec.o
30
31
# using builtin liba52 or runtime linked liba52.so.0
32 ff4ec49e Fabrice Bellard
ifneq ($(CONFIG_A52BIN),yes)
33 57514323 Zdenek Kabelac
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
34
	liba52/imdct.o  liba52/parse.o
35 d771bcae Fabrice Bellard
endif
36 ff4ec49e Fabrice Bellard
endif
37 de6d9b64 Fabrice Bellard
38 bba9b16c Michael Niedermayer
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 5798368b Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
48
OBJS += mp3lameaudio.o
49 2a2a98c0 Zdenek Kabelac
EXTRALIBS += -lmp3lame
50 5798368b Juanjo
endif
51
52 81e0d0b4 Mark Hills
ifeq ($(CONFIG_VORBIS),yes)
53
OBJS += oggvorbis.o
54
EXTRALIBS += -lvorbis -lvorbisenc
55
endif
56
57 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
58
CFLAGS+=-p
59
LDFLAGS+=-p
60
endif
61
62 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
63 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
64 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
65 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
66 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
67 923ceff8 Fabrice Bellard
	i386/simple_idct_mmx.o i386/fft_sse.o
68 a968e365 Fabrice Bellard
ifdef TARGET_BUILTIN_VECTOR
69
i386/fft_sse.o: CFLAGS+= -msse
70
endif
71 de6d9b64 Fabrice Bellard
endif
72
73 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
74
ifeq ($(TARGET_ARCH_ARMV4L),yes)
75
ASM_OBJS += armv4l/jrevdct_arm.o
76 676e200c Michael Niedermayer
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
77 3d03c0a2 Fabrice Bellard
endif
78
79 c34270f5 Fabrice Bellard
# 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 1e98dffb Nick Kurshev
# alpha specific stuff
87
ifeq ($(TARGET_ARCH_ALPHA),yes)
88 8b313a47 Falk Hüffner
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
89
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
90 f9bb4bdf Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
91 0af65aac Falk Hüffner
CFLAGS += -fforce-addr -freduce-all-givs
92 1e98dffb Nick Kurshev
endif
93
94 59925ef2 Brian Foley
ifeq ($(TARGET_ARCH_POWERPC),yes)
95 05c4072b Michael Niedermayer
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
96 ab6c65f6 Brian Foley
endif
97
98 d46aba26 Leon van Stuivenberg
ifeq ($(TARGET_MMI),yes)
99 5917d17c Leon van Stuivenberg
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
100 d46aba26 Leon van Stuivenberg
endif
101
102 ab6c65f6 Brian Foley
ifeq ($(TARGET_ALTIVEC),yes)
103 3b991c54 Romain Dolbeau
ifeq ($(TARGET_OS),Darwin)
104 59925ef2 Brian Foley
CFLAGS += -faltivec
105 3b991c54 Romain Dolbeau
else
106
CFLAGS += -maltivec -mabi=altivec
107
endif
108 8d268a7d Fabrice Bellard
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
109 e629ab68 Romain Dolbeau
        ppc/fft_altivec.o ppc/gmc_altivec.o
110 59925ef2 Brian Foley
endif
111
112 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
113 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
114 980fc7b8 Fabrice Bellard
115 f3ec2d46 Slavik Gnatenko
LIB= $(LIBPREF)avcodec$(LIBSUF)
116 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
117 f3ec2d46 Slavik Gnatenko
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
118 0fd94442 Nick Kurshev
endif
119 6d2abd6b Fabrice Bellard
TESTS= imgresample-test dct-test motion-test fft-test
120 de6d9b64 Fabrice Bellard
121 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
122 ff4ec49e Fabrice Bellard
123 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
124 de6d9b64 Fabrice Bellard
125 811b32ed Fabrice Bellard
$(LIB): $(OBJS)
126 de6d9b64 Fabrice Bellard
	rm -f $@
127 be7109c1 Michael Niedermayer
	$(AR) rc $@ $(OBJS)
128 f3ec2d46 Slavik Gnatenko
ifneq ($(CONFIG_OS2),yes)
129 be7109c1 Michael Niedermayer
	$(RANLIB) $@
130 f3ec2d46 Slavik Gnatenko
endif
131 ff4ec49e Fabrice Bellard
132 811b32ed Fabrice Bellard
$(SLIB): $(OBJS)
133 e1707f52 Michael Niedermayer
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
134 de6d9b64 Fabrice Bellard
135
dsputil.o: dsputil.c dsputil.h
136
137 bba9b16c Michael Niedermayer
libpostproc/libpostproc.a:
138
	$(MAKE) -C libpostproc
139
140 de6d9b64 Fabrice Bellard
%.o: %.c
141
	$(CC) $(CFLAGS) -c -o $@ $< 
142
143 3d03c0a2 Fabrice Bellard
%.o: %.S
144
	$(CC) $(CFLAGS) -c -o $@ $<
145
146 0af65aac Falk Hüffner
# 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 811b32ed Fabrice Bellard
depend: $(SRCS)
158 a968e365 Fabrice Bellard
	$(CC) -MM $(CFLAGS) $^ 1>.depend
159 e51d4def Arpi
160 980fc7b8 Fabrice Bellard
dep:	depend
161
162 de6d9b64 Fabrice Bellard
clean: 
163 77b71ddc Philip Gladstone
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
164 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
165 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
166 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
167 59925ef2 Brian Foley
	   ppc/*.o ppc/*~ \
168 d46aba26 Leon van Stuivenberg
	   ps2/*.o ps2/*~ \
169 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
170
	   apiexample $(TESTS)
171 64094f37 Zdenek Kabelac
	$(MAKE) -C libpostproc clean
172 de6d9b64 Fabrice Bellard
173 800d7ceb Felix Bünemann
distclean: clean
174 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
175
176 de6d9b64 Fabrice Bellard
# api example program
177
apiexample: apiexample.c $(LIB)
178 cfda33cb Michael Niedermayer
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
179 de6d9b64 Fabrice Bellard
180 c10e9f70 Nick Kurshev
# cpuid test
181
cpuid_test: i386/cputest.c
182
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
183
184 de6d9b64 Fabrice Bellard
# testing progs
185
186
imgresample-test: imgresample.c
187 6acce86b Michael Niedermayer
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
188 de6d9b64 Fabrice Bellard
189 9ebc63a9 Fabrice Bellard
dct-test: dct-test.o fdctref.o $(LIB)
190 90cee0c3 Michael Niedermayer
	$(CC) -o $@ $^ -lm
191 d771bcae Fabrice Bellard
192 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
193 6acce86b Michael Niedermayer
	$(CC) -o $@ $^ -lm
194 4300403e Fabrice Bellard
195 923ceff8 Fabrice Bellard
fft-test: fft-test.o $(LIB)
196 6d2abd6b Fabrice Bellard
	$(CC) -o $@ $^ -lm
197
198 0fd94442 Nick Kurshev
install: all
199
ifeq ($(BUILD_SHARED),yes)
200 c1325d18 Volker Moell
	install -d $(prefix)/lib
201 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
202 c1325d18 Volker Moell
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
203
	ldconfig || true
204 ff4ec49e Fabrice Bellard
	mkdir -p $(prefix)/include/ffmpeg
205 3565eeaa Falk Hüffner
	install -m 644 $(VPATH)/avcodec.h $(prefix)/include/ffmpeg/avcodec.h
206
	install -m 644 $(VPATH)/common.h $(prefix)/include/ffmpeg/common.h
207 0fd94442 Nick Kurshev
endif
208 773cefc6 Fabrice Bellard
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 d771bcae Fabrice Bellard
#
216
# include dependency files if they exist
217
#
218
ifneq ($(wildcard .depend),)
219
include .depend
220
endif