openafs/doc/xml/AdminRef/Makefile.in
Andrew Deason d86c4d632e doc: Fix doc/xml for objdir builds
Fix various issues so that building the documentation in doc/xml works
for objdir builds:

- set srcdir=@srcdir@ like all other Makefile's, so VPATH is set
  correctly via Makefile.config

- Pass "--path '@abs_builddir@'" to all xml/xsl processors, so they
  can find the generated version.xml (otherwise they only look in
  srcdir)

- Pass --output when building PDFs, so the generated PDF doesn't go in
  srcdir

- Specify $(srcdir) for $(BOOK).xml and generate-xml.pl

- Change generate-xml.pl to find pod2refentry in srcdir instead of '.'

Change-Id: Id09595dba6e70e3d367a26e279446844750d1fd4
Reviewed-on: https://gerrit.openafs.org/15856
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
2024-09-27 15:16:42 -04:00

54 lines
1.5 KiB
Makefile

# Makefile to build the AFS Reference Guide for Unix.
srcdir=@srcdir@
BOOK = auarf000
all: $(BOOK).pdf $(BOOK).epub $(BOOK).mobi
include @TOP_OBJDIR@/src/config/Makefile.config
VERSION=version
include @TOP_OBJDIR@/src/config/Makefile.version
SRCS = $(BOOK).xml preface.xml $(VERSION).xml \
entities.dtd sect1.xml sect3.xml sect5.xml sect8.xml
DOCBOOK_STYLESHEETS = @DOCBOOK_STYLESHEETS@
XSLTPROC = @XSLTPROC@ --stringparam variablelist.as.blocks 1 --param use.id.as.filename 1
DOCBOOK2PDF = @DOCBOOK2PDF@
DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub
KINDLEGEN = @KINDLEGEN@
XSL_FLAGS = --path '@abs_builddir@'
entities.dtd sect1.xml sect3.xml sect5.xml sect8.xml:
$(srcdir)/generate-xml.pl $(TOP_SRCDIR)
$(BOOK).pdf: $(SRCS)
if test "x$(DOCBOOK2PDF)" = "xfop"; then \
$(XSLTPROC) $(XSL_FLAGS) \
$(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \
$(srcdir)/$(BOOK).xml > $(BOOK).fo; \
$(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \
else \
$(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \
$(srcdir)/$(BOOK).xml; \
fi
$(BOOK).epub: $(SRCS)
if test -x "$(DBTOEPUB)" ; then \
$(DBTOEPUB) -s $(TOP_SRCDIR)/../doc/xml/mobi-fixup.xsl \
$(srcdir)/$(BOOK).xml; \
fi
$(BOOK).mobi: $(BOOK).epub
if test -n "$(KINDLEGEN)" && test -x "$(DBTOEPUB)" ; then \
$(KINDLEGEN) $(BOOK).epub -o $(BOOK).mobi; \
fi
check:
xmllint $(XSL_FLAGS) --noout --valid $(srcdir)/$(BOOK).xml
clean:
rm -f $(BOOK).pdf $(BOOK).mobi $(BOOK).epub $(BOOK).fo \
entities.dtd sect1.xml sect3.xml sect5.xml sect8.xml $(VERSION).xml
rm -rf sect1 sect3 sect5 sect8