OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [pkgconf/] [rules.doc] - Blame information for rev 299

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#=============================================================================
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
    else
76
      Error: unable to locate DocBook tools.
77
    endif
78
  endif
79
endif
80
 
81
A4_STYLESHEET  := $(TOPLEVEL)/pkgconf/ssa4.dsl
82
LETTER_STYLESHEET  := $(TOPLEVEL)/pkgconf/ssletter.dsl
83
HTML_STYLESHEET  := $(TOPLEVEL)/pkgconf/stylesheet.dsl
84
FIXHTML          := $(TOPLEVEL)/pkgconf/fixhtml.tcl
85
 
86
# The files that will be generated:
87
ifeq (,$(MAIN_HTML))
88
 MAIN_HTML        := $(subst .sgml,.html,$(MAIN_SGML))
89
endif
90
ifeq (,$(MAIN_PDF))
91
 MAIN_PDF         := $(subst .sgml,.pdf,$(MAIN_SGML))
92
endif
93
 
94
MAIN_PDFA4        := $(subst .pdf,-a4.pdf,$(MAIN_PDF))
95
MAIN_PDFLETTER    := $(subst .pdf,-letter.pdf,$(MAIN_PDF))
96
 
97
# Rules for generating pictures
98
GIFS := $(foreach x,$(PICTURES),$(x).gif)
99
EPS  := $(foreach x,$(PICTURES),$(x).eps)
100
PNGS :=$(foreach x,$(PICTURES),$(x).png)
101
 
102
%.gif: %.fig
103
        convert -crop 0x0 $< $@
104
 
105
%.png: %.fig
106
        fig2dev -L png $< $@
107
 
108
%.eps: %.fig
109
        convert -crop 0x0 $< $@
110
 
111
# This is a little grotty. In some cases we want to just copy files from
112
# their source location to the destination's current dir and nothing
113
# more.
114
copyfiles:
115
ifneq (,$(COPYFILES))
116
        cp $(COPYFILES) .
117
endif
118
 
119
default: check
120
 
121
# Validating an sgml document can be achieved with
122
check: $(MAIN_SGML) $(OTHER_SGML) $(GIFS) $(EPS)
123
        nsgmls -vs -c $(CATALOG) $<
124
 
125
# Generating HTML from the SGML. In practice multiple .html files may
126
# be generated, but for the purposes of dependency analysis the others
127
# can be ignored.
128
html: copyfiles $(MAIN_HTML)
129
 
130
$(MAIN_HTML): $(MAIN_SGML) $(OTHER_SGML) $(PNGS) $(HTML_STYLESHEET) $(FIXHTML)
131
        jade -t sgml -i html -c $(DSSSL_CATALOG) -d $(HTML_STYLESHEET)#html $<
132
        tclsh $(FIXHTML)
133
 
134
# PDF files can be generated in a similar fashion.
135
pdfa4: copyfiles $(MAIN_PDFA4)
136
 
137
$(MAIN_PDFA4):  $(MAIN_SGML) $(OTHER_SGML) $(PNGS) $(A4_STYLESHEET)
138
        jade -o $(subst .pdf,.tex,$(MAIN_PDFA4)) -t tex -V tex-backend -c $(DSSSL_CATALOG) -d $(A4_STYLESHEET)#print $<
139
        pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFA4))
140
        pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFA4))
141
        pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFA4))
142
 
143
pdfletter: copyfiles $(MAIN_PDFLETTER)
144
 
145
$(MAIN_PDFLETTER):  $(MAIN_SGML) $(OTHER_SGML) $(PNGS) $(LETTER_STYLESHEET)
146
        jade -o $(subst .pdf,.tex,$(MAIN_PDFLETTER)) -t tex -V tex-backend -c $(DSSSL_CATALOG) -d $(LETTER_STYLESHEET)#print $<
147
        pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFLETTER))
148
        pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFLETTER))
149
        pdfjadetex $(subst .pdf,.tex,$(MAIN_PDFLETTER))
150
 
151
#$(MAIN_PDF):  $(MAIN_SGML) $(OTHER_SGML) $(EPS) $(ECOS_STYLESHEET)
152
#       jade -o $(subst .sgml,.tex,$(MAIN_SGML)) -t tex -V tex-backend -d $(ECOS_STYLESHEET)#print $<
153
#       jadetex $(subst .sgml,.tex,$(MAIN_SGML))
154
#       jadetex $(subst .sgml,.tex,$(MAIN_SGML))
155
#       jadetex $(subst .sgml,.tex,$(MAIN_SGML))
156
#       dvips -o $(subst .sgml,.ps,$(MAIN_SGML)) $(subst .sgml,.dvi,$(MAIN_SGML))
157
#       ps2pdf $(subst .sgml,.ps,$(MAIN_SGML)) $(subst .sgml,.pdf,$(MAIN_SGML))
158
 
159
# Clean. For now assume that all .html, .gif etc files are generated
160
clean:
161
        rm -rf *.html *.tex *.dvi *.aux *.log *.out *.ps *.pdf *.gif *.eps *.png

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.