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