2001-09-21 16:37:43 +04:00
#
2004-03-30 23:35:44 +04:00
# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
2017-03-14 03:47:46 +03:00
# Copyright (C) 2004-2017 Red Hat, Inc. All rights reserved.
2001-09-21 16:37:43 +04:00
#
2007-09-21 14:16:45 +04:00
# This file is part of LVM2.
2001-09-21 16:37:43 +04:00
#
2004-03-30 23:35:44 +04:00
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
2001-09-21 16:37:43 +04:00
#
2004-03-30 23:35:44 +04:00
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2016-01-21 13:49:46 +03:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2001-09-21 16:37:43 +04:00
srcdir = @srcdir@
top_srcdir = @top_srcdir@
2009-10-02 23:10:31 +04:00
top_builddir = @top_builddir@
2001-09-21 16:37:43 +04:00
2008-01-09 17:17:58 +03:00
FSADMMAN = fsadm.8
2012-10-12 16:37:57 +04:00
BLKDEACTIVATEMAN = blkdeactivate.8
2010-06-17 16:14:43 +04:00
DMEVENTDMAN = dmeventd.8
2015-08-28 15:03:18 +03:00
LVMETADMAN = lvmetad.8
LVMPOLLDMAN = lvmpolld.8
2015-09-06 01:46:22 +03:00
LVMLOCKDMAN = lvmlockd.8 lvmlockctl.8
2015-08-28 15:03:18 +03:00
CLVMDMAN = clvmd.8
CMIRRORDMAN = cmirrord.8
LVMCACHEMAN = lvmcache.7
LVMTHINMAN = lvmthin.7
2016-02-18 02:53:35 +03:00
LVMDBUSDMAN = lvmdbusd.8
2016-09-12 15:03:09 +03:00
LVMRAIDMAN = lvmraid.7
2015-03-05 23:00:44 +03:00
2001-12-31 20:20:22 +03:00
MAN5 = lvm.conf.5
2016-09-12 14:54:37 +03:00
MAN7 = lvmsystemid.7 lvmreport.7
2017-03-14 03:47:46 +03:00
MAN8 = lvm.8 lvmconf.8 lvmdump.8 lvm-config.8 lvm-dumpconfig.8 lvm-fullreport.8 \
lvm-lvpoll.8 lvcreate.8 lvchange.8 lvmconfig.8 lvconvert.8 lvdisplay.8 \
lvextend.8 lvreduce.8 lvremove.8 lvrename.8 lvresize.8 lvs.8 \
lvscan.8 pvchange.8 pvck.8 pvcreate.8 pvdisplay.8 pvmove.8 pvremove.8 \
pvresize.8 pvs.8 pvscan.8 vgcfgbackup.8 vgcfgrestore.8 vgchange.8 \
vgck.8 vgcreate.8 vgconvert.8 vgdisplay.8 vgexport.8 vgextend.8 \
vgimport.8 vgimportclone.8 vgmerge.8 vgmknodes.8 vgreduce.8 vgremove.8 \
vgrename.8 vgs.8 vgscan.8 vgsplit.8 \
2017-03-16 05:09:51 +03:00
lvmsar.8 lvmsadc.8 lvmdiskscan.8
2016-12-17 19:24:35 +03:00
MAN8DM = dmsetup.8 dmstats.8 dmfilemapd.8
MAN8CLUSTER =
MAN8SYSTEMD_GENERATORS = lvm2-activation-generator.8
2010-01-19 05:04:33 +03:00
2017-03-14 03:47:46 +03:00
2015-09-15 15:14:16 +03:00
i f e q ( $( MAKECMDGOALS ) , a l l _ m a n )
MAN_ALL = "yes"
e n d i f
i f e q ( $( MAKECMDGOALS ) , i n s t a l l _ a l l _ m a n )
MAN_ALL = "yes"
e n d i f
i f e q ( $( MAN_ALL ) , "yes" )
2016-02-18 02:53:35 +03:00
MAN8 += $( FSADMMAN) $( LVMETADMAN) $( LVMPOLLDMAN) $( LVMLOCKDMAN) $( LVMDBUSDMAN)
2015-08-28 15:03:18 +03:00
MAN8DM += $( BLKDEACTIVATEMAN) $( DMEVENTDMAN)
MAN8CLUSTER += $( CLVMDMAN) $( CMIRRORDMAN)
2016-09-12 15:03:09 +03:00
MAN7 += $( LVMCACHEMAN) $( LVMTHINMAN) $( LVMRAIDMAN)
2010-01-19 05:04:33 +03:00
e l s e
2015-08-28 15:03:18 +03:00
ifeq ( "@FSADM@" , "yes" )
MAN8 += $( FSADMMAN)
endif
2014-04-04 04:14:25 +04:00
2016-02-18 02:53:35 +03:00
ifeq ( "@BUILD_LVMDBUSD@" , "yes" )
MAN8 += $( LVMDBUSDMAN)
endif
2015-08-28 15:03:18 +03:00
ifeq ( "@BUILD_LVMETAD@" , "yes" )
MAN8 += $( LVMETADMAN)
endif
2010-01-19 05:04:33 +03:00
2015-08-28 15:03:18 +03:00
ifeq ( "@BUILD_LVMPOLLD@" , "yes" )
MAN8 += $( LVMPOLLDMAN)
endif
ifeq ( "@BUILD_LVMLOCKD@" , "yes" )
MAN8 += $( LVMLOCKDMAN)
endif
ifeq ( "@BLKDEACTIVATE@" , "yes" )
MAN8DM += $( BLKDEACTIVATEMAN)
endif
ifeq ( "@DMEVENTD@" , "yes" )
MAN8DM += $( DMEVENTDMAN)
endif
2014-05-15 14:06:18 +04:00
2015-08-28 15:03:18 +03:00
ifneq ( "@CLVMD@" , "none" )
MAN8CLUSTER += $( CLVMDMAN)
endif
ifeq ( "@BUILD_CMIRRORD@" , "yes" )
MAN8CLUSTER += $( CMIRRORDMAN)
endif
ifneq ( "@CACHE@" , "none" )
MAN7 += $( LVMCACHEMAN)
endif
ifneq ( "@THIN@" , "none" )
MAN7 += $( LVMTHINMAN)
endif
2016-09-12 15:03:09 +03:00
ifneq ( "@RAID@" , "none" )
MAN7 += $( LVMRAIDMAN)
endif
2014-04-04 04:14:25 +04:00
e n d i f
2010-03-04 12:56:01 +03:00
MAN5DIR = $( mandir) /man5
2014-04-04 04:14:25 +04:00
MAN7DIR = $( mandir) /man7
2010-03-04 12:56:01 +03:00
MAN8DIR = $( mandir) /man8
2001-09-21 16:37:43 +04:00
2017-03-15 04:36:12 +03:00
MANGENERATOR = ./man-generator
2017-03-14 03:47:46 +03:00
TESTMAN = test.gen
2010-03-04 12:51:37 +03:00
i n c l u d e $( top_builddir ) / m a k e . t m p l
2001-09-21 16:37:43 +04:00
2017-03-14 03:47:46 +03:00
CLEAN_TARGETS += $( MAN5) $( MAN7) $( MAN8) $( MAN8:%.8_gen= %.8) $( MAN8CLUSTER) \
$( MAN8SYSTEMD_GENERATORS) $( MAN8DM) $( MANGENERATOR) $( TESTMAN)
2015-08-28 15:03:18 +03:00
DISTCLEAN_TARGETS += $( FSADMMAN) $( BLKDEACTIVATEMAN) $( DMEVENTDMAN) \
$( LVMETADMAN) $( LVMPOLLDMAN) $( LVMLOCKDMAN) $( CLVMDMAN) $( CMIRRORDMAN) \
2016-09-12 15:03:09 +03:00
$( LVMCACHEMAN) $( LVMTHINMAN) $( LVMDBUSDMAN) $( LVMRAIDMAN)
2004-08-18 22:57:40 +04:00
2011-09-23 13:48:21 +04:00
all : man device -mapper
2008-10-08 16:50:13 +04:00
2017-03-14 03:47:46 +03:00
.PHONY : man install_man 5 install_man 7 install_man 8 pregenerated_man
2008-10-08 16:50:13 +04:00
2008-11-04 20:25:32 +03:00
device-mapper : $( MAN 8DM )
2008-11-01 05:19:19 +03:00
2017-03-14 03:47:46 +03:00
man : $( MAN 5) $( MAN 7) $( MAN 8) $( MAN 8CLUSTER ) $( MAN 8SYSTEMD_GENERATORS )
2008-10-08 16:50:13 +04:00
2015-09-15 15:14:16 +03:00
all_man : man
2017-03-14 03:47:46 +03:00
$(MAN5) $(MAN7) $(MAN8) $(MAN8DM) $(MAN8CLUSTER) $(MAN8SYSTEMD_GENERATORS) : Makefile
2008-10-08 16:50:13 +04:00
2017-03-14 03:47:46 +03:00
$(MANGENERATOR) : Makefile
2017-02-11 01:20:19 +03:00
$( CC) -DMAN_PAGE_GENERATOR -I$( top_builddir) /tools $( CFLAGS) $( top_srcdir) /tools/command.c -o $@
2017-03-14 03:47:46 +03:00
# Test whether or not the man page generator works
$(TESTMAN) : $( MANGENERATOR )
- $( MANGENERATOR) --primary lvmconfig > $@
SEE_ALSO = $( srcdir) /see_also.end
%.8_gen : $( srcdir ) /%.8_des $( srcdir ) /%.8_end $( MANGENERATOR ) $( TESTMAN )
( \
if [ ! -s $( TESTMAN) ] ; then \
echo " Copying pre-generated $@ " ; \
else \
echo " Generating $@ " ; \
fi \
)
( \
if [ ! -s $( TESTMAN) ] ; then \
cat $( srcdir) /$( @:%.8_gen= %.8_pregen) ; \
else \
MANCMD = $( basename $@ ) && \
$( MANGENERATOR) --primary $$ MANCMD $< && \
$( MANGENERATOR) --secondary $$ MANCMD && \
cat $( srcdir) /$( basename $@ ) .8_end && \
cat $( SEE_ALSO) ; \
fi \
) > $@
d e f i n e S U B S T V A R S
e c h o "Generating $@" ; $( SED ) - e "s+#VERSION#+$(LVM_VERSION)+;s+#DEFAULT_SYS_DIR#+$(DEFAULT_SYS_DIR)+;s+#DEFAULT_ARCHIVE_DIR#+$(DEFAULT_ARCHIVE_DIR)+;s+#DEFAULT_BACKUP_DIR#+$(DEFAULT_BACKUP_DIR)+;s+#DEFAULT_PROFILE_DIR#+$(DEFAULT_PROFILE_DIR)+;s+#DEFAULT_CACHE_DIR#+$(DEFAULT_CACHE_DIR)+;s+#DEFAULT_LOCK_DIR#+$(DEFAULT_LOCK_DIR)+;s+#CLVMD_PATH#+/data/lvmtest/usr/sbin/clvmd+;s+#LVM_PATH#+/data/lvmtest/sbin/lvm+;s+#DEFAULT_RUN_DIR#+/var/run/lvm+;s+#DEFAULT_PID_DIR#+/var/run+;s+#SYSTEMD_GENERATOR_DIR#+$(SYSTEMD_GENERATOR_DIR)+;s+#DEFAULT_MANGLING#+$(DEFAULT_MANGLING)+;" $< > $@
e n d e f
%.5 : $( srcdir ) /%.5_main
$( SUBSTVARS)
%.7 : $( srcdir ) /%.7_main
$( SUBSTVARS)
%.8 : $( srcdir ) /%.8_main
$( SUBSTVARS)
%.8 : %.8_gen
$( SUBSTVARS)
2017-02-11 01:20:19 +03:00
2010-04-10 01:42:48 +04:00
install_man5 : $( MAN 5)
$( INSTALL) -d $( MAN5DIR)
$( INSTALL_DATA) $( MAN5) $( MAN5DIR) /
2014-05-13 14:18:13 +04:00
install_man7 : $( MAN 7)
2014-04-04 04:14:25 +04:00
$( INSTALL) -d $( MAN7DIR)
$( INSTALL_DATA) $( MAN7) $( MAN7DIR) /
2017-03-14 03:47:46 +03:00
install_man8 : $( MAN 8) $( MAN 8GENERATED )
2010-04-10 01:42:48 +04:00
$( INSTALL) -d $( MAN8DIR)
$( INSTALL_DATA) $( MAN8) $( MAN8DIR) /
2017-03-14 03:47:46 +03:00
$( INSTALL_DATA) $( MAN8GENERATED) $( MAN8DIR) /
2010-04-10 01:42:48 +04:00
2014-04-04 04:14:25 +04:00
install_lvm2 : install_man 5 install_man 7 install_man 8
2010-04-10 01:42:48 +04:00
install_cluster : $( MAN 8CLUSTER )
2014-05-21 12:50:56 +04:00
i f d e f M A N 8 C L U S T E R
2010-04-10 01:42:48 +04:00
$( INSTALL) -d $( MAN8DIR)
$( INSTALL_DATA) $( MAN8CLUSTER) $( MAN8DIR) /
2014-05-21 12:50:56 +04:00
e n d i f
2010-04-10 01:42:48 +04:00
install_device-mapper : $( MAN 8DM )
$( INSTALL) -d $( MAN8DIR)
$( INSTALL_DATA) $( MAN8DM) $( MAN8DIR) /
2009-05-11 14:28:45 +04:00
2014-03-13 16:01:06 +04:00
install_systemd_generators : $( MAN 8SYSTEMD_GENERATORS )
$( INSTALL) -d $( MAN8DIR)
$( INSTALL_DATA) $( MAN8SYSTEMD_GENERATORS) $( MAN8DIR) /
2014-11-24 02:32:26 +03:00
install : install_lvm 2 install_device -mapper install_cluster
2015-08-28 15:03:18 +03:00
2015-09-15 15:14:16 +03:00
install_all_man : install install_systemd_generators
2017-03-14 03:47:46 +03:00
# Copy generated man pages back to source tree as fallback for machines where generator doesn't work
pregenerated_man : all
for i in $( srcdir) /*.8_des; do \
CMD = ` basename $$ i .8_des` ; \
cat $$ { CMD} .8 > $( srcdir) /$$ CMD.8_pregen ; \
done
generate : pregenerated_man