Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 57514323

History | View | Annotate | Download (3.04 KB)

1 980fc7b8 Fabrice Bellard
include ../config.mak
2
3 2b0c1a44 Fabrice Bellard
CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H
4 de6d9b64 Fabrice Bellard
LDFLAGS= -g
5
6
OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
7 10b7b472 Fabrice Bellard
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
8 de6d9b64 Fabrice Bellard
      motion_est.o imgconvert.o imgresample.o msmpeg4.o \
9 8b4c7dbc Michael Niedermayer
      mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
10
      ratecontrol.o
11 980fc7b8 Fabrice Bellard
ASM_OBJS=
12 de6d9b64 Fabrice Bellard
13 57514323 Zdenek Kabelac
# currently using liba52 for ac3 decoding
14 d771bcae Fabrice Bellard
ifeq ($(CONFIG_AC3),yes)
15 57514323 Zdenek Kabelac
OBJS+= a52dec.o
16
endif
17
18
# using builtin liba52 or runtime linked liba52.so.0
19
ifeq ($(CONFIG_A52BIN),no)
20
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
21
	liba52/imdct.o  liba52/parse.o
22 d771bcae Fabrice Bellard
endif
23 de6d9b64 Fabrice Bellard
24 5798368b Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
25
OBJS += mp3lameaudio.o
26
endif
27
28 43f1708f Juanjo
ifeq ($(TARGET_GPROF),yes)
29
CFLAGS+=-p
30
LDFLAGS+=-p
31
endif
32
33 de6d9b64 Fabrice Bellard
# i386 mmx specific stuff
34 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_MMX),yes)
35 4300403e Fabrice Bellard
OBJS += i386/fdct_mmx.o i386/cputest.o \
36 de1ee36a Fabrice Bellard
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
37 57514323 Zdenek Kabelac
	i386/idct_mmx.o i386/motion_est_mmx.o \
38 d962f6fd Arpi
	i386/simple_idct_mmx.o
39 de6d9b64 Fabrice Bellard
endif
40
41 3d03c0a2 Fabrice Bellard
# armv4l specific stuff
42
ifeq ($(TARGET_ARCH_ARMV4L),yes)
43
ASM_OBJS += armv4l/jrevdct_arm.o
44
OBJS += armv4l/dsputil_arm.o
45
endif
46
47 c34270f5 Fabrice Bellard
# sun mediaLib specific stuff
48
# currently only works when libavcodec is used in mplayer
49
ifeq ($(HAVE_MLIB),yes)
50
OBJS += mlib/dsputil_mlib.o
51
CFLAGS += $(MLIB_INC)
52
endif
53
54 1e98dffb Nick Kurshev
# alpha specific stuff
55
ifeq ($(TARGET_ARCH_ALPHA),yes)
56
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
57
CFLAGS += -Wa,-mpca56
58
endif
59
60 980fc7b8 Fabrice Bellard
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
61
62 de6d9b64 Fabrice Bellard
LIB= libavcodec.a
63 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
64
SLIB= libffmpeg-$(VERSION).so
65
endif
66 4300403e Fabrice Bellard
TESTS= imgresample-test dct-test motion-test
67 de6d9b64 Fabrice Bellard
68 0fd94442 Nick Kurshev
all: $(LIB) $(SLIB)
69 c10e9f70 Nick Kurshev
tests: apiexample cpuid_test $(TESTS)
70 de6d9b64 Fabrice Bellard
71 980fc7b8 Fabrice Bellard
$(LIB): $(OBJS) $(ASM_OBJS)
72 de6d9b64 Fabrice Bellard
	rm -f $@
73 980fc7b8 Fabrice Bellard
	$(AR) rcs $@ $(OBJS) $(ASM_OBJS)
74 de6d9b64 Fabrice Bellard
75 0fd94442 Nick Kurshev
$(SLIB): $(OBJS) $(ASM_OBJS)
76
	rm -f $@
77
	$(CC) -shared -o $@ $(OBJS) $(ASM_OBJS)
78
	ln -sf $@ libffmpeg.so
79 de6d9b64 Fabrice Bellard
dsputil.o: dsputil.c dsputil.h
80
81
%.o: %.c
82
	$(CC) $(CFLAGS) -c -o $@ $< 
83
84 3d03c0a2 Fabrice Bellard
%.o: %.S
85
	$(CC) $(CFLAGS) -c -o $@ $<
86
87 980fc7b8 Fabrice Bellard
# depend only used by mplayer now
88
dep:	depend
89
90
depend:
91
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
92
93 de6d9b64 Fabrice Bellard
clean: 
94 0fd94442 Nick Kurshev
	rm -f *.o *~ $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
95 3d03c0a2 Fabrice Bellard
	   armv4l/*.o armv4l/*~ \
96 c34270f5 Fabrice Bellard
	   mlib/*.o mlib/*~ \
97 1e98dffb Nick Kurshev
	   alpha/*.o alpha/*~ \
98 57514323 Zdenek Kabelac
	   liba52/*.o liba52/*~ \
99
	   apiexample $(TESTS)
100 de6d9b64 Fabrice Bellard
101 980fc7b8 Fabrice Bellard
distclean: clean
102
	rm -f Makefile.bak .depend
103
104 de6d9b64 Fabrice Bellard
# api example program
105
apiexample: apiexample.c $(LIB)
106
	$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
107
108 c10e9f70 Nick Kurshev
# cpuid test
109
cpuid_test: i386/cputest.c
110
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
111
112 de6d9b64 Fabrice Bellard
# testing progs
113
114
imgresample-test: imgresample.c
115
	$(CC) $(CFLAGS) -DTEST -o $@ $^ 
116
117 4300403e Fabrice Bellard
dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
118 de1ee36a Fabrice Bellard
          fdctref.o jrevdct.o i386/idct_mmx.o
119 de6d9b64 Fabrice Bellard
	$(CC) -o $@ $^
120 d771bcae Fabrice Bellard
121 4300403e Fabrice Bellard
motion-test: motion_test.o $(LIB)
122
	$(CC) -o $@ $^
123
124 0fd94442 Nick Kurshev
install: all
125 f840692f Nick Kurshev
#	install -m 644 $(LIB) $(prefix)/lib
126 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
127
	install -s -m 755 $(SLIB) $(prefix)/lib
128
	ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
129
	ldconfig
130 f840692f Nick Kurshev
	mkdir -p $(prefix)/include/libffmpeg
131
	install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
132 18c599db Nick Kurshev
	install -m 644 common.h $(prefix)/include/libffmpeg/common.h
133 0fd94442 Nick Kurshev
endif
134 d771bcae Fabrice Bellard
#
135
# include dependency files if they exist
136
#
137
ifneq ($(wildcard .depend),)
138
include .depend
139
endif