Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / tools / Makefile.in
blobfc5faad6aa16aa3581a628f01982ea85781794c4
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 LVM2.
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.
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
15 srcdir = @srcdir@
16 top_srcdir = @top_srcdir@
17 top_builddir = @top_builddir@
18 VPATH = @srcdir@
20 LIB_PTHREAD = @LIB_PTHREAD@
22 SOURCES =\
23 dumpconfig.c \
24 formats.c \
25 lvchange.c \
26 lvconvert.c \
27 lvcreate.c \
28 lvdisplay.c \
29 lvextend.c \
30 lvmchange.c \
31 lvmcmdline.c \
32 lvmdiskscan.c \
33 lvreduce.c \
34 lvremove.c \
35 lvrename.c \
36 lvresize.c \
37 lvscan.c \
38 polldaemon.c \
39 pvchange.c \
40 pvck.c \
41 pvcreate.c \
42 pvdisplay.c \
43 pvmove.c \
44 pvremove.c \
45 pvresize.c \
46 pvscan.c \
47 reporter.c \
48 segtypes.c \
49 toollib.c \
50 vgcfgbackup.c \
51 vgcfgrestore.c \
52 vgchange.c \
53 vgck.c \
54 vgcreate.c \
55 vgconvert.c \
56 vgdisplay.c \
57 vgexport.c \
58 vgextend.c \
59 vgimport.c \
60 vgmerge.c \
61 vgmknodes.c \
62 vgreduce.c \
63 vgremove.c \
64 vgrename.c \
65 vgscan.c \
66 vgsplit.c
68 SOURCES2 =\
69 dmsetup.c
71 TARGETS =\
72 .commands \
73 lvm
75 TARGETS_DM = dmsetup
77 INSTALL_LVM_TARGETS = install_tools_dynamic
78 INSTALL_DMSETUP_TARGETS = install_dmsetup_dynamic
79 INSTALL_CMDLIB_TARGETS = install_cmdlib_dynamic
81 ifeq ("@STATIC_LINK@", "yes")
82 TARGETS += lvm.static
83 TARGETS_DM += dmsetup.static
84 INSTALL_LVM_TARGETS += install_tools_static
85 INSTALL_DMSETUP_TARGETS += install_dmsetup_static
86 INSTALL_CMDLIB_TARGETS += install_cmdlib_static
87 endif
89 LVMLIBS = -llvm-internal
90 LIB_VERSION = $(LIB_VERSION_LVM)
92 CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) liblvm2cmd.a liblvm2cmd-static.a lvm lvm.o \
93 lvm2cmd.o lvm2cmd-static.o lvm2cmdlib.o lvm.static \
94 lvm.cflow lvm.xref lvm.tree lvm.rxref lvm.rtree \
95 lvmcmdlib.o lvm-static.o dmsetup.o $(TARGETS_DM)
97 ifeq ("@CMDLIB@", "yes")
98 TARGETS += liblvm2cmd.$(LIB_SUFFIX)
99 INSTALL_LVM_TARGETS += $(INSTALL_CMDLIB_TARGETS)
100 endif
102 ifeq ("@DMEVENTD@", "yes")
103 LVMLIBS += -ldevmapper-event -lpthread
104 endif
106 LVMLIBS += -ldevmapper
108 DEFS += -DLVM_SHARED_PATH=\"$(exec_prefix)/sbin/lvm\"
110 include ../make.tmpl
112 device-mapper: $(TARGETS_DM)
114 dmsetup: dmsetup.o $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX)
115 $(CC) $(CFLAGS) $(LDFLAGS) -L$(top_builddir)/libdm \
116 -o $@ dmsetup.o -ldevmapper $(LIBS) $(LIB_PTHREAD)
118 dmsetup.static: dmsetup.o $(interfacedir)/libdevmapper.a
119 $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacedir) \
120 -o $@ dmsetup.o -ldevmapper $(LIBS) $(LIB_PTHREAD)
122 all: device-mapper
124 lvm: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a
125 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) lvm.o \
126 $(LVMLIBS) $(LIBS) $(LIB_PTHREAD) -rdynamic
128 lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacedir)/libdevmapper.a
129 $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacedir) -o $@ \
130 $(OBJECTS) lvm-static.o $(LVMLIBS) $(LIBS) $(LIB_PTHREAD) \
131 -rdynamic
133 liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
134 cat $(top_builddir)/lib/liblvm-internal.a > $@
135 $(AR) rs $@ $(OBJECTS) lvmcmdlib.o lvm2cmd.o
137 liblvm2cmd-static.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd-static.o
138 cat $(top_builddir)/lib/liblvm-internal.a > $@
139 $(AR) rs $@ $(OBJECTS) lvmcmdlib.o lvm2cmd-static.o
141 liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS)
143 .commands: commands.h cmdnames.h Makefile
144 $(CC) -E -P $(srcdir)/cmdnames.h 2> /dev/null | \
145 egrep -v '^ *(|#.*|dumpconfig|formats|help|pvdata|segtypes|version) *$$' > .commands
147 .PHONY: install_cmdlib_dynamic install_cmdlib_static \
148 install_tools_dynamic install_tools_static
150 ifneq ("@CFLOW_CMD@", "")
151 CFLOW_FLAGS += --cpp="$(CC) -E"
152 .PHONY: lvm.cflow
153 -include $(top_srcdir)/lib/liblvm-internal.cflow
154 lvm.cflow: $(SOURCES)
155 @CFLOW_CMD@ -o$@ $(CFLOW_FLAGS) $(INCLUDES) $(DEFS) $(SOURCES)
156 lvm.rxref: $(SOURCES)
157 @CFLOW_CMD@ -o$@ --cpp="$(CC) -E" -r --omit-arguments -x $(INCLUDES) $(DEFS) $(SOURCES)
158 lvm.xref: $(SOURCES)
159 @CFLOW_CMD@ -o$@ --cpp="$(CC) -E" --omit-arguments -x $(INCLUDES) $(DEFS) $(SOURCES)
160 lvm.rtree: $(SOURCES)
161 @CFLOW_CMD@ -o$@ --cpp="$(CC) -E" -r --omit-arguments -T -b $(INCLUDES) $(DEFS) $(SOURCES)
162 lvm.tree: $(SOURCES)
163 @CFLOW_CMD@ -o$@ --cpp="$(CC) -E" --omit-arguments -T -b $(INCLUDES) $(DEFS) $(SOURCES)
164 cflow: lvm.cflow lvm.xref lvm.tree lvm.rtree lvm.rxref
165 endif
167 install_cmdlib_dynamic: liblvm2cmd.$(LIB_SUFFIX)
168 $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
169 $(libdir)/liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION)
170 $(LN_S) -f liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION) $(libdir)/liblvm2cmd.$(LIB_SUFFIX)
171 $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $(srcdir)/lvm2cmd.h \
172 $(includedir)/lvm2cmd.h
174 install_cmdlib_static: liblvm2cmd-static.a
175 $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
176 $(libdir)/liblvm2cmd.a.$(LIB_VERSION)
177 $(LN_S) -f liblvm2cmd.a.$(LIB_VERSION) $(libdir)/liblvm2cmd.a
178 $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $(srcdir)/lvm2cmd.h \
179 $(includedir)/lvm2cmd.h
181 install_tools_dynamic: lvm .commands
182 $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) lvm \
183 $(sbindir)/lvm
184 @echo Creating symbolic links for individual commands in $(sbindir)
185 @( \
186 for v in `cat $(srcdir)/.commands`; do \
187 cd $(sbindir); \
188 $(LN_S) -f lvm $$v; \
189 done; \
192 install_tools_static: lvm.static
193 $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
194 $(staticdir)/lvm.static
196 install_dmsetup_dynamic: dmsetup
197 $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$<
199 install_dmsetup_static: dmsetup.static
200 $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$<
202 install_device-mapper: $(INSTALL_DMSETUP_TARGETS)
204 install_lvm2: $(INSTALL_LVM_TARGETS)
206 install: install_lvm2 install_device-mapper