Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / lvm2 / dist / liblvm / Makefile
1 #
2 # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3 # Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
4 #
5 # This file is part of LVM2.
6 #
7 # This copyrighted material is made available to anyone wishing to use,
8 # modify, copy, or redistribute it subject to the terms and conditions
9 # of the GNU General Public License v.2.
10 #
11 # You should have received a copy of the GNU General Public License
12 # along with this program; if not, write to the Free Software Foundation,
13 # Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
14
15 srcdir = .
16 top_srcdir = ..
17 top_builddir = ..
18
19
20 SOURCES =\
21         lvm_base.c \
22         lvm_lv.c \
23         lvm_pv.c \
24         lvm_vg.c
25
26 LIB_NAME = liblvm2app
27 LIB_VERSION = $(LIB_VERSION_APP)
28 VERSIONED_SHLIB = $(LIB_NAME).$(LIB_SUFFIX).$(LIB_VERSION_APP)
29
30 ifeq ("no", "yes")
31   LIB_STATIC = $(LIB_NAME).a
32 endif
33
34 ifeq ("","dylib")
35   LIB_SHARED = $(LIB_NAME).dylib
36 else
37   LIB_SHARED = $(LIB_NAME).so
38 endif
39
40 CLEAN_TARGETS += liblvm.cflow
41
42 include ../make.tmpl
43
44 LIBS += -ldevmapper -llvm-internal
45
46 ifeq ("", "yes")
47   LIBS += -ldevmapper-event
48 endif
49
50 $(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION_APP): %.$(LIB_SUFFIX)
51         rm -f $@
52         $(LN_S) $< $@
53
54 .PHONY: install_dynamic install_static install_include install_pkgconfig \
55         distclean_lib distclean
56
57 INSTALL_TYPE = install_dynamic
58
59 ifeq ("no", "yes")
60   INSTALL_TYPE += install_static
61 endif
62
63 ifeq ("no", "yes")
64   INSTALL_TYPE += install_pkgconfig
65 endif
66
67 install: $(INSTALL_TYPE) install_include
68
69 install_include:
70         $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $(srcdir)/lvm2app.h $(includedir)/lvm2app.h
71
72 install_dynamic: $(LIB_SHARED)
73         $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
74                 $(libdir)/$(LIB_SHARED).$(LIB_VERSION_APP)
75         $(LN_S) -f $(LIB_SHARED).$(LIB_VERSION_APP) \
76                 $(libdir)/$(LIB_SHARED)
77
78 install_static: $(LIB_STATIC)
79         $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
80                 $(libdir)/$(LIB_STATIC).$(LIB_VERSION_APP)
81         $(LN_S) -f $(LIB_STATIC).$(LIB_VERSION_APP) $(libdir)/$(LIB_STATIC)
82
83 install_pkgconfig:
84         $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $(LIB_NAME).pc \
85                 $(usrlibdir)/pkgconfig/lvm2app.pc
86
87 liblvm.cflow: $(SOURCES)
88         set -e; (echo -n "SOURCES += "; \
89                  echo $(SOURCES) | \
90                  sed "s/^/ /;s/ / $(top_srcdir)\/liblvm\//g;s/$$//"; \
91                  ) > $@
92
93 cflow: liblvm.cflow
94
95 CLEAN_TARGETS += $(LIB_NAME).$(LIB_SUFFIX)
96
97 distclean_lib:
98         $(RM) $(LIB_NAME).pc
99
100 distclean: distclean_lib