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
77 INSTALL_LVM_TARGETS
= install_tools_dynamic
78 INSTALL_DMSETUP_TARGETS
= install_dmsetup_dynamic
79 INSTALL_CMDLIB_TARGETS
= install_cmdlib_dynamic
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
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
)
98 TARGETS
+= liblvm2cmd.
$(LIB_SUFFIX
)
99 INSTALL_LVM_TARGETS
+= $(INSTALL_CMDLIB_TARGETS
)
103 LVMLIBS
+= -ldevmapper-event
-lpthread
106 LVMLIBS
+= -ldevmapper
108 DEFS
+= -DLVM_SHARED_PATH
=\"$(exec_prefix)/sbin
/lvm
\"
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
)
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
) \
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
151 CFLOW_FLAGS
+= --cpp="$(CC) -E"
153 -include $(top_srcdir
)/lib
/liblvm-internal.cflow
154 lvm.cflow
: $(SOURCES
)
155 -o
$@
$(CFLOW_FLAGS
) $(INCLUDES
) $(DEFS
) $(SOURCES
)
156 lvm.rxref
: $(SOURCES
)
157 -o
$@
--cpp="$(CC) -E" -r
--omit-arguments
-x
$(INCLUDES
) $(DEFS
) $(SOURCES
)
159 -o
$@
--cpp="$(CC) -E" --omit-arguments
-x
$(INCLUDES
) $(DEFS
) $(SOURCES
)
160 lvm.rtree
: $(SOURCES
)
161 -o
$@
--cpp="$(CC) -E" -r
--omit-arguments
-T
-b
$(INCLUDES
) $(DEFS
) $(SOURCES
)
163 -o
$@
--cpp="$(CC) -E" --omit-arguments
-T
-b
$(INCLUDES
) $(DEFS
) $(SOURCES
)
164 cflow
: lvm.cflow lvm.xref lvm.tree lvm.rtree lvm.rxref
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 \
184 @echo Creating symbolic links for individual commands in
$(sbindir
)
186 for v in
`cat $(srcdir)/.commands`; do \
188 $(LN_S
) -f lvm
$$v; \
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