libavutil: Utility code from libavcodec moved to a separate library.
[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)
25SLIB= $(SLIBPREF)avutil$(SLIBSUF)
26endif
27
28all: $(LIB) $(SLIB)
29
30$(LIB): $(OBJS)
31 rm -f $@
32 $(AR) rc $@ $(OBJS)
33 $(RANLIB) $@
34
35$(SLIB): $(OBJS)
36ifeq ($(CONFIG_WIN32),yes)
37 $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
38 -lib /machine:i386 /def:$(@:.dll=.def)
39else
40 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
41endif
42
43%.o: %.c
44 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
45
46depend: $(SRCS)
47 $(CC) -MM $(CFLAGS) $^ 1>.depend
48
49dep: depend
50
51clean:
52 rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so
53
54distclean: clean
55 rm -f Makefile.bak .depend
56
57
58ifeq ($(BUILD_SHARED),yes)
59install: all install-headers
60ifeq ($(CONFIG_WIN32),yes)
61 install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
62else
63 install -d $(libdir)
64 install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavutil-$(VERSION).so
65 ln -sf libavutil-$(VERSION).so $(libdir)/libavutil.so
66 $(LDCONFIG) || true
67endif
68else
69install:
70endif
71
72installlib: all install-headers
73 install -m 644 $(LIB) "$(libdir)"
74
75install-headers:
76 mkdir -p "$(prefix)/include/ffmpeg"
77 install -m 644 $(SRC_PATH)/libavutil/avutil.h \
78 $(SRC_PATH)/libavutil/common.h \
79 $(SRC_PATH)/libavutil/mathematics.h \
80 $(SRC_PATH)/libavutil/integer.h \
81 $(SRC_PATH)/libavutil/rational.h \
82 $(SRC_PATH)/libavutil/intfloat_readwrite.h \
83 "$(prefix)/include/ffmpeg"
84# install -d $(libdir)/pkgconfig
85# install -m 644 ../libavutil.pc $(libdir)/pkgconfig
86
87#
88# include dependency files if they exist
89#
90ifneq ($(wildcard .depend),)
91include .depend
92endif