libavutil: Utility code from libavcodec moved to a separate library.
[platform/upstream/libav.git] / libavutil / Makefile
1 #
2 # libavutil Makefile
3 #
4 include ../config.mak
5
6 VPATH=$(SRC_PATH)/libavutil
7
8 # NOTE: -I.. is needed to include config.h
9 CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
10
11 OBJS= mathematics.o \
12       integer.o \
13       rational.o \
14       intfloat_readwrite.o \
15
16
17 ifeq ($(TARGET_ARCH_SPARC64),yes)
18 CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
19 endif
20
21 SRCS := $(OBJS:.o=.c)
22
23 LIB= $(LIBPREF)avutil$(LIBSUF)
24 ifeq ($(BUILD_SHARED),yes)
25 SLIB= $(SLIBPREF)avutil$(SLIBSUF)
26 endif
27
28 all: $(LIB) $(SLIB)
29
30 $(LIB): $(OBJS)
31         rm -f $@
32         $(AR) rc $@ $(OBJS)
33         $(RANLIB) $@
34
35 $(SLIB): $(OBJS)
36 ifeq ($(CONFIG_WIN32),yes)
37         $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
38         -lib /machine:i386 /def:$(@:.dll=.def)
39 else
40         $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
41 endif
42
43 %.o: %.c
44         $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< 
45
46 depend: $(SRCS)
47         $(CC) -MM $(CFLAGS) $^ 1>.depend
48
49 dep:    depend
50
51 clean:
52         rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so
53
54 distclean: clean
55         rm -f Makefile.bak .depend
56
57
58 ifeq ($(BUILD_SHARED),yes)
59 install: all install-headers
60 ifeq ($(CONFIG_WIN32),yes)
61         install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
62 else
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
67 endif
68 else
69 install:
70 endif
71
72 installlib: all install-headers
73         install -m 644 $(LIB) "$(libdir)"
74
75 install-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 #
90 ifneq ($(wildcard .depend),)
91 include .depend
92 endif