<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch master
in repository macports-guide.
</pre>
<p><a href="https://github.com/macports/macports-guide/commit/52db6a14e546837ab79f55c42351b81d95a17c4c">https://github.com/macports/macports-guide/commit/52db6a14e546837ab79f55c42351b81d95a17c4c</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 52db6a14e546837ab79f55c42351b81d95a17c4c
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Wed Mar 28 07:29:08 2018 +0200
<span style='display:block; white-space:pre;color:#404040;'> Makefile: De-duplicate build rules
</span>---
Makefile | 44 +++++++++++++++-----------------------------
1 file changed, 15 insertions(+), 29 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/Makefile b/Makefile
</span><span style='display:block; white-space:pre;color:#808080;'>index 2aeda97..9a6c429 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/Makefile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/Makefile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -38,7 +38,6 @@ GUIDE = guide
</span> GUIDE_SRC = $(GUIDE)/xml
# Result directories.
GUIDE_RESULT = $(GUIDE)/html
<span style='display:block; white-space:pre;background:#ffe0e0;'>-GUIDE_RESULT_CHUNK = $(GUIDE_RESULT)/chunked
</span> GUIDE_RESULT_DBLATEX = $(GUIDE)/dblatex
# Path to the DocBook XSL files.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -56,47 +55,34 @@ STYLESHEET = docbook.css
</span>
all: guide guide-chunked
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Generate the HTML guide using DocBook from the XML sources in $(GUIDE_SRC).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-guide:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(MKDIR) -p $(GUIDE_RESULT)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(CP) $(GUIDE)/resources/$(STYLESHEET) $(GUIDE_RESULT)/$(STYLESHEET)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(CP) $(GUIDE)/resources/images/* $(GUIDE_RESULT)/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(CP) $(GUIDE)/resources/*.js $(GUIDE_RESULT)/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Generate the HTML guide using DocBook from the XML sources
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+guide: GUIDE_OUTDIR= $(GUIDE_RESULT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+guide-chunked: GUIDE_OUTDIR = $(GUIDE_RESULT)/chunked
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+guide-chunked: GUIDE_XSL = $(GUIDE_XSL_CHUNK)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+guide guide-chunked::
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $(MKDIR) -p $(GUIDE_OUTDIR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $(CP) $(GUIDE)/resources/$(STYLESHEET) $(GUIDE_OUTDIR)/$(STYLESHEET)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $(CP) $(GUIDE)/resources/images/* $(GUIDE_OUTDIR)/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $(CP) $(GUIDE)/resources/*.js $(GUIDE_OUTDIR)/
</span> ifeq ($(UNAME), Linux)
$(LN) -sfn $(DOCBOOK) $(GUIDE)/resources/xsl
else
$(LN) -sfh $(DOCBOOK) $(GUIDE)/resources/xsl
endif
$(XSLTPROC) --xinclude \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- --output $(GUIDE_RESULT)/index.html \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ --output $(GUIDE_OUTDIR)/index.html \
</span> $(GUIDE_XSL) $(GUIDE_SRC)/guide.xml
# Convert all sections (h1-h9) to a link so it's easy to link to them.
# If someone knows a better way to do this please change it.
$(REINPLACE) \
's|(<h[0-9] [^>]*><a id="([^"]*)"></a>)([^<]*)(</h[0-9]>)|\1<a href="#\2">\3</a>\4|g' \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $(GUIDE_RESULT)/index.html
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $(GUIDE_OUTDIR)/index.html
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Generate the chunked HTML guide with one section per file.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-guide-chunked:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(MKDIR) -p $(GUIDE_RESULT_CHUNK)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(CP) $(GUIDE)/resources/$(STYLESHEET) $(GUIDE_RESULT_CHUNK)/$(STYLESHEET)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(CP) $(GUIDE)/resources/images/* $(GUIDE_RESULT_CHUNK)/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-ifeq ($(UNAME), Linux)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(LN) -sfn $(DOCBOOK) $(GUIDE)/resources/xsl
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(LN) -sfh $(DOCBOOK) $(GUIDE)/resources/xsl
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(XSLTPROC) --xinclude \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --output $(GUIDE_RESULT_CHUNK)/index.html \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(GUIDE_XSL_CHUNK) $(GUIDE_SRC)/guide.xml
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Convert all sections (h1-h9) to a link so it's easy to link to them.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # If someone knows a better way to do this please change it.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(REINPLACE) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 's|(<h[0-9] [^>]*><a id="([^"]*)"></a>)([^<]*)(</h[0-9]>)|\1<a href="#\2">\3</a>\4|g' \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(GUIDE_RESULT_CHUNK)/*.html
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Add the table of contents to every junked HTML file.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+guide-chunked::
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Add the table of contents to every chunked HTML file.
</span> # If someone knows a better way to do this please change it.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $(TCLSH) toc-for-chunked.tcl $(GUIDE_RESULT_CHUNK)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $(TCLSH) toc-for-chunked.tcl $(GUIDE_OUTDIR)
</span>
# Generate the guide as a PDF.
guide-dblatex: SUFFIX = pdf
</pre><pre style='margin:0'>
</pre>