Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 773cefc6

History | View | Annotate | Download (3.39 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
CFLAGS += -Wa,-mpca56
67
endif
68
69 ff4ec49e Fabrice Bellard
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
70
OBJS := $(OBJS) $(ASM_OBJS)
71 980fc7b8 Fabrice Bellard
72 de6d9b64 Fabrice Bellard
LIB= libavcodec.a
73 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
74 ff4ec49e Fabrice Bellard
SLIB= libavcodec.so
75 0fd94442 Nick Kurshev
endif
76 4300403e Fabrice Bellard
TESTS= imgresample-test dct-test motion-test
77 de6d9b64 Fabrice Bellard
78 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
79 ff4ec49e Fabrice Bellard
80 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
81 de6d9b64 Fabrice Bellard
82 ff4ec49e Fabrice Bellard
$(LIB): $(OBJS)
83 de6d9b64 Fabrice Bellard
	rm -f $@
84 ff4ec49e Fabrice Bellard
	$(AR) rc $@ $(OBJS)
85
86
$(SLIB): $(OBJS)
87
	$(CC) -shared -o $@ $(OBJS) $(EXTRALIBS)
88 de6d9b64 Fabrice Bellard
89
dsputil.o: dsputil.c dsputil.h
90
91
%.o: %.c
92
	$(CC) $(CFLAGS) -c -o $@ $< 
93
94 3d03c0a2 Fabrice Bellard
%.o: %.S
95
	$(CC) $(CFLAGS) -c -o $@ $<
96
97 980fc7b8 Fabrice Bellard
# depend only used by mplayer now
98
dep:	depend
99
100
depend:
101
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
102
103 de6d9b64 Fabrice Bellard
clean: 
104 1ac9248b Zdenek Kabelac
	rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
105 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
106 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
107 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
108 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
109
	   apiexample $(TESTS)
110 de6d9b64 Fabrice Bellard
111 800d7ceb Felix B√ľnemann
distclean: clean
112 980fc7b8 Fabrice Bellard
	rm -f Makefile.bak .depend
113
114 de6d9b64 Fabrice Bellard
# api example program
115
apiexample: apiexample.c $(LIB)
116
	$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
117
118 c10e9f70 Nick Kurshev
# cpuid test
119
cpuid_test: i386/cputest.c
120
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
121
122 de6d9b64 Fabrice Bellard
# testing progs
123
124
imgresample-test: imgresample.c
125
	$(CC) $(CFLAGS) -DTEST -o $@ $^ 
126
127 4300403e Fabrice Bellard
dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
128 de1ee36a Fabrice Bellard
          fdctref.o jrevdct.o i386/idct_mmx.o
129 de6d9b64 Fabrice Bellard
	$(CC) -o $@ $^
130 d771bcae Fabrice Bellard
131 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
132
	$(CC) -o $@ $^
133
134 0fd94442 Nick Kurshev
install: all
135
ifeq ($(BUILD_SHARED),yes)
136 ff4ec49e Fabrice Bellard
	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
137
	ln -sf $(prefix)/lib/libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
138 0fd94442 Nick Kurshev
	ldconfig
139 ff4ec49e Fabrice Bellard
	mkdir -p $(prefix)/include/ffmpeg
140
	install -m 644 avcodec.h $(prefix)/include/ffmpeg/avcodec.h
141
	install -m 644 common.h $(prefix)/include/ffmpeg/common.h
142 0fd94442 Nick Kurshev
endif
143 773cefc6 Fabrice Bellard
144
installlib: all
145
	install -m 644 $(LIB) $(prefix)/lib
146
	mkdir -p $(prefix)/include/ffmpeg
147
	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h $(SRC_PATH)/libavcodec/common.h \
148
                $(prefix)/include/ffmpeg
149
150 d771bcae Fabrice Bellard
#
151
# include dependency files if they exist
152
#
153
ifneq ($(wildcard .depend),)
154
include .depend
155
endif