# Makefile in documentation directory
#
# This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
#
# drbd is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# drbd 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.
#
# You should have received a copy of the GNU General Public License
# along with drbd; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

# variables set by configure
mandir = @mandir@
datarootdir = @datarootdir@
XSLTPROC = @XSLTPROC@
PO4A_TRANSLATE = @PO4A_TRANSLATE@
PO4A_GETTEXTIZE = @PO4A_GETTEXTIZE@

# features enabled or disabled by configure
WITH_83_SUPPORT = @WITH_83_SUPPORT@
WITH_84_SUPPORT = @WITH_84_SUPPORT@
WITH_UDEV = @WITH_UDEV@
WITH_XEN = @WITH_XEN@
WITH_PACEMAKER = @WITH_PACEMAKER@
WITH_RGMANAGER = @WITH_RGMANAGER@
WITH_BASHCOMPLETION = @WITH_BASHCOMPLETION@
WITH_DRBDMON=@WITH_DRBDMON@
WITH_PREBUILTMAN = @WITH_PREBUILTMAN@
WITH_WINDRBD = @WITH_WINDRBD@

PACKAGE_VERSION = @PACKAGE_VERSION@

# variables meant to be overridden from the make command line
ifeq ($(WITH_WINDRBD),yes)
DESTDIR ?=
else
DESTDIR ?= /
endif

CREATE_MAN_LINK ?= yes

STYLESHEET_PREFIX ?= http://docbook.sourceforge.net/release/xsl/current
MANPAGES_STYLESHEET ?= $(STYLESHEET_PREFIX)/manpages/docbook.xsl
HTML_STYLESHEET ?= $(STYLESHEET_PREFIX)/xhtml/docbook.xsl
FO_STYLESHEET ?= $(STYLESHEET_PREFIX)/fo/docbook.xsl

XSLTPROC_OPTIONS ?= --xinclude
XSLTPROC_OPTIONS += --stringparam variablelist.term.break.after 1
#XSLTPROC_OPTIONS += --stringparam variablelist.term.separator ""
XSLTPROC_MANPAGES_OPTIONS ?= $(XSLTPROC_OPTIONS)
XSLTPROC_HTML_OPTIONS ?= $(XSLTPROC_OPTIONS)
XSLTPROC_FO_OPTIONS ?= $(XSLTPROC_OPTIONS)

PO4A_TRANSLATE_OPTIONS = -f docbook -M utf-8 -L utf-8 -keep 0
PO4A_GETTEXTIZE_OPTIONS = -f docbook -M utf-8

DRBDSETUP_CMDS = new-resource new-minor del-resource del-minor
DRBDSETUP_CMDS += new-peer new-path del-peer del-path
DRBDSETUP_CMDS += attach connect disk-options net-options resource-options peer-device-options
DRBDSETUP_CMDS += disconnect detach primary secondary verify invalidate invalidate-remote
DRBDSETUP_CMDS += down role cstate dstate
DRBDSETUP_CMDS += resize check-resize pause-sync resume-sync
DRBDSETUP_CMDS += outdate show-gi get-gi show events2
DRBDSETUP_CMDS += status suspend-io resume-io new-current-uuid
DRBDSETUP_CMDS += wait-connect-volume wait-connect-connection wait-connect-resource
DRBDSETUP_CMDS += wait-sync-volume wait-sync-connection wait-sync-resource
DRBDSETUP_CMDS += forget-peer rename-resource

make_doc := $(shell $(XSLTPROC)				\
	$(XSLTPROC_MANPAGES_OPTIONS)			\
	$(MANPAGES_STYLESHEET) < /dev/null > /dev/null 2>&1 && echo doc )
