source: trunk/doc-new/Makefile @ 32166

Last change on this file since 32166 was 32166, checked in by jmpp@…, 12 years ago
  1. Makefile:
    • abstract all command calls into path'd variables so that the Makefile can work called off launchd without any PATH reliance;
    • in doing that, note that the xsltproc command is provided by the libxslt port and require it too (path'd under ${prefix} too, for consistency);
  2. README:
    • correct project naming case;
    • note that the libxslt port is also required to build the documentation.
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1# $Id: Makefile 32166 2007-12-18 21:55:06Z jmpp@macports.org $
2# Makefile to generate the macports html guide and the man pages.
3# The ports 'docbook-xsl', 'docbook-xml' and 'libxslt' have to be
4# installed.
5
6# If your macports isn't installed in /opt/local you have to change PREFIX
7# here and update man/resources/macports.xsl to use your port installation!
8
9
10# prefix of the macports installation:
11PREFIX ?= /opt/local
12
13# command abstraction variables:
14MKDIR = /bin/mkdir
15CP = /bin/cp
16RM = /bin/rm
17SED = /usr/bin/sed
18XSLTPROC = $(PREFIX)/bin/xsltproc
19
20# data directories:
21GUIDE ?= guide
22MAN   ?= man
23# source directories:
24GUIDE-SRC ?= $(GUIDE)/xml
25MAN-SRC   ?= $(MAN)/xml
26# result directories:
27GUIDE-RESULT ?= $(GUIDE)/html
28MAN-RESULT   ?= $(MAN)/man/
29# man temporary directory:
30MAN-TMP ?= $(MAN)/tmp
31
32# path to the docbook xsl files:
33DOCBOOK   ?= $(PREFIX)/share/xsl/docbook-xsl
34GUIDE-XSL ?= $(DOCBOOK)/xhtml/profile-docbook.xsl
35MAN-XSL   ?= $(MAN)/resources/macports.xsl
36
37# docbook html stylesheet for the guide:
38STYLESHEET ?= docbook.css
39# additional parameters for the guide:
40STRINGPARAMS ?= --stringparam html.stylesheet $(STYLESHEET) \
41                      --stringparam section.autolabel 1 \
42                      --stringparam toc.section.depth 1 \
43                      --stringparam generate.toc "book toc" \
44                      --stringparam section.label.includes.component.label 1 \
45                      --stringparam profile.condition "noman"
46
47
48.PHONY: all guide man clean
49
50all: guide man
51
52guide:
53        $(MKDIR) -p $(GUIDE-RESULT)
54        $(CP) $(GUIDE)/resources/$(STYLESHEET) $(GUIDE-RESULT)/$(STYLESHEET)
55        $(CP) $(GUIDE)/resources/images/* $(GUIDE-RESULT)/
56        $(XSLTPROC) --xinclude $(STRINGPARAMS) --output $(GUIDE-RESULT)/index.html \
57            $(GUIDE-XSL) $(GUIDE-SRC)/guide.xml
58
59man:
60        $(MKDIR) -p $(MAN-RESULT)
61        $(MKDIR) -p $(MAN-TMP)
62        $(CP) $(GUIDE-SRC)/portfile-*.xml $(MAN-TMP)
63        $(SED) -i "" 's|<section|<refsection|g' $(MAN-TMP)/*
64        $(SED) -i "" 's|</section>|</refsection>|g' $(MAN-TMP)/*
65        $(XSLTPROC) --xinclude --output $(MAN-RESULT) $(MAN-XSL) \
66            $(MAN-SRC)/port.1.xml \
67            $(MAN-SRC)/portfile.7.xml \
68            $(MAN-SRC)/portgroup.7.xml \
69            $(MAN-SRC)/porthier.7.xml
70        $(RM) -r $(MAN-TMP)
71
72clean:
73        $(RM) -rf $(GUIDE-RESULT)
74        $(RM) -rf $(MAN-RESULT)
75        $(RM) -rf $(MAN-TMP)
Note: See TracBrowser for help on using the repository browser.