Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ a968e365

History | View | Annotate | Download (4.87 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 28db7fce Michael Niedermayer
      mpegvideo.o h263.o jrevdct.o jfdctfst.o jfdctint.o\
15 10b7b472 Fabrice Bellard
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
16 de6d9b64 Fabrice Bellard
      motion_est.o imgconvert.o imgresample.o msmpeg4.o \
17 be8ffec9 Nick Kurshev
      mpeg12.o h263dec.o svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
18 6d2abd6b Fabrice Bellard
      ratecontrol.o adpcm.o eval.o dv.o error_resilience.o \
19 11f18faf Michael Niedermayer
      wmadec.o fft.o mdct.o mace.o huffyuv.o
20 980fc7b8 Fabrice Bellard
ASM_OBJS=
21 de6d9b64 Fabrice Bellard
22 57514323 Zdenek Kabelac
# currently using liba52 for ac3 decoding
23 d771bcae Fabrice Bellard
ifeq ($(CONFIG_AC3),yes)
24 57514323 Zdenek Kabelac
OBJS+= a52dec.o
25
26
# using builtin liba52 or runtime linked liba52.so.0
27 ff4ec49e Fabrice Bellard
ifneq ($(CONFIG_A52BIN),yes)
28 57514323 Zdenek Kabelac
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
29
	liba52/imdct.o  liba52/parse.o
30 d771bcae Fabrice Bellard
endif
31 ff4ec49e Fabrice Bellard
endif
32 de6d9b64 Fabrice Bellard
33 5798368b Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
34
OBJS += mp3lameaudio.o
35 2a2a98c0 Zdenek Kabelac
EXTRALIBS += -lmp3lame
36 5798368b Juanjo
endif
37
38 81e0d0b4 Mark Hills
ifeq ($(CONFIG_VORBIS),yes)
39
OBJS += oggvorbis.o
40
EXTRALIBS += -lvorbis -lvorbisenc
41
endif
42
43 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
44
CFLAGS+=-p
45
LDFLAGS+=-p
46
endif
47
48 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
49 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
50 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
51 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
52 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
53 923ceff8 Fabrice Bellard
	i386/simple_idct_mmx.o i386/fft_sse.o
54 a968e365 Fabrice Bellard
ifdef TARGET_BUILTIN_VECTOR
55
i386/fft_sse.o: CFLAGS+= -msse
56
endif
57 de6d9b64 Fabrice Bellard
endif
58
59 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
60
ifeq ($(TARGET_ARCH_ARMV4L),yes)
61
ASM_OBJS += armv4l/jrevdct_arm.o
62 676e200c Michael Niedermayer
OBJS += armv4l/dsputil_arm.o armv4l/mpegvideo_arm.o
63 3d03c0a2 Fabrice Bellard
endif
64
65 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
66
# currently only works when libavcodec is used in mplayer
67
ifeq ($(HAVE_MLIB),yes)
68
OBJS += mlib/dsputil_mlib.o
69
CFLAGS += $(MLIB_INC)
70
endif
71
72 1e98dffb Nick Kurshev
# alpha specific stuff
73
ifeq ($(TARGET_ARCH_ALPHA),yes)
74 8b313a47 Falk Hüffner
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o \
75
	alpha/simple_idct_alpha.o alpha/motion_est_alpha.o
76 f9bb4bdf Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
77 0af65aac Falk Hüffner
CFLAGS += -fforce-addr -freduce-all-givs
78 1e98dffb Nick Kurshev
endif
79
80 59925ef2 Brian Foley
ifeq ($(TARGET_ARCH_POWERPC),yes)
81 05c4072b Michael Niedermayer
OBJS += ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
82 ab6c65f6 Brian Foley
endif
83
84 d46aba26 Leon van Stuivenberg
ifeq ($(TARGET_MMI),yes)
85 5917d17c Leon van Stuivenberg
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
86 d46aba26 Leon van Stuivenberg
endif
87
88 ab6c65f6 Brian Foley
ifeq ($(TARGET_ALTIVEC),yes)
89 59925ef2 Brian Foley
CFLAGS += -faltivec
90 8d268a7d Fabrice Bellard
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
91 e629ab68 Romain Dolbeau
        ppc/fft_altivec.o ppc/gmc_altivec.o
92 59925ef2 Brian Foley
endif
93
94 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
95 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
96 980fc7b8 Fabrice Bellard
97 f3ec2d46 Slavik Gnatenko
LIB= $(LIBPREF)avcodec$(LIBSUF)
98 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
99 f3ec2d46 Slavik Gnatenko
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
100 0fd94442 Nick Kurshev
endif
101 6d2abd6b Fabrice Bellard
TESTS= imgresample-test dct-test motion-test fft-test
102 de6d9b64 Fabrice Bellard
103 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
104 ff4ec49e Fabrice Bellard
105 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
106 de6d9b64 Fabrice Bellard
107 e51d4def Arpi
$(LIB): .depend $(OBJS)
108 de6d9b64 Fabrice Bellard
	rm -f $@
109 be7109c1 Michael Niedermayer
	$(AR) rc $@ $(OBJS)
110 f3ec2d46 Slavik Gnatenko
ifneq ($(CONFIG_OS2),yes)
111 be7109c1 Michael Niedermayer
	$(RANLIB) $@
112 f3ec2d46 Slavik Gnatenko
endif
113 ff4ec49e Fabrice Bellard
114 e51d4def Arpi
$(SLIB): .depend $(OBJS)
115 e1707f52 Michael Niedermayer
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
116 de6d9b64 Fabrice Bellard
117
dsputil.o: dsputil.c dsputil.h
118
119
%.o: %.c
120
	$(CC) $(CFLAGS) -c -o $@ $< 
121
122 3d03c0a2 Fabrice Bellard
%.o: %.S
123
	$(CC) $(CFLAGS) -c -o $@ $<
124
125 0af65aac Falk Hüffner
# motion_est_alpha uses the MVI extension, which is not available with
126
# -mcpu=ev4 (default) or ev5/ev56. Thus, force -mcpu=pca56 in those
127
# cases.
128
ifeq ($(TARGET_ARCH_ALPHA),yes)
129
alpha/motion_est_alpha.o: alpha/motion_est_alpha.c
130
	cpu=`echo "$(CFLAGS)" | sed -n 's,.*-mcpu=\([a-zA-Z0-9]*\).*,\1,p'`; \
131
	case x"$$cpu" in x|xev[45]*) newcpu=pca56;; *) newcpu=$$cpu;; esac; \
132
	echo $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<;\
133
	$(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<
134
endif
135
136 e51d4def Arpi
.depend: $(SRCS)
137 a968e365 Fabrice Bellard
	$(CC) -MM $(CFLAGS) $^ 1>.depend
138 e51d4def Arpi
139 980fc7b8 Fabrice Bellard
dep:	depend
140
141 e51d4def Arpi
depend: .depend
142 980fc7b8 Fabrice Bellard
143 de6d9b64 Fabrice Bellard
clean: 
144 77b71ddc Philip Gladstone
	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
145 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
146 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
147 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
148 59925ef2 Brian Foley
	   ppc/*.o ppc/*~ \
149 d46aba26 Leon van Stuivenberg
	   ps2/*.o ps2/*~ \
150 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
151
	   apiexample $(TESTS)
152 de6d9b64 Fabrice Bellard
153 800d7ceb Felix Bünemann
distclean: clean
154 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
155
156 de6d9b64 Fabrice Bellard
# api example program
157
apiexample: apiexample.c $(LIB)
158 cfda33cb Michael Niedermayer
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
159 de6d9b64 Fabrice Bellard
160 c10e9f70 Nick Kurshev
# cpuid test
161
cpuid_test: i386/cputest.c
162
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
163
164 de6d9b64 Fabrice Bellard
# testing progs
165
166
imgresample-test: imgresample.c
167 6acce86b Michael Niedermayer
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
168 de6d9b64 Fabrice Bellard
169 9ebc63a9 Fabrice Bellard
dct-test: dct-test.o fdctref.o $(LIB)
170 90cee0c3 Michael Niedermayer
	$(CC) -o $@ $^ -lm
171 d771bcae Fabrice Bellard
172 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
173 6acce86b Michael Niedermayer
	$(CC) -o $@ $^ -lm
174 4300403e Fabrice Bellard
175 923ceff8 Fabrice Bellard
fft-test: fft-test.o $(LIB)
176 6d2abd6b Fabrice Bellard
	$(CC) -o $@ $^ -lm
177
178 0fd94442 Nick Kurshev
install: all
179
ifeq ($(BUILD_SHARED),yes)
180 c1325d18 Volker Moell
	install -d $(prefix)/lib
181 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
182 c1325d18 Volker Moell
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
183
	ldconfig || true
184 ff4ec49e Fabrice Bellard
	mkdir -p $(prefix)/include/ffmpeg
185 3565eeaa Falk Hüffner
	install -m 644 $(VPATH)/avcodec.h $(prefix)/include/ffmpeg/avcodec.h
186
	install -m 644 $(VPATH)/common.h $(prefix)/include/ffmpeg/common.h
187 0fd94442 Nick Kurshev
endif
188 773cefc6 Fabrice Bellard
189
installlib: all
190
	install -m 644 $(LIB) $(prefix)/lib
191
	mkdir -p $(prefix)/include/ffmpeg
192
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
193
                $(prefix)/include/ffmpeg
194
195 d771bcae Fabrice Bellard
#
196
# include dependency files if they exist
197
#
198
ifneq ($(wildcard .depend),)
199
include .depend
200
endif