]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/pkgconf/rules.doc
Initial revision
[karo-tx-redboot.git] / packages / pkgconf / rules.doc
1 #=============================================================================
2 #
3 #    rules.doc
4 #
5 #    Additional rules for processing documentation written in DocBook/SGML
6 #
7 #=============================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12 ##
13 ## eCos is free software; you can redistribute it and/or modify it under
14 ## the terms of the GNU General Public License as published by the Free
15 ## Software Foundation; either version 2 or (at your option) any later version.
16 ##
17 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20 ## for more details.
21 ##
22 ## You should have received a copy of the GNU General Public License along
23 ## with eCos; if not, write to the Free Software Foundation, Inc.,
24 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 ##
26 ## As a special exception, if other files instantiate templates or use macros
27 ## or inline functions from this file, or you compile this file and link it
28 ## with other works to produce a work based on this file, this file does not
29 ## by itself cause the resulting work to be covered by the GNU General Public
30 ## License. However the source code for this file must still be made available
31 ## in accordance with section (3) of the GNU General Public License.
32 ##
33 ## This exception does not invalidate any other reasons why a work based on
34 ## this file might be covered by the GNU General Public License.
35 ##
36 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 ## at http://sources.redhat.com/ecos/ecos-license/
38 ## -------------------------------------------
39 #####ECOSGPLCOPYRIGHTEND####
40 #=============================================================================
41 #####DESCRIPTIONBEGIN####
42 #
43 # Author(s):     bartv
44 # Date:          2001-01-11
45 # Purpose:       Rules for processing documentation
46 # Description:
47 #     Each package's doc directory's makefile should define the
48 #     following variables:
49 #       TOPLEVEL   - of the component repository
50 #       MAIN_SGML  - documentation entry point
51 #       OTHER_SGML - any other .sgml files accessed from main
52 #       PICTURES   - referenced by the SGML files
53 #####DESCRIPTIONEND####
54 #=============================================================================
55
56 .PHONY: default check html pdf clean copyfiles
57
58 # Locations of the stylesheets and other SGML support files. These
59 # have moved around in various releases of the tools.
60 ifneq (,$(wildcard /usr/share/sgml/docbook))
61   CATALOG       := /etc/sgml/catalog
62   ifneq (,$(wildcard /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/catalog))
63     DSSSL_CATALOG  := /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/catalog
64   else
65     DSSSL_CATALOG := $(firstword $(wildcard /usr/share/sgml/docbook/dsssl-stylesheets-*/catalog))
66   endif
67 else
68   ifneq (,$(wildcard /usr/lib/sgml/stylesheets/nwalsh-modular/catalog))
69     CATALOG          := /usr/lib/sgml/CATALOG
70     DSSSL_CATALOG    := /usr/lib/sgml/stylesheets/nwalsh-modular/catalog
71   else
72     ifneq (,$(wildcard /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/sgml.catalog))
73       CATALOG        := /usr/lib/sgml/catalog
74       DSSSL_CATALOG  := /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/sgml.catalog
75     endif
76   endif
77 endif
78
79 A4_STYLESHEET  := $(TOPLEVEL)/pkgconf/ssa4.dsl
80 LETTER_STYLESHEET  := $(TOPLEVEL)/pkgconf/ssletter.dsl
81 HTML_STYLESHEET  := $(TOPLEVEL)/pkgconf/stylesheet.dsl
82 FIXHTML          := $(TOPLEVEL)/pkgconf/fixhtml.tcl
83
84 ifneq (,$(CATALOG))
85  CATALOG_OPT := -c $(CATALOG)
86 endif
87
88 ifneq (,$(DSSL_CATALOG))
89  DSSL_CATALOG_OPT := -c $(DSSL_CATALOG)
90 endif
91
92 # The files that will be generated:
93 ifeq (,$(MAIN_HTML))
94  MAIN_HTML        := $(subst .sgml,.html,$(MAIN_SGML))
95 endif
96 ifeq (,$(MAIN_PDF))
97  MAIN_PDF         := $(subst .sgml,.pdf,$(MAIN_SGML))
98 endif
99
100 MAIN_PDFA4        := $(subst .pdf,-a4.pdf,$(MAIN_PDF))
101 MAIN_PDFLETTER    := $(subst .pdf,-letter.pdf,$(MAIN_PDF))
102
103 # Rules for generating pictures
104 GIFS := $(foreach x,$(PICTURES),$(x).gif)
105 EPS  := $(foreach x,$(PICTURES),$(x).eps)
106 PNGS :=$(foreach x,$(PICTURES),$(x).png)
107
108 %.gif: %.fig
109         convert -crop 0x0 $< $@
110
111 %.png: %.fig
112         fig2dev -L png $< $@
113
114 %.eps: %.fig
115         convert -crop 0x0 $< $@
116
117 # This is a little grotty. In some cases we want to just copy files from
118 # their source location to the destination's current dir and nothing
119 # more.
120 copyfiles:
121 ifneq (,$(COPYFILES))
122         cp $(COPYFILES) .
123 endif
124
125 default: check
126
127 # Validating an sgml document can be achieved with
128 check: $(MAIN_SGML) $(OTHER_SGML) $(GIFS) $(EPS)
129         nsgmls -vs $(CATALOG_OPT) $<
130
131 # Generating HTML from the SGML. In practice multiple .html files may
132 # be generated, but for the purposes of dependency analysis the others
133 # can be ignored.
134 html: copyfiles $(MAIN_HTML)
135
136 $(MAIN_HTML): $(MAIN_SGML) $(OTHER_SGML) $(PNGS) $(HTML_STYLESHEET) $(FIXHTML)
137         jade -t sgml -i html $(DSSSL_CATALOG_OPT) -d $(HTML_STYLESHEET)#html $<
138         tclsh $(FIXHTML)
139
140 # PDF files can be generated in a similar fashion.
141 pdfa4: copyfiles $(MAIN_PDFA4)
142
143 $(MAIN_PDFA4):  $(MAIN_SGML) $(OTHER_SGML) $(PNGS) $(A4_STYLESHEET)
144         jade -o $(subst .pdf,.tex,$(MAIN_PDFA4)) -t tex -V tex-backend $(DSSSL_CATALOG_OPT) -d $(A4_STYLESHEET)#print $<
145         pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFA4))
146         pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFA4))
147         pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFA4))
148
149 pdfletter: copyfiles $(MAIN_PDFLETTER)
150
151 $(MAIN_PDFLETTER):  $(MAIN_SGML) $(OTHER_SGML) $(PNGS) $(LETTER_STYLESHEET)
152         jade -o $(subst .pdf,.tex,$(MAIN_PDFLETTER)) -t tex -V tex-backend $(DSSSL_CATALOG_OPT) -d $(LETTER_STYLESHEET)#print $<
153         pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFLETTER))
154         pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFLETTER))
155         pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFLETTER))
156
157 #$(MAIN_PDF):  $(MAIN_SGML) $(OTHER_SGML) $(EPS) $(ECOS_STYLESHEET)
158 #       jade -o $(subst .sgml,.tex,$(MAIN_SGML)) -t tex -V tex-backend -d $(ECOS_STYLESHEET)#print $<
159 #       jadetex $(subst .sgml,.tex,$(MAIN_SGML))
160 #       jadetex $(subst .sgml,.tex,$(MAIN_SGML))
161 #       jadetex $(subst .sgml,.tex,$(MAIN_SGML))
162 #       dvips -o $(subst .sgml,.ps,$(MAIN_SGML)) $(subst .sgml,.dvi,$(MAIN_SGML))
163 #       ps2pdf $(subst .sgml,.ps,$(MAIN_SGML)) $(subst .sgml,.pdf,$(MAIN_SGML))
164
165 # Clean. For now assume that all .html, .gif etc files are generated
166 clean:
167         rm -rf *.html *.tex *.dvi *.aux *.log *.out *.ps *.pdf *.gif *.eps *.png