blob: 7e17f206d068cc9699a9e9f2b49b2f3d80dbe52e [file] [log] [blame]
# Copyright(c) 2015-2017 Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
if USE_ASCIIDOCTOR
do_subst = sed -e 's,@Utility@,Ndctl,g' -e's,@utility@,ndctl,g'
CONFFILE = asciidoctor-extensions.rb
asciidoctor-extensions.rb: ../asciidoctor-extensions.rb.in
$(AM_V_GEN) $(do_subst) < $< > $@
else
do_subst = sed -e 's,UTILITY,ndctl,g'
CONFFILE = asciidoc.conf
asciidoc.conf: ../asciidoc.conf.in
$(AM_V_GEN) $(do_subst) < $< > $@
endif
man1_MANS = \
ndctl.1 \
ndctl-wait-scrub.1 \
ndctl-start-scrub.1 \
ndctl-zero-labels.1 \
ndctl-read-labels.1 \
ndctl-write-labels.1 \
ndctl-init-labels.1 \
ndctl-check-labels.1 \
ndctl-enable-region.1 \
ndctl-disable-region.1 \
ndctl-enable-dimm.1 \
ndctl-disable-dimm.1 \
ndctl-enable-namespace.1 \
ndctl-disable-namespace.1 \
ndctl-create-namespace.1 \
ndctl-destroy-namespace.1 \
ndctl-check-namespace.1 \
ndctl-inject-error.1 \
ndctl-inject-smart.1 \
ndctl-update-firmware.1 \
ndctl-list.1 \
ndctl-monitor.1
CLEANFILES = $(man1_MANS)
.ONESHELL:
attrs.adoc: $(srcdir)/Makefile.am
$(AM_V_GEN) cat <<- EOF >$@
:ndctl_monitorconfdir: $(ndctl_monitorconfdir)
:ndctl_monitorconf: $(ndctl_monitorconf)
EOF
XML_DEPS = \
../../version.m4 \
Makefile \
$(CONFFILE) \
../copyright.txt \
region-description.txt \
xable-region-options.txt \
dimm-description.txt \
xable-dimm-options.txt \
xable-namespace-options.txt \
ars-description.txt \
labels-description.txt \
labels-options.txt \
attrs.adoc
RM ?= rm -f
if USE_ASCIIDOCTOR
%.1: %.txt $(XML_DEPS)
$(AM_V_GEN)$(RM) $@+ $@ && \
$(ASCIIDOC) -b manpage -d manpage -acompat-mode \
-I. -rasciidoctor-extensions \
-amansource=ndctl -amanmanual="ndctl Manual" \
-andctl_version=$(VERSION) -o $@+ $< && \
mv $@+ $@
else
%.xml: %.txt $(XML_DEPS)
$(AM_V_GEN)$(RM) $@+ $@ && \
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
--unsafe -andctl_version=$(VERSION) -o $@+ $< && \
mv $@+ $@
%.1: %.xml $(XML_DEPS)
$(AM_V_GEN)$(RM) $@ && \
$(XMLTO) -o . -m ../manpage-normal.xsl man $<
endif