Statistics
| Branch: | Revision:

ffmpeg / libavcodec / Makefile @ 5798368b

History | View | Annotate | Download (2.96 KB)

1
include ../config.mak
2

    
3
CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H
4
LDFLAGS= -g
5

    
6
OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
7
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
8
      motion_est.o imgconvert.o imgresample.o msmpeg4.o \
9
      mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o
10
ASM_OBJS=
11

    
12
# currently using libac3 for ac3 decoding
13
ifeq ($(CONFIG_AC3),yes)
14
OBJS+= ac3dec.o \
15
       libac3/bit_allocate.o libac3/bitstream.o libac3/downmix.o \
16
       libac3/imdct.o  libac3/parse.o
17
endif
18

    
19
ifeq ($(CONFIG_MP3LAME),yes)
20
OBJS += mp3lameaudio.o
21
endif
22

    
23
ifeq ($(TARGET_GPROF),yes)
24
CFLAGS+=-p
25
LDFLAGS+=-p
26
endif
27

    
28
# i386 mmx specific stuff
29
ifeq ($(TARGET_MMX),yes)
30
OBJS += i386/fdct_mmx.o i386/cputest.o \
31
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
32
        i386/idct_mmx.o i386/motion_est_mmx.o \
33
	i386/simple_idct_mmx.o
34
endif
35

    
36
# armv4l specific stuff
37
ifeq ($(TARGET_ARCH_ARMV4L),yes)
38
ASM_OBJS += armv4l/jrevdct_arm.o
39
OBJS += armv4l/dsputil_arm.o
40
endif
41

    
42
# sun mediaLib specific stuff
43
# currently only works when libavcodec is used in mplayer
44
ifeq ($(HAVE_MLIB),yes)
45
OBJS += mlib/dsputil_mlib.o
46
CFLAGS += $(MLIB_INC)
47
endif
48

    
49
# alpha specific stuff
50
ifeq ($(TARGET_ARCH_ALPHA),yes)
51
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
52
CFLAGS += -Wa,-mpca56
53
endif
54

    
55
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
56

    
57
LIB= libavcodec.a
58
ifeq ($(BUILD_SHARED),yes)
59
SLIB= libffmpeg-$(VERSION).so
60
endif
61
TESTS= imgresample-test dct-test motion-test
62

    
63
all: $(LIB) $(SLIB)
64
tests: apiexample cpuid_test $(TESTS)
65

    
66
$(LIB): $(OBJS) $(ASM_OBJS)
67
	rm -f $@
68
	$(AR) rcs $@ $(OBJS) $(ASM_OBJS)
69

    
70
$(SLIB): $(OBJS) $(ASM_OBJS)
71
	rm -f $@
72
	$(CC) -shared -o $@ $(OBJS) $(ASM_OBJS)
73
	ln -sf $@ libffmpeg.so
74
dsputil.o: dsputil.c dsputil.h
75

    
76
%.o: %.c
77
	$(CC) $(CFLAGS) -c -o $@ $< 
78

    
79
%.o: %.S
80
	$(CC) $(CFLAGS) -c -o $@ $<
81

    
82
# depend only used by mplayer now
83
dep:	depend
84

    
85
depend:
86
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
87

    
88
clean: 
89
	rm -f *.o *~ $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
90
	   armv4l/*.o armv4l/*~ \
91
	   mlib/*.o mlib/*~ \
92
	   alpha/*.o alpha/*~ \
93
           libac3/*.o libac3/*~ \
94
           apiexample $(TESTS)
95

    
96
distclean: clean
97
	rm -f Makefile.bak .depend
98

    
99
# api example program
100
apiexample: apiexample.c $(LIB)
101
	$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
102

    
103
# cpuid test
104
cpuid_test: i386/cputest.c
105
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<
106

    
107
# testing progs
108

    
109
imgresample-test: imgresample.c
110
	$(CC) $(CFLAGS) -DTEST -o $@ $^ 
111

    
112
dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
113
          fdctref.o jrevdct.o i386/idct_mmx.o
114
	$(CC) -o $@ $^
115

    
116
motion-test: motion_test.o $(LIB)
117
	$(CC) -o $@ $^
118

    
119
install: all
120
#	install -m 644 $(LIB) $(prefix)/lib
121
ifeq ($(BUILD_SHARED),yes)
122
	install -s -m 755 $(SLIB) $(prefix)/lib
123
	ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
124
	ldconfig
125
	mkdir -p $(prefix)/include/libffmpeg
126
	install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
127
	install -m 644 common.h $(prefix)/include/libffmpeg/common.h
128
endif
129
#
130
# include dependency files if they exist
131
#
132
ifneq ($(wildcard .depend),)
133
include .depend
134
endif