Create symbolic links for all library sonames and clean up Makefiles.
[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)
f3b60109
DB
25LIBVERSION=$(LAVUVERSION)
26LIBMAJOR=$(LAVUMAJOR)
27NAME=avutil
4e159595 28SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
c11c2bc2
AS
29endif
30
4e159595 31all: $(LIB) $(SLIBNAME)
c11c2bc2
AS
32
33$(LIB): $(OBJS)
34 rm -f $@
35 $(AR) rc $@ $(OBJS)
36 $(RANLIB) $@
37
4e159595 38$(SLIBNAME): $(OBJS)
c11c2bc2
AS
39ifeq ($(CONFIG_WIN32),yes)
40 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
41 -lib /machine:i386 /def:$(@:.dll=.def)
42else
4e159595 43 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
c11c2bc2
AS
44endif
45
46%.o: %.c
115329f1 47 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
c11c2bc2
AS
48
49depend: $(SRCS)
50 $(CC) -MM $(CFLAGS) $^ 1>.depend
51
52dep: depend
53
54clean:
4e159595 55 rm -f *.o *.d *~ .depend $(LIB) $(SLIBNAME) *$(SLIBSUF)
c11c2bc2
AS
56
57distclean: clean
58 rm -f Makefile.bak .depend
59
60
61ifeq ($(BUILD_SHARED),yes)
62install: all install-headers
63ifeq ($(CONFIG_WIN32),yes)
4e159595 64 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
c11c2bc2
AS
65else
66 install -d $(libdir)
f3b60109
DB
67 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
68 $(libdir)/$(SLIBNAME_WITH_VERSION)
69 ln -sf $(SLIBNAME_WITH_VERSION) \
70 $(libdir)/$(SLIBNAME_WITH_MAJOR)
71 ln -sf $(SLIBNAME_WITH_VERSION) \
72 $(libdir)/$(SLIBNAME)
c11c2bc2
AS
73 $(LDCONFIG) || true
74endif
75else
76install:
77endif
78
79installlib: all install-headers
80 install -m 644 $(LIB) "$(libdir)"
81
82install-headers:
83 mkdir -p "$(prefix)/include/ffmpeg"
84 install -m 644 $(SRC_PATH)/libavutil/avutil.h \
85 $(SRC_PATH)/libavutil/common.h \
86 $(SRC_PATH)/libavutil/mathematics.h \
87 $(SRC_PATH)/libavutil/integer.h \
88 $(SRC_PATH)/libavutil/rational.h \
89 $(SRC_PATH)/libavutil/intfloat_readwrite.h \
90 "$(prefix)/include/ffmpeg"
25f8db58
FO
91 install -d "$(libdir)/pkgconfig"
92 install -m 644 ../libavutil.pc "$(libdir)/pkgconfig"
c11c2bc2
AS
93
94#
95# include dependency files if they exist
96#
97ifneq ($(wildcard .depend),)
98include .depend
99endif