Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ cfda33cb

History | View | Annotate | Download (3.95 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 3aa102be Michael Niedermayer
      ratecontrol.o adpcm.o eval.o
19 980fc7b8 Fabrice Bellard
ASM_OBJS=
20 de6d9b64 Fabrice Bellard
21 57514323 Zdenek Kabelac
# currently using liba52 for ac3 decoding
22 d771bcae Fabrice Bellard
ifeq ($(CONFIG_AC3),yes)
23 57514323 Zdenek Kabelac
OBJS+= a52dec.o
24
25
# using builtin liba52 or runtime linked liba52.so.0
26 ff4ec49e Fabrice Bellard
ifneq ($(CONFIG_A52BIN),yes)
27 57514323 Zdenek Kabelac
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
28
	liba52/imdct.o  liba52/parse.o
29 d771bcae Fabrice Bellard
endif
30 ff4ec49e Fabrice Bellard
endif
31 de6d9b64 Fabrice Bellard
32 5798368b Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
33
OBJS += mp3lameaudio.o
34 2a2a98c0 Zdenek Kabelac
EXTRALIBS += -lmp3lame
35 5798368b Juanjo
endif
36
37 81e0d0b4 Mark Hills
ifeq ($(CONFIG_VORBIS),yes)
38
OBJS += oggvorbis.o
39
EXTRALIBS += -lvorbis -lvorbisenc
40
endif
41
42 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
43
CFLAGS+=-p
44
LDFLAGS+=-p
45
endif
46
47 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
48 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
49 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
50 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
51 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
52 d962f6fd Arpi
	i386/simple_idct_mmx.o
53 de6d9b64 Fabrice Bellard
endif
54
55 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
56
ifeq ($(TARGET_ARCH_ARMV4L),yes)
57
ASM_OBJS += armv4l/jrevdct_arm.o
58
OBJS += armv4l/dsputil_arm.o
59
endif
60
61 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
62
# currently only works when libavcodec is used in mplayer
63
ifeq ($(HAVE_MLIB),yes)
64
OBJS += mlib/dsputil_mlib.o
65
CFLAGS += $(MLIB_INC)
66
endif
67
68 1e98dffb Nick Kurshev
# alpha specific stuff
69
ifeq ($(TARGET_ARCH_ALPHA),yes)
70 57d2bce1 Falk Hüffner
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o alpha/motion_est_alpha.o
71 bb7d4939 Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o
72 14ac09bf Falk Hüffner
CFLAGS += -Wa,-mpca56 -finline-limit=8000 -fforce-addr -freduce-all-givs
73 1e98dffb Nick Kurshev
endif
74
75 59925ef2 Brian Foley
ifeq ($(TARGET_ARCH_POWERPC),yes)
76 ab6c65f6 Brian Foley
OBJS += ppc/dsputil_ppc.o
77
endif
78
79
ifeq ($(TARGET_ALTIVEC),yes)
80 59925ef2 Brian Foley
CFLAGS += -faltivec
81
OBJS += ppc/dsputil_altivec.o
82
endif
83
84 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
85 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
86 980fc7b8 Fabrice Bellard
87 de6d9b64 Fabrice Bellard
LIB= libavcodec.a
88 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
89 ff4ec49e Fabrice Bellard
SLIB= libavcodec.so
90 0fd94442 Nick Kurshev
endif
91 4300403e Fabrice Bellard
TESTS= imgresample-test dct-test motion-test
92 de6d9b64 Fabrice Bellard
93 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
94 ff4ec49e Fabrice Bellard
95 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
96 de6d9b64 Fabrice Bellard
97 ff4ec49e Fabrice Bellard
$(LIB): $(OBJS)
98 de6d9b64 Fabrice Bellard
	rm -f $@
99 be7109c1 Michael Niedermayer
	$(AR) rc $@ $(OBJS)
100
	$(RANLIB) $@
101 ff4ec49e Fabrice Bellard
102
$(SLIB): $(OBJS)
103 e1707f52 Michael Niedermayer
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
104 de6d9b64 Fabrice Bellard
105
dsputil.o: dsputil.c dsputil.h
106
107
%.o: %.c
108
	$(CC) $(CFLAGS) -c -o $@ $< 
109
110 3d03c0a2 Fabrice Bellard
%.o: %.S
111
	$(CC) $(CFLAGS) -c -o $@ $<
112
113 980fc7b8 Fabrice Bellard
# depend only used by mplayer now
114
dep:	depend
115
116
depend:
117
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
118
119 de6d9b64 Fabrice Bellard
clean: 
120 1ac9248b Zdenek Kabelac
	rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
121 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
122 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
123 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
124 59925ef2 Brian Foley
	   ppc/*.o ppc/*~ \
125 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
126
	   apiexample $(TESTS)
127 de6d9b64 Fabrice Bellard
128 800d7ceb Felix Bünemann
distclean: clean
129 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
130
131 de6d9b64 Fabrice Bellard
# api example program
132
apiexample: apiexample.c $(LIB)
133 cfda33cb Michael Niedermayer
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
134 de6d9b64 Fabrice Bellard
135 c10e9f70 Nick Kurshev
# cpuid test
136
cpuid_test: i386/cputest.c
137
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
138
139 de6d9b64 Fabrice Bellard
# testing progs
140
141
imgresample-test: imgresample.c
142 6acce86b Michael Niedermayer
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
143 de6d9b64 Fabrice Bellard
144 86748dbc Michael Niedermayer
dct-test: dct-test.o jfdctfst.o jfdctint.o i386/fdct_mmx.o\
145
          fdctref.o jrevdct.o i386/idct_mmx.o simple_idct.o i386/simple_idct_mmx.o
146 90cee0c3 Michael Niedermayer
	$(CC) -o $@ $^ -lm
147 d771bcae Fabrice Bellard
148 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
149 6acce86b Michael Niedermayer
	$(CC) -o $@ $^ -lm
150 4300403e Fabrice Bellard
151 0fd94442 Nick Kurshev
install: all
152
ifeq ($(BUILD_SHARED),yes)
153 c1325d18 Volker Moell
	install -d $(prefix)/lib
154 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
155 c1325d18 Volker Moell
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
156
	ldconfig || true
157 ff4ec49e Fabrice Bellard
	mkdir -p $(prefix)/include/ffmpeg
158
	install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
159
	install -m 644 common.h $(prefix)/include/ffmpeg/common.h
160 0fd94442 Nick Kurshev
endif
161 773cefc6 Fabrice Bellard
162
installlib: all
163
	install -m 644 $(LIB) $(prefix)/lib
164
	mkdir -p $(prefix)/include/ffmpeg
165
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
166
                $(prefix)/include/ffmpeg
167
168 d771bcae Fabrice Bellard
#
169
# include dependency files if they exist
170
#
171
ifneq ($(wildcard .depend),)
172
include .depend
173
endif