Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ f9bb4bdf

History | View | Annotate | Download (4.5 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 h263.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 msmpeg4.o \
17
      mpeg12.o h263dec.o svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
18
      ratecontrol.o adpcm.o eval.o
19
ASM_OBJS=
20

    
21
# currently using liba52 for ac3 decoding
22
ifeq ($(CONFIG_AC3),yes)
23
OBJS+= a52dec.o
24

    
25
# using builtin liba52 or runtime linked liba52.so.0
26
ifneq ($(CONFIG_A52BIN),yes)
27
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
28
	liba52/imdct.o  liba52/parse.o
29
endif
30
endif
31

    
32
ifeq ($(CONFIG_MP3LAME),yes)
33
OBJS += mp3lameaudio.o
34
EXTRALIBS += -lmp3lame
35
endif
36

    
37
ifeq ($(CONFIG_VORBIS),yes)
38
OBJS += oggvorbis.o
39
EXTRALIBS += -lvorbis -lvorbisenc
40
endif
41

    
42
ifeq ($(TARGET_GPROF),yes)
43
CFLAGS+=-p
44
LDFLAGS+=-p
45
endif
46

    
47
# i386 mmx specific stuff
48
ifeq ($(TARGET_MMX),yes)
49
OBJS += i386/fdct_mmx.o i386/cputest.o \
50
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
51
	i386/idct_mmx.o i386/motion_est_mmx.o \
52
	i386/simple_idct_mmx.o
53
endif
54

    
55
# 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
# 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
# alpha specific stuff
69
ifeq ($(TARGET_ARCH_ALPHA),yes)
70
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o alpha/motion_est_alpha.o
71
ASM_OBJS += alpha/dsputil_alpha_asm.o alpha/motion_est_mvi_asm.o
72
CFLAGS += -fforce-addr -freduce-all-givs
73
endif
74

    
75
ifeq ($(TARGET_ARCH_POWERPC),yes)
76
OBJS += ppc/dsputil_ppc.o
77
endif
78

    
79
ifeq ($(TARGET_MMI),yes)
80
OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o
81
endif
82

    
83
ifeq ($(TARGET_ALTIVEC),yes)
84
CFLAGS += -faltivec
85
OBJS += ppc/dsputil_altivec.o
86
endif
87

    
88
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
89
OBJS := $(OBJS) $(ASM_OBJS)
90

    
91
LIB= libavcodec.a
92
ifeq ($(BUILD_SHARED),yes)
93
SLIB= libavcodec.so
94
endif
95
TESTS= imgresample-test dct-test motion-test
96

    
97
all: $(LIB) $(SLIB)
98

    
99
tests: apiexample cpuid_test $(TESTS)
100

    
101
$(LIB): $(OBJS)
102
	rm -f $@
103
	$(AR) rc $@ $(OBJS)
104
	$(RANLIB) $@
105

    
106
$(SLIB): $(OBJS)
107
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
108

    
109
dsputil.o: dsputil.c dsputil.h
110

    
111
%.o: %.c
112
	$(CC) $(CFLAGS) -c -o $@ $< 
113

    
114
%.o: %.S
115
	$(CC) $(CFLAGS) -c -o $@ $<
116

    
117
# motion_est_alpha uses the MVI extension, which is not available with
118
# -mcpu=ev4 (default) or ev5/ev56. Thus, force -mcpu=pca56 in those
119
# cases.
120
ifeq ($(TARGET_ARCH_ALPHA),yes)
121
alpha/motion_est_alpha.o: alpha/motion_est_alpha.c
122
	cpu=`echo "$(CFLAGS)" | sed -n 's,.*-mcpu=\([a-zA-Z0-9]*\).*,\1,p'`; \
123
	case x"$$cpu" in x|xev[45]*) newcpu=pca56;; *) newcpu=$$cpu;; esac; \
124
	echo $(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<;\
125
	$(CC) $(CFLAGS) -mcpu=$$newcpu -c -o $@ $<
126
endif
127

    
128
# depend only used by mplayer now
129
dep:	depend
130

    
131
depend:
132
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
133

    
134
clean: 
135
	rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
136
	   armv4l/*.o armv4l/*~ \
137
	   mlib/*.o mlib/*~ \
138
	   alpha/*.o alpha/*~ \
139
	   ppc/*.o ppc/*~ \
140
	   ps2/*.o ps2/*~ \
141
	   liba52/*.o liba52/*~ \
142
	   apiexample $(TESTS)
143

    
144
distclean: clean
145
	rm -f Makefile.bak .depend
146

    
147
# api example program
148
apiexample: apiexample.c $(LIB)
149
	$(CC) $(CFLAGS) -o $@ $< $(LIB) $(EXTRALIBS) -lm
150

    
151
# cpuid test
152
cpuid_test: i386/cputest.c
153
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
154

    
155
# testing progs
156

    
157
imgresample-test: imgresample.c
158
	$(CC) $(CFLAGS) -DTEST -o $@ $^ -lm
159

    
160
dct-test: dct-test.o jfdctfst.o jfdctint.o i386/fdct_mmx.o\
161
          fdctref.o jrevdct.o i386/idct_mmx.o simple_idct.o i386/simple_idct_mmx.o
162
	$(CC) -o $@ $^ -lm
163

    
164
motion-test: motion_test.o $(LIB)
165
	$(CC) -o $@ $^ -lm
166

    
167
install: all
168
ifeq ($(BUILD_SHARED),yes)
169
	install -d $(prefix)/lib
170
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
171
	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
172
	ldconfig || true
173
	mkdir -p $(prefix)/include/ffmpeg
174
	install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
175
	install -m 644 common.h $(prefix)/include/ffmpeg/common.h
176
endif
177

    
178
installlib: all
179
	install -m 644 $(LIB) $(prefix)/lib
180
	mkdir -p $(prefix)/include/ffmpeg
181
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
182
                $(prefix)/include/ffmpeg
183

    
184
#
185
# include dependency files if they exist
186
#
187
ifneq ($(wildcard .depend),)
188
include .depend
189
endif