split snow53 test out
[libav.git] / libavutil / Makefile
CommitLineData
c11c2bc2
AS
1#
2# libavutil Makefile
3#
4include ../config.mak
5
6VPATH=$(SRC_PATH)/libavutil
7
8# NOTE: -I.. is needed to include config.h
9CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
10
11OBJS= mathematics.o \
12 integer.o \
13 rational.o \
14 intfloat_readwrite.o \
15
16
17ifeq ($(TARGET_ARCH_SPARC64),yes)
18CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
19endif
20
21SRCS := $(OBJS:.o=.c)
22
23LIB= $(LIBPREF)avutil$(LIBSUF)
24ifeq ($(BUILD_SHARED),yes)
5a872801 25LIBVERSION=$(LAVUMAJOR)
4e159595 26SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
c11c2bc2
AS
27endif
28
4e159595 29all: $(LIB) $(SLIBNAME)
c11c2bc2
AS
30
31$(LIB): $(OBJS)
32 rm -f $@
33 $(AR) rc $@ $(OBJS)
34 $(RANLIB) $@
35
4e159595 36$(SLIBNAME): $(OBJS)
c11c2bc2
AS
37ifeq ($(CONFIG_WIN32),yes)
38 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
39 -lib /machine:i386 /def:$(@:.dll=.def)
40else
4e159595 41 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
c11c2bc2
AS
42endif
43
44%.o: %.c
115329f1 45 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
c11c2bc2
AS
46
47depend: $(SRCS)
48 $(CC) -MM $(CFLAGS) $^ 1>.depend
49
50dep: depend
51
52clean:
4e159595 53 rm -f *.o *.d *~ .depend $(LIB) $(SLIBNAME) *$(SLIBSUF)
c11c2bc2
AS
54
55distclean: clean
56 rm -f Makefile.bak .depend
57
58
59ifeq ($(BUILD_SHARED),yes)
60install: all install-headers
61ifeq ($(CONFIG_WIN32),yes)
4e159595 62 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
c11c2bc2
AS
63else
64 install -d $(libdir)
4e159595
DB
65 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/libavutil-$(VERSION)$(SLIBSUF)
66 ln -sf libavutil-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
c11c2bc2
AS
67 $(LDCONFIG) || true
68endif
69else
70install:
71endif
72
73installlib: all install-headers
74 install -m 644 $(LIB) "$(libdir)"
75
76install-headers:
77 mkdir -p "$(prefix)/include/ffmpeg"
78 install -m 644 $(SRC_PATH)/libavutil/avutil.h \
79 $(SRC_PATH)/libavutil/common.h \
80 $(SRC_PATH)/libavutil/mathematics.h \
81 $(SRC_PATH)/libavutil/integer.h \
82 $(SRC_PATH)/libavutil/rational.h \
83 $(SRC_PATH)/libavutil/intfloat_readwrite.h \
84 "$(prefix)/include/ffmpeg"
25f8db58
FO
85 install -d "$(libdir)/pkgconfig"
86 install -m 644 ../libavutil.pc "$(libdir)/pkgconfig"
c11c2bc2
AS
87
88#
89# include dependency files if they exist
90#
91ifneq ($(wildcard .depend),)
92include .depend
93endif