Makefile 3.1 KB
Newer Older
1 2
include ../config.mak

Z
Zdenek Kabelac 已提交
3
CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I. -I..
F
Fabrice Bellard 已提交
4 5 6
LDFLAGS= -g

OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
7
      mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
F
Fabrice Bellard 已提交
8
      motion_est.o imgconvert.o imgresample.o msmpeg4.o \
9 10
      mpeg12.o h263dec.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
      ratecontrol.o
11
ASM_OBJS=
F
Fabrice Bellard 已提交
12

Z
Zdenek Kabelac 已提交
13
# currently using liba52 for ac3 decoding
14
ifeq ($(CONFIG_AC3),yes)
Z
Zdenek Kabelac 已提交
15 16 17 18 19 20 21
OBJS+= a52dec.o
endif

# using builtin liba52 or runtime linked liba52.so.0
ifeq ($(CONFIG_A52BIN),no)
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
	liba52/imdct.o  liba52/parse.o
22
endif
F
Fabrice Bellard 已提交
23

24 25
ifeq ($(CONFIG_MP3LAME),yes)
OBJS += mp3lameaudio.o
Z
Zdenek Kabelac 已提交
26
EXTRALIBS += -lmp3lame
27 28
endif

29 30 31 32 33
ifeq ($(TARGET_GPROF),yes)
CFLAGS+=-p
LDFLAGS+=-p
endif

F
Fabrice Bellard 已提交
34
# i386 mmx specific stuff
35
ifeq ($(TARGET_MMX),yes)
F
Fabrice Bellard 已提交
36
OBJS += i386/fdct_mmx.o i386/cputest.o \
F
Fabrice Bellard 已提交
37
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
Z
Zdenek Kabelac 已提交
38
	i386/idct_mmx.o i386/motion_est_mmx.o \
39
	i386/simple_idct_mmx.o
F
Fabrice Bellard 已提交
40 41
endif

F
Fabrice Bellard 已提交
42 43 44 45 46 47
# armv4l specific stuff
ifeq ($(TARGET_ARCH_ARMV4L),yes)
ASM_OBJS += armv4l/jrevdct_arm.o
OBJS += armv4l/dsputil_arm.o
endif

F
Fabrice Bellard 已提交
48 49 50 51 52 53 54
# sun mediaLib specific stuff
# currently only works when libavcodec is used in mplayer
ifeq ($(HAVE_MLIB),yes)
OBJS += mlib/dsputil_mlib.o
CFLAGS += $(MLIB_INC)
endif

55 56 57 58 59 60
# alpha specific stuff
ifeq ($(TARGET_ARCH_ALPHA),yes)
OBJS += alpha/dsputil_alpha.o alpha/mpegvideo_alpha.o
CFLAGS += -Wa,-mpca56
endif

61 62
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)

F
Fabrice Bellard 已提交
63
LIB= libavcodec.a
N
Nick Kurshev 已提交
64 65 66
ifeq ($(BUILD_SHARED),yes)
SLIB= libffmpeg-$(VERSION).so
endif
F
Fabrice Bellard 已提交
67
TESTS= imgresample-test dct-test motion-test
F
Fabrice Bellard 已提交
68

N
Nick Kurshev 已提交
69
all: $(LIB) $(SLIB)
N
Nick Kurshev 已提交
70
tests: apiexample cpuid_test $(TESTS)
F
Fabrice Bellard 已提交
71

72
$(LIB): $(OBJS) $(ASM_OBJS)
F
Fabrice Bellard 已提交
73
	rm -f $@
74
	$(AR) rc $@ $(OBJS) $(ASM_OBJS)
F
Fabrice Bellard 已提交
75

N
Nick Kurshev 已提交
76 77
$(SLIB): $(OBJS) $(ASM_OBJS)
	rm -f $@
Z
Zdenek Kabelac 已提交
78
	$(CC) -shared -o $@ $(OBJS) $(ASM_OBJS) $(EXTRALIBS)
N
Nick Kurshev 已提交
79
	ln -sf $@ libffmpeg.so
F
Fabrice Bellard 已提交
80 81 82 83 84
dsputil.o: dsputil.c dsputil.h

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

F
Fabrice Bellard 已提交
85 86 87
%.o: %.S
	$(CC) $(CFLAGS) -c -o $@ $<

88 89 90 91 92 93
# depend only used by mplayer now
dep:	depend

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

F
Fabrice Bellard 已提交
94
clean: 
Z
Zdenek Kabelac 已提交
95
	rm -f *.o *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
F
Fabrice Bellard 已提交
96
	   armv4l/*.o armv4l/*~ \
F
Fabrice Bellard 已提交
97
	   mlib/*.o mlib/*~ \
98
	   alpha/*.o alpha/*~ \
Z
Zdenek Kabelac 已提交
99 100
	   liba52/*.o liba52/*~ \
	   apiexample $(TESTS)
F
Fabrice Bellard 已提交
101

102 103 104
distclean: clean
	rm -f Makefile.bak .depend

F
Fabrice Bellard 已提交
105 106 107 108
# api example program
apiexample: apiexample.c $(LIB)
	$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm

N
Nick Kurshev 已提交
109 110 111 112
# cpuid test
cpuid_test: i386/cputest.c
	$(CC) $(CFLAGS) -D__TEST__ -o $@ $<

F
Fabrice Bellard 已提交
113 114 115 116 117
# testing progs

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

F
Fabrice Bellard 已提交
118
dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o \
F
Fabrice Bellard 已提交
119
          fdctref.o jrevdct.o i386/idct_mmx.o
F
Fabrice Bellard 已提交
120
	$(CC) -o $@ $^
121

F
Fabrice Bellard 已提交
122 123 124
motion-test: motion_test.o $(LIB)
	$(CC) -o $@ $^

N
Nick Kurshev 已提交
125
install: all
N
Nick Kurshev 已提交
126
#	install -m 644 $(LIB) $(prefix)/lib
N
Nick Kurshev 已提交
127 128 129 130
ifeq ($(BUILD_SHARED),yes)
	install -s -m 755 $(SLIB) $(prefix)/lib
	ln -sf $(prefix)/lib/$(SLIB) $(prefix)/lib/libffmpeg.so
	ldconfig
N
Nick Kurshev 已提交
131 132
	mkdir -p $(prefix)/include/libffmpeg
	install -m 644 avcodec.h $(prefix)/include/libffmpeg/avcodec.h
N
Nick Kurshev 已提交
133
	install -m 644 common.h $(prefix)/include/libffmpeg/common.h
N
Nick Kurshev 已提交
134
endif
135 136 137 138 139 140
#
# include dependency files if they exist
#
ifneq ($(wildcard .depend),)
include .depend
endif