Update for new style guidelines regarding TABs and trailing whitespace.
[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
c0af3840
DB
11#FIXME: This should be in configure/config.mak
12ifeq ($(CONFIG_WIN32),yes)
13 LDFLAGS=-Wl,--output-def,$(@:.dll=.def)
14endif
15
c11c2bc2
AS
16OBJS= mathematics.o \
17 integer.o \
18 rational.o \
19 intfloat_readwrite.o \
20
21
22ifeq ($(TARGET_ARCH_SPARC64),yes)
23CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
24endif
25
26SRCS := $(OBJS:.o=.c)
27
4bdd05e7 28NAME=avutil
c11c2bc2 29ifeq ($(BUILD_SHARED),yes)
f3b60109
DB
30LIBVERSION=$(LAVUVERSION)
31LIBMAJOR=$(LAVUMAJOR)
c11c2bc2
AS
32endif
33
4e159595 34all: $(LIB) $(SLIBNAME)
c11c2bc2
AS
35
36$(LIB): $(OBJS)
37 rm -f $@
38 $(AR) rc $@ $(OBJS)
39 $(RANLIB) $@
40
4e159595 41$(SLIBNAME): $(OBJS)
c0af3840 42 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
c11c2bc2 43ifeq ($(CONFIG_WIN32),yes)
c11c2bc2 44 -lib /machine:i386 /def:$(@:.dll=.def)
c11c2bc2
AS
45endif
46
47%.o: %.c
115329f1 48 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
c11c2bc2
AS
49
50depend: $(SRCS)
51 $(CC) -MM $(CFLAGS) $^ 1>.depend
52
53dep: depend
54
55clean:
29a10be0 56 rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
c11c2bc2
AS
57
58distclean: clean
04c07634 59 rm -f .depend
c11c2bc2
AS
60
61
62ifeq ($(BUILD_SHARED),yes)
63install: all install-headers
64ifeq ($(CONFIG_WIN32),yes)
4e159595 65 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
c11c2bc2
AS
66else
67 install -d $(libdir)
f3b60109
DB
68 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
69 $(libdir)/$(SLIBNAME_WITH_VERSION)
70 ln -sf $(SLIBNAME_WITH_VERSION) \
71 $(libdir)/$(SLIBNAME_WITH_MAJOR)
72 ln -sf $(SLIBNAME_WITH_VERSION) \
73 $(libdir)/$(SLIBNAME)
c11c2bc2
AS
74 $(LDCONFIG) || true
75endif
76else
77install:
78endif
79
80installlib: all install-headers
81 install -m 644 $(LIB) "$(libdir)"
82
83install-headers:
84 mkdir -p "$(prefix)/include/ffmpeg"
85 install -m 644 $(SRC_PATH)/libavutil/avutil.h \
86 $(SRC_PATH)/libavutil/common.h \
87 $(SRC_PATH)/libavutil/mathematics.h \
88 $(SRC_PATH)/libavutil/integer.h \
89 $(SRC_PATH)/libavutil/rational.h \
90 $(SRC_PATH)/libavutil/intfloat_readwrite.h \
91 "$(prefix)/include/ffmpeg"
25f8db58
FO
92 install -d "$(libdir)/pkgconfig"
93 install -m 644 ../libavutil.pc "$(libdir)/pkgconfig"
c11c2bc2
AS
94
95#
96# include dependency files if they exist
97#
98ifneq ($(wildcard .depend),)
99include .depend
100endif