Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / libdm / Makefile
blob8a0d57570d22786e1d8b30ae5d4edb350d0dd740
2 # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3 # Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
5 # This file is part of the device-mapper userspace tools.
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 Lesser General Public License v.2.1.
11 # You should have received a copy of the GNU Lesser 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
15 srcdir = .
16 top_srcdir = ..
17 top_builddir = ..
20 SOURCES =\
21 datastruct/bitset.c \
22 datastruct/hash.c \
23 datastruct/list.c \
24 libdm-common.c \
25 libdm-file.c \
26 libdm-deptree.c \
27 libdm-string.c \
28 libdm-report.c \
29 mm/dbg_malloc.c \
30 mm/pool.c \
31 regex/matcher.c \
32 regex/parse_rx.c \
33 regex/ttree.c \
34 $(interface)/libdm-iface.c
36 INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
38 ifeq ("no", "yes")
39 LIB_STATIC = $(interface)/libdevmapper.a
40 endif
42 ifeq ("","dylib")
43 LIB_SHARED = $(interface)/libdevmapper.dylib
44 else
45 LIB_SHARED = $(interface)/libdevmapper.so
46 endif
47 VERSIONED_SHLIB = libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM)
48 LIB_VERSION = $(LIB_VERSION_DM)
50 DEFS += -DDM_DEVICE_UID=0 -DDM_DEVICE_GID=0 \
51 -DDM_DEVICE_MODE=0600
53 include ../make.tmpl
55 device-mapper: all
57 .PHONY: install_dynamic install_static install_include \
58 install_ioctl install_ioctl_static \
59 install_pkgconfig
61 INSTALL_TYPE = install_dynamic
63 ifeq ("no", "yes")
64 INSTALL_TYPE += install_static
65 endif
67 ifeq ("no", "yes")
68 INSTALL_TYPE += install_pkgconfig
69 endif
71 install: $(INSTALL_TYPE) install_include
73 install_device-mapper: install
75 install_include:
76 $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $(srcdir)/libdevmapper.h \
77 $(includedir)/libdevmapper.h
79 install_dynamic: install_ioctl
80 $(LN_S) -f libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM) \
81 $(libdir)/libdevmapper.$(LIB_SUFFIX)
83 install_static: install_ioctl_static
84 $(LN_S) -f libdevmapper.a.$(LIB_VERSION_DM) $(libdir)/libdevmapper.a
86 install_ioctl: ioctl/libdevmapper.$(LIB_SUFFIX)
87 $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
88 $(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM)
90 install_pkgconfig:
91 $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper.pc \
92 $(usrlibdir)/pkgconfig/devmapper.pc
94 install_ioctl_static: ioctl/libdevmapper.a
95 $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
96 $(libdir)/libdevmapper.a.$(LIB_VERSION_DM)
98 $(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION_DM): $(interface)/%.$(LIB_SUFFIX)
99 rm -f $@
100 $(LN_S) $< $@
101 rm -f libdevmapper.$(LIB_SUFFIX)
102 $(LN_S) $< libdevmapper.$(LIB_SUFFIX)
104 CLEAN_TARGETS += libdevmapper.$(LIB_SUFFIX)
106 .PHONY: distclean_lib distclean
108 distclean_lib:
109 $(RM) libdevmapper.pc
111 distclean: distclean_lib