The beginnings of a friendlier Makefile. Doesn't do much except let you

build the HTML and RTF formats.
This commit is contained in:
Nik Clayton 1998-11-12 01:20:35 +00:00
parent 3d32f7a99c
commit 80e2e9e012
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=3792
3 changed files with 330 additions and 192 deletions
en/handbook
en_US.ISO8859-1/books/handbook
en_US.ISO_8859-1/books/handbook

View file

@ -1,74 +1,111 @@
# Makefile to build the Handbook from DocBook source.
#
# $Id: Makefile,v 1.5 1998-11-12 01:20:35 nik Exp $
#
# Requires these ports from textproc
#
# docbook
# dsssl-docbook-modular
# html
# jade
#
# and probably one or two others. You can probably get everything you need
# with the new textproc/docproj meta-port.
#
# Note that you need version 1.08 of dsssl-docbook-modular. In version 1.07
# the 'catalog' file is called 'CATALOG', and you will need to change the
# definition below.
#
# THIS IS A QUICK HACK (!) so that others can get an idea of how the
# Handbook will look after conversion. After typing "make", point your
# browser at book01.html and read on. This is still very much a work in
# progress, and the final formatting will be considerably different.
#
# Eventually I expect most of this will be folded back into bsd.sgml.mk.
#
# Any comments or suggestions about the conversion process should be sent
# to nik@FreeBSD.ORG
# Build the FreeBSD Handbook. Will eventually split in two, a generic .mk
# file which can be used by many Makefiles, and a much smaller Makefile
# which uses the generic.mk file.
#
# Note: Doing all this in a Makefile is a little odd. This is because there
# is typically not a 1:1 mapping between the .sgml files and the .html,
# .rtf, .ps, and other formats. For most of them, all the .sgml files will
# become one file in the chosen output format. For HTML, many .html files
# will be produced, but they won't be named after the corresponding .sgml
# files.
MAINTAINER=nik@FreeBSD.ORG
DOCS= handbook.sgml
#
# DOC is the root name of file(s) that will be generated (i.e, for
# foo.rtf, foo.ps, etc, DOC=foo. HTML generation ignores this, it
# is assumed that the stylesheet names this. If not set, DOC defaults
# to the name of the current directory.
#
DOC?= ${.CURDIR:T}
#
# FORMATS lists the output formats that should be generated. Valid values
# are
#
# ascii html ps pdf rtf
#
FORMATS= html
#
# SRCS lists the individual SGML files that make up the Handbook. Changes
# to any of these files will force a rebuild
#
# SGML content
SRCS= handbook.sgml
SRCS+= advanced-networking/chapter.sgml
SRCS+= backups/chapter.sgml
SRCS+= basics/chapter.sgml
SRCS+= bibliography/chapter.sgml
SRCS+= contrib/chapter.sgml
SRCS+= cutting-edge/chapter.sgml
SRCS+= disks/chapter.sgml
SRCS+= eresources/chapter.sgml
SRCS+= hw/chapter.sgml
SRCS+= install/chapter.sgml
SRCS+= internals/chapter.sgml
SRCS+= introduction/chapter.sgml
SRCS+= kernelconfig/chapter.sgml
SRCS+= kerneldebug/chapter.sgml
SRCS+= kernelopts/chapter.sgml
SRCS+= l10n/chapter.sgml
SRCS+= linuxemu/chapter.sgml
SRCS+= mail/chapter.sgml
SRCS+= mirrors/chapter.sgml
SRCS+= pgpkeys/chapter.sgml
SRCS+= policies/chapter.sgml
SRCS+= ppp-and-slip/chapter.sgml
SRCS+= printing/chapter.sgml
SRCS+= quotas/chapter.sgml
SRCS+= security/chapter.sgml
SRCS+= serialcomms/chapter.sgml
SRCS+= staff/chapter.sgml
SRCS+= x11/chapter.sgml
SRCS+= ports/chapter.sgml
# Entities
SRCS+= authors.ent chapters.ent mailing-lists.ent
JADE= /usr/local/bin/jade
DSLHTML= ../../sgml/freebsd.dsl
DSLPRINT= /usr/local/share/sgml/docbook/dsssl/modular/print/docbook.dsl
FREEBSDCATALOG= ../../sgml/catalog
DOCBOOKCATALOG= /usr/local/share/sgml/docbook/3.0/catalog
JADECATALOG= /usr/local/share/sgml/jade/catalog
DSSSLCATALOG= /usr/local/share/sgml/docbook/dsssl/modular/catalog
JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG}
# ------------------------------------------------------------------------
#
# Transformation rules
# Look at ${FORMATS} and work out which documents need to be generated.
# It is assumed that the HTML transformation will always create a file
# called index.html, and that for every other transformation the name
# of the generated file is ${DOC}.format.
#
# ${_docs} will be set to a list of all documents that must be made
# up to date.
# file.sgml --> file.html
.for _curformat in ${FORMATS}
_cf=${_curformat}
.if ${_cf} == "html"
_docs+= index.html
CLEANFILES+= *.html HTML.manifest
.else
_docs+= ${DOC}.${_curformat}
CLEANFILES+= ${DOC}.${_curformat}
.endif
.endfor
# ------------------------------------------------------------------------
#
# Examines file.sgml to determine the DTD in use. The DTD determines how
# the file will be converted to HTML.
.SUFFIXES: .sgml .html
SGMLNORM?= /usr/local/bin/sgmlnorm
HTMLCATALOG?= /usr/local/share/sgml/html/catalog
SGMLNORMFLAGS= -d -n -c ${HTMLCATALOG}
JADE?= /usr/local/bin/jade
DSL?= ../../sgml/freebsd.dsl
FREEBSDCATALOG?=../../sgml/catalog
DOCBOOKCATALOG?=/usr/local/share/sgml/docbook/3.0/catalog
JADECATALOG?= /usr/local/share/sgml/jade/catalog
DSSSLCATALOG?= /usr/local/share/sgml/docbook/dsssl/modular/catalog
JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} -d ${DSL} -t sgml
.sgml.html:
@DTD=`head -n 1 ${.IMPSRC} | perl -ne '/DTD (\w+)/; print $$1;'`; \
echo "${.IMPSRC} ($$DTD) --> ${.TARGET}"; \
case $$DTD in \
HTML) \
${SGMLNORM} ${SGMLNORMFLAGS} \
${.IMPSRC} > ${.TARGET}; \
;; \
DocBook) \
${JADE} ${JADEFLAGS} ${.IMPSRC}; \
;; \
*) \
echo "Don't know how to process $$DTD." \
;; \
esac
# ${SGMLNORM} ${SGMLNORMFLAGS} ${.IMPSRC} > ${.TARGET}
# Build some targets
# ------------------------------------------------------------------------
#
@ -78,8 +115,17 @@ JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JA
# If no target is specifed then .MAIN is made
.MAIN: all
#
# Build everything. Never completes, because handbook.html is never built
#
all: handbook.html
all: ${_docs}
index.html: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLHTML} -t sgml handbook.sgml
./conv.pl *.html
${DOC}.rtf: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLPRINT} -t rtf handbook.sgml
${DOC}.tex: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLPRINT} -t tex handbook.sgml
.include <bsd.dep.mk>
.include <bsd.obj.mk>

View file

@ -1,74 +1,111 @@
# Makefile to build the Handbook from DocBook source.
#
# $Id: Makefile,v 1.5 1998-11-12 01:20:35 nik Exp $
#
# Requires these ports from textproc
#
# docbook
# dsssl-docbook-modular
# html
# jade
#
# and probably one or two others. You can probably get everything you need
# with the new textproc/docproj meta-port.
#
# Note that you need version 1.08 of dsssl-docbook-modular. In version 1.07
# the 'catalog' file is called 'CATALOG', and you will need to change the
# definition below.
#
# THIS IS A QUICK HACK (!) so that others can get an idea of how the
# Handbook will look after conversion. After typing "make", point your
# browser at book01.html and read on. This is still very much a work in
# progress, and the final formatting will be considerably different.
#
# Eventually I expect most of this will be folded back into bsd.sgml.mk.
#
# Any comments or suggestions about the conversion process should be sent
# to nik@FreeBSD.ORG
# Build the FreeBSD Handbook. Will eventually split in two, a generic .mk
# file which can be used by many Makefiles, and a much smaller Makefile
# which uses the generic.mk file.
#
# Note: Doing all this in a Makefile is a little odd. This is because there
# is typically not a 1:1 mapping between the .sgml files and the .html,
# .rtf, .ps, and other formats. For most of them, all the .sgml files will
# become one file in the chosen output format. For HTML, many .html files
# will be produced, but they won't be named after the corresponding .sgml
# files.
MAINTAINER=nik@FreeBSD.ORG
DOCS= handbook.sgml
#
# DOC is the root name of file(s) that will be generated (i.e, for
# foo.rtf, foo.ps, etc, DOC=foo. HTML generation ignores this, it
# is assumed that the stylesheet names this. If not set, DOC defaults
# to the name of the current directory.
#
DOC?= ${.CURDIR:T}
#
# FORMATS lists the output formats that should be generated. Valid values
# are
#
# ascii html ps pdf rtf
#
FORMATS= html
#
# SRCS lists the individual SGML files that make up the Handbook. Changes
# to any of these files will force a rebuild
#
# SGML content
SRCS= handbook.sgml
SRCS+= advanced-networking/chapter.sgml
SRCS+= backups/chapter.sgml
SRCS+= basics/chapter.sgml
SRCS+= bibliography/chapter.sgml
SRCS+= contrib/chapter.sgml
SRCS+= cutting-edge/chapter.sgml
SRCS+= disks/chapter.sgml
SRCS+= eresources/chapter.sgml
SRCS+= hw/chapter.sgml
SRCS+= install/chapter.sgml
SRCS+= internals/chapter.sgml
SRCS+= introduction/chapter.sgml
SRCS+= kernelconfig/chapter.sgml
SRCS+= kerneldebug/chapter.sgml
SRCS+= kernelopts/chapter.sgml
SRCS+= l10n/chapter.sgml
SRCS+= linuxemu/chapter.sgml
SRCS+= mail/chapter.sgml
SRCS+= mirrors/chapter.sgml
SRCS+= pgpkeys/chapter.sgml
SRCS+= policies/chapter.sgml
SRCS+= ppp-and-slip/chapter.sgml
SRCS+= printing/chapter.sgml
SRCS+= quotas/chapter.sgml
SRCS+= security/chapter.sgml
SRCS+= serialcomms/chapter.sgml
SRCS+= staff/chapter.sgml
SRCS+= x11/chapter.sgml
SRCS+= ports/chapter.sgml
# Entities
SRCS+= authors.ent chapters.ent mailing-lists.ent
JADE= /usr/local/bin/jade
DSLHTML= ../../sgml/freebsd.dsl
DSLPRINT= /usr/local/share/sgml/docbook/dsssl/modular/print/docbook.dsl
FREEBSDCATALOG= ../../sgml/catalog
DOCBOOKCATALOG= /usr/local/share/sgml/docbook/3.0/catalog
JADECATALOG= /usr/local/share/sgml/jade/catalog
DSSSLCATALOG= /usr/local/share/sgml/docbook/dsssl/modular/catalog
JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG}
# ------------------------------------------------------------------------
#
# Transformation rules
# Look at ${FORMATS} and work out which documents need to be generated.
# It is assumed that the HTML transformation will always create a file
# called index.html, and that for every other transformation the name
# of the generated file is ${DOC}.format.
#
# ${_docs} will be set to a list of all documents that must be made
# up to date.
# file.sgml --> file.html
.for _curformat in ${FORMATS}
_cf=${_curformat}
.if ${_cf} == "html"
_docs+= index.html
CLEANFILES+= *.html HTML.manifest
.else
_docs+= ${DOC}.${_curformat}
CLEANFILES+= ${DOC}.${_curformat}
.endif
.endfor
# ------------------------------------------------------------------------
#
# Examines file.sgml to determine the DTD in use. The DTD determines how
# the file will be converted to HTML.
.SUFFIXES: .sgml .html
SGMLNORM?= /usr/local/bin/sgmlnorm
HTMLCATALOG?= /usr/local/share/sgml/html/catalog
SGMLNORMFLAGS= -d -n -c ${HTMLCATALOG}
JADE?= /usr/local/bin/jade
DSL?= ../../sgml/freebsd.dsl
FREEBSDCATALOG?=../../sgml/catalog
DOCBOOKCATALOG?=/usr/local/share/sgml/docbook/3.0/catalog
JADECATALOG?= /usr/local/share/sgml/jade/catalog
DSSSLCATALOG?= /usr/local/share/sgml/docbook/dsssl/modular/catalog
JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} -d ${DSL} -t sgml
.sgml.html:
@DTD=`head -n 1 ${.IMPSRC} | perl -ne '/DTD (\w+)/; print $$1;'`; \
echo "${.IMPSRC} ($$DTD) --> ${.TARGET}"; \
case $$DTD in \
HTML) \
${SGMLNORM} ${SGMLNORMFLAGS} \
${.IMPSRC} > ${.TARGET}; \
;; \
DocBook) \
${JADE} ${JADEFLAGS} ${.IMPSRC}; \
;; \
*) \
echo "Don't know how to process $$DTD." \
;; \
esac
# ${SGMLNORM} ${SGMLNORMFLAGS} ${.IMPSRC} > ${.TARGET}
# Build some targets
# ------------------------------------------------------------------------
#
@ -78,8 +115,17 @@ JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JA
# If no target is specifed then .MAIN is made
.MAIN: all
#
# Build everything. Never completes, because handbook.html is never built
#
all: handbook.html
all: ${_docs}
index.html: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLHTML} -t sgml handbook.sgml
./conv.pl *.html
${DOC}.rtf: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLPRINT} -t rtf handbook.sgml
${DOC}.tex: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLPRINT} -t tex handbook.sgml
.include <bsd.dep.mk>
.include <bsd.obj.mk>

View file

@ -1,74 +1,111 @@
# Makefile to build the Handbook from DocBook source.
#
# $Id: Makefile,v 1.5 1998-11-12 01:20:35 nik Exp $
#
# Requires these ports from textproc
#
# docbook
# dsssl-docbook-modular
# html
# jade
#
# and probably one or two others. You can probably get everything you need
# with the new textproc/docproj meta-port.
#
# Note that you need version 1.08 of dsssl-docbook-modular. In version 1.07
# the 'catalog' file is called 'CATALOG', and you will need to change the
# definition below.
#
# THIS IS A QUICK HACK (!) so that others can get an idea of how the
# Handbook will look after conversion. After typing "make", point your
# browser at book01.html and read on. This is still very much a work in
# progress, and the final formatting will be considerably different.
#
# Eventually I expect most of this will be folded back into bsd.sgml.mk.
#
# Any comments or suggestions about the conversion process should be sent
# to nik@FreeBSD.ORG
# Build the FreeBSD Handbook. Will eventually split in two, a generic .mk
# file which can be used by many Makefiles, and a much smaller Makefile
# which uses the generic.mk file.
#
# Note: Doing all this in a Makefile is a little odd. This is because there
# is typically not a 1:1 mapping between the .sgml files and the .html,
# .rtf, .ps, and other formats. For most of them, all the .sgml files will
# become one file in the chosen output format. For HTML, many .html files
# will be produced, but they won't be named after the corresponding .sgml
# files.
MAINTAINER=nik@FreeBSD.ORG
DOCS= handbook.sgml
#
# DOC is the root name of file(s) that will be generated (i.e, for
# foo.rtf, foo.ps, etc, DOC=foo. HTML generation ignores this, it
# is assumed that the stylesheet names this. If not set, DOC defaults
# to the name of the current directory.
#
DOC?= ${.CURDIR:T}
#
# FORMATS lists the output formats that should be generated. Valid values
# are
#
# ascii html ps pdf rtf
#
FORMATS= html
#
# SRCS lists the individual SGML files that make up the Handbook. Changes
# to any of these files will force a rebuild
#
# SGML content
SRCS= handbook.sgml
SRCS+= advanced-networking/chapter.sgml
SRCS+= backups/chapter.sgml
SRCS+= basics/chapter.sgml
SRCS+= bibliography/chapter.sgml
SRCS+= contrib/chapter.sgml
SRCS+= cutting-edge/chapter.sgml
SRCS+= disks/chapter.sgml
SRCS+= eresources/chapter.sgml
SRCS+= hw/chapter.sgml
SRCS+= install/chapter.sgml
SRCS+= internals/chapter.sgml
SRCS+= introduction/chapter.sgml
SRCS+= kernelconfig/chapter.sgml
SRCS+= kerneldebug/chapter.sgml
SRCS+= kernelopts/chapter.sgml
SRCS+= l10n/chapter.sgml
SRCS+= linuxemu/chapter.sgml
SRCS+= mail/chapter.sgml
SRCS+= mirrors/chapter.sgml
SRCS+= pgpkeys/chapter.sgml
SRCS+= policies/chapter.sgml
SRCS+= ppp-and-slip/chapter.sgml
SRCS+= printing/chapter.sgml
SRCS+= quotas/chapter.sgml
SRCS+= security/chapter.sgml
SRCS+= serialcomms/chapter.sgml
SRCS+= staff/chapter.sgml
SRCS+= x11/chapter.sgml
SRCS+= ports/chapter.sgml
# Entities
SRCS+= authors.ent chapters.ent mailing-lists.ent
JADE= /usr/local/bin/jade
DSLHTML= ../../sgml/freebsd.dsl
DSLPRINT= /usr/local/share/sgml/docbook/dsssl/modular/print/docbook.dsl
FREEBSDCATALOG= ../../sgml/catalog
DOCBOOKCATALOG= /usr/local/share/sgml/docbook/3.0/catalog
JADECATALOG= /usr/local/share/sgml/jade/catalog
DSSSLCATALOG= /usr/local/share/sgml/docbook/dsssl/modular/catalog
JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG}
# ------------------------------------------------------------------------
#
# Transformation rules
# Look at ${FORMATS} and work out which documents need to be generated.
# It is assumed that the HTML transformation will always create a file
# called index.html, and that for every other transformation the name
# of the generated file is ${DOC}.format.
#
# ${_docs} will be set to a list of all documents that must be made
# up to date.
# file.sgml --> file.html
.for _curformat in ${FORMATS}
_cf=${_curformat}
.if ${_cf} == "html"
_docs+= index.html
CLEANFILES+= *.html HTML.manifest
.else
_docs+= ${DOC}.${_curformat}
CLEANFILES+= ${DOC}.${_curformat}
.endif
.endfor
# ------------------------------------------------------------------------
#
# Examines file.sgml to determine the DTD in use. The DTD determines how
# the file will be converted to HTML.
.SUFFIXES: .sgml .html
SGMLNORM?= /usr/local/bin/sgmlnorm
HTMLCATALOG?= /usr/local/share/sgml/html/catalog
SGMLNORMFLAGS= -d -n -c ${HTMLCATALOG}
JADE?= /usr/local/bin/jade
DSL?= ../../sgml/freebsd.dsl
FREEBSDCATALOG?=../../sgml/catalog
DOCBOOKCATALOG?=/usr/local/share/sgml/docbook/3.0/catalog
JADECATALOG?= /usr/local/share/sgml/jade/catalog
DSSSLCATALOG?= /usr/local/share/sgml/docbook/dsssl/modular/catalog
JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} -d ${DSL} -t sgml
.sgml.html:
@DTD=`head -n 1 ${.IMPSRC} | perl -ne '/DTD (\w+)/; print $$1;'`; \
echo "${.IMPSRC} ($$DTD) --> ${.TARGET}"; \
case $$DTD in \
HTML) \
${SGMLNORM} ${SGMLNORMFLAGS} \
${.IMPSRC} > ${.TARGET}; \
;; \
DocBook) \
${JADE} ${JADEFLAGS} ${.IMPSRC}; \
;; \
*) \
echo "Don't know how to process $$DTD." \
;; \
esac
# ${SGMLNORM} ${SGMLNORMFLAGS} ${.IMPSRC} > ${.TARGET}
# Build some targets
# ------------------------------------------------------------------------
#
@ -78,8 +115,17 @@ JADEFLAGS?= -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JA
# If no target is specifed then .MAIN is made
.MAIN: all
#
# Build everything. Never completes, because handbook.html is never built
#
all: handbook.html
all: ${_docs}
index.html: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLHTML} -t sgml handbook.sgml
./conv.pl *.html
${DOC}.rtf: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLPRINT} -t rtf handbook.sgml
${DOC}.tex: ${SRCS}
${JADE} ${JADEFLAGS} -d ${DSLPRINT} -t tex handbook.sgml
.include <bsd.dep.mk>
.include <bsd.obj.mk>