source: trunk/doc-new/Makefile @ 32811

Last change on this file since 32811 was 32197, checked in by simon@…, 12 years ago

doc-new: Changed ?= to = for consistence. Also some whitespace changes.

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