Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ bb7d4939

History | View | Annotate | Download (3.43 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
CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I..
11 de6d9b64 Fabrice Bellard
LDFLAGS= -g
12
13 773cefc6 Fabrice Bellard
OBJS= common.o utils.o mem.o allcodecs.o \
14
      mpegvideo.o h263.o jrevdct.o jfdctfst.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 8b4c7dbc Michael Niedermayer
      mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
18
      ratecontrol.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 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
38
CFLAGS+=-p
39
LDFLAGS+=-p
40
endif
41
42 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
43 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
44 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
45 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
46 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
47 d962f6fd Arpi
	i386/simple_idct_mmx.o
48 de6d9b64 Fabrice Bellard
endif
49
50 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
51
ifeq ($(TARGET_ARCH_ARMV4L),yes)
52
ASM_OBJS += armv4l/jrevdct_arm.o
53
OBJS += armv4l/dsputil_arm.o
54
endif
55
56 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
57
# currently only works when libavcodec is used in mplayer
58
ifeq ($(HAVE_MLIB),yes)
59
OBJS += mlib/dsputil_mlib.o
60
CFLAGS += $(MLIB_INC)
61
endif
62
63 1e98dffb Nick Kurshev
# alpha specific stuff
64
ifeq ($(TARGET_ARCH_ALPHA),yes)
65
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
66 bb7d4939 Falk Hüffner
ASM_OBJS += alpha/dsputil_alpha_asm.o
67 1e98dffb Nick Kurshev
CFLAGS += -Wa,-mpca56
68
endif
69
70 bb7d4939 Falk Hüffner
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
71 ff4ec49e Fabrice Bellard
OBJS := $(OBJS) $(ASM_OBJS)
72 980fc7b8 Fabrice Bellard
73 de6d9b64 Fabrice Bellard
LIB= libavcodec.a
74 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
75 ff4ec49e Fabrice Bellard
SLIB= libavcodec.so
76 0fd94442 Nick Kurshev
endif
77 4300403e Fabrice Bellard
TESTS= imgresample-test dct-test motion-test
78 de6d9b64 Fabrice Bellard
79 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
80 ff4ec49e Fabrice Bellard
81 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
82 de6d9b64 Fabrice Bellard
83 ff4ec49e Fabrice Bellard
$(LIB): $(OBJS)
84 de6d9b64 Fabrice Bellard
	rm -f $@
85 ff4ec49e Fabrice Bellard
	$(AR) rc $@ $(OBJS)
86
87
$(SLIB): $(OBJS)
88
	$(CC) -shared -o $@ $(OBJS) $(EXTRALIBS)
89 de6d9b64 Fabrice Bellard
90
dsputil.o: dsputil.c dsputil.h
91
92
%.o: %.c
93
	$(CC) $(CFLAGS) -c -o $@ $< 
94
95 3d03c0a2 Fabrice Bellard
%.o: %.S
96
	$(CC) $(CFLAGS) -c -o $@ $<
97
98 980fc7b8 Fabrice Bellard
# depend only used by mplayer now
99
dep:	depend
100
101
depend:
102
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
103
104 de6d9b64 Fabrice Bellard
clean: 
105 1ac9248b Zdenek Kabelac
	rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
106 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
107 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
108 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
109 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
110
	   apiexample $(TESTS)
111 de6d9b64 Fabrice Bellard
112 800d7ceb Felix Bünemann
distclean: clean
113 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
114
115 de6d9b64 Fabrice Bellard
# api example program
116
apiexample: apiexample.c $(LIB)
117
	$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
118
119 c10e9f70 Nick Kurshev
# cpuid test
120
cpuid_test: i386/cputest.c
121
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
122
123 de6d9b64 Fabrice Bellard
# testing progs
124
125
imgresample-test: imgresample.c
126
	$(CC) $(CFLAGS) -DTEST -o $@ $^ 
127
128 4300403e Fabrice Bellard
dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
129 de1ee36a Fabrice Bellard
          fdctref.o jrevdct.o i386/idct_mmx.o
130 de6d9b64 Fabrice Bellard
	$(CC) -o $@ $^
131 d771bcae Fabrice Bellard
132 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
133
	$(CC) -o $@ $^
134
135 0fd94442 Nick Kurshev
install: all
136
ifeq ($(BUILD_SHARED),yes)
137 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
138
	ln -sf $(prefix)/lib/libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
139 0fd94442 Nick Kurshev
	ldconfig
140 ff4ec49e Fabrice Bellard
	mkdir -p $(prefix)/include/ffmpeg
141
	install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
142
	install -m 644 common.h $(prefix)/include/ffmpeg/common.h
143 0fd94442 Nick Kurshev
endif
144 773cefc6 Fabrice Bellard
145
installlib: all
146
	install -m 644 $(LIB) $(prefix)/lib
147
	mkdir -p $(prefix)/include/ffmpeg
148
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
149
                $(prefix)/include/ffmpeg
150
151 d771bcae Fabrice Bellard
#
152
# include dependency files if they exist
153
#
154
ifneq ($(wildcard .depend),)
155
include .depend
156
endif