* Make build/install of www /usr/obj prefix clean.

* Use make variables instead of hard coding commands, paths, and
  options.
* Wrap some long lines.
* Replace shell loops with make for loops, etc.

PR:		docs/31132
Submitted by:	Cyrille Lefevre <clefevre@citeweb.net>
This commit is contained in:
Murray Stokely 2001-10-29 10:14:33 +00:00
parent 134d0c030a
commit 0d8e79bd0c
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=11067
18 changed files with 218 additions and 131 deletions

View file

@ -1,5 +1,5 @@
#
# $FreeBSD: www/en/FAQ/Makefile,v 1.5 2001/04/17 09:05:42 nik Exp $
# $FreeBSD: www/en/FAQ/Makefile,v 1.6 2001/06/11 02:38:58 ache Exp $
#
# Build the FreeBSD FAQ *outside* of the www tree, and install it
# in to the right place as necessary.
@ -14,13 +14,14 @@
# At build time, we have to link to the doc/ directory at the same level
# as the www/ tree.
all:
ln -fs ${.CURDIR}/../../../doc/en_US.ISO8859-1/books/faq/* .
${LN} -fs ${.OBJDIR}/../../../doc/en_US.ISO8859-1/books/faq/* .
# At install time the www/en/doc/ directory has been populated, so we can
# link in to there instead.
install:
[ -d ${DOCINSTALLDIR} ] || mkdir ${DOCINSTALLDIR}
(cd ${DOCINSTALLDIR} && ln -fs ../doc/en_US.ISO8859-1/books/faq/* ${DOCINSTALLDIR})
[ -d ${DOCINSTALLDIR} ] || ${MKDIR} ${DOCINSTALLDIR}
cd ${DOCINSTALLDIR}; \
${LN} -fs ../doc/en_US.ISO8859-1/books/faq/* ${DOCINSTALLDIR}
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/Makefile,v 1.72 2001/10/22 20:15:18 bmah Exp $
# $FreeBSD: www/en/Makefile,v 1.73 2001/10/24 18:14:41 phantom Exp $
.if exists(Makefile.conf)
.include "Makefile.conf"
.endif
@ -41,6 +41,7 @@ SUBDIR+= copyright
SUBDIR+= search
SUBDIR+= gallery
SUBDIR+= projects
SUBDIR+= prstats
SUBDIR+= platforms
SUBDIR+= releases
SUBDIR+= smp
@ -79,20 +80,36 @@ WEBDIR= data
# index.html is special, and generated from index.xsl and news/news.xml
DATA+= index.html
CLEANFILES+= index.html
index.html: index.xsl news/news.xml news/press.xml includes.xsl news/includes.xsl
xsltproc -nonet -o index.html index.xsl news/news.xml
-tidy -i -m -f /dev/null index.html
${XSLTPROC} ${XSLTPROCFLAGS} -o index.html \
${.CURDIR}/index.xsl ${.CURDIR}/news/news.xml
-${TIDY} ${TIDYFLAGS} index.html
# Handle the FAQ/ and handbook/ directories specially.
CLEANFILES+= FAQ
FAQ:
ln -fs ${.CURDIR}/../../doc/en_US.ISO8859-1/books/faq FAQ
${LN} -fs ${.OBJDIR}/../../doc/en_US.ISO8859-1/books/faq FAQ
CLEANFILES+= handbook
handbook:
ln -fs ${.CURDIR}/../../doc/en_US.ISO8859-1/books/handbook handbook
${LN} -fs ${.OBJDIR}/../../doc/en_US.ISO8859-1/books/handbook handbook
afterinstall:
(cd ${DOCINSTALLDIR} && ln -fs doc/en_US.ISO8859-1/books/faq ${DOCINSTALLDIR}/FAQ)
(cd ${DOCINSTALLDIR} && ln -fs doc/en_US.ISO8859-1/books/handbook ${DOCINSTALLDIR}/handbook)
cd ${DOCINSTALLDIR}; \
${LN} -fs doc/en_US.ISO8859-1/books/faq ${DOCINSTALLDIR}/FAQ
cd ${DOCINSTALLDIR}; \
${LN} -fs doc/en_US.ISO8859-1/books/handbook ${DOCINSTALLDIR}/handbook
LINBOT?= ${PREFIX}/bin/linbot
LINBOTFLAGS?= -ab
LINBOTDIR?= /linbot
LINBOTINSTALLDIR?= ${DESTDIR}${LINBOTDIR}
LINBOTURL?= http://www.FreeBSD.org/
linbot:
@[ -d ${LINBOTINSTALLDIR} ] || ${MKDIR} ${LINBOTINSTALLDIR}
${LINBOT} ${LINBOTFLAGS} -o ${LINBOTINSTALLDIR} ${LINBOTURL}
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/cgi/Makefile,v 1.16 2000/08/14 04:57:27 knu Exp $
# $FreeBSD: www/en/cgi/Makefile,v 1.17 2000/11/07 04:05:09 kuriyama Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -11,7 +11,7 @@ DATA= ftp.mirrors
DATA+= cvsweb.conf cvsweb.conf-freebsd cvsweb.conf-netbsd cvsweb.conf-openbsd
CGI= ftp.cgi gallery.cgi mirror.cgi cgi-lib.pl cgi-style.pl
CGI+= search.cgi cvsweb.cgi query-pr.cgi query-pr-summary.cgi
CGI+= dosendpr.cgi freebsd.def html.pl reg.cgi missing_handler.cgi
CGI+= dosendpr.cgi freebsd.def html.pl reg.cgi missing_handler.cgi
CGI+= ports.cgi pds.cgi man.cgi url.cgi getmsg.cgi mid.cgi
CGI+= mailindex.cgi

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/copyright/Makefile,v 1.10 2000/11/07 04:05:13 kuriyama Exp $
# $FreeBSD: www/en/copyright/Makefile,v 1.11 2001/06/14 03:09:55 dd Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -20,19 +20,18 @@ CVS_OPT+= -Q
CVS_OPT+= -R
.endif
DATA+= COPYING COPYING.LIB ${LEGAL}
# FreeBSD Ports redistribution restrictions
LEGAL= LEGAL
LEGAL_FILE= ports/LEGAL
CLEANFILES+= ${LEGAL}
CLEANFILES+= ${LEGAL}
.if defined(NOPORTSCVS)
${LEGAL}: $${PORTSBASE}/${LEGAL_FILE}
cp ${PORTSBASE}/${LEGAL_FILE} ${LEGAL}
${CP} ${PORTSBASE}/${LEGAL_FILE} ${LEGAL}
.else
${LEGAL}:
cvs ${CVS_OPT} co -p ${LEGAL_FILE} > ${.TARGET}
${CVS} ${CVS_OPT} co -p ${LEGAL_FILE} > ${.TARGET}
.endif
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,5 +1,5 @@
#
# $FreeBSD: www/en/doc/Makefile,v 1.6 2001/06/11 02:38:59 ache Exp $i
# $FreeBSD: www/en/doc/Makefile,v 1.7 2001/08/23 08:12:26 murray Exp $i
#
# Build the FreeBSD documentation *outside* of the www tree, and install it
# in to the right place as necessary.
@ -9,21 +9,44 @@
# requirements here.
#
all:
(unset DESTDIR || true; cd ${.CURDIR}/../../../doc/en_US.ISO8859-1 && ${MAKE} FORMATS=html-split\ html all)
(unset DESTDIR || true; cd ${.CURDIR}/../../../doc/en_US.ISO8859-1 && ${MAKE} FORMATS=html-split\ html DOCDIR=${.CURDIR} install)
(unset DESTDIR || true; cd ${.CURDIR}/../../../doc/en_US.ISO8859-1/books/handbook && ${MAKE} pgpkeyring > ${.CURDIR}/pgpkeyring.txt)
all: all-all all-install all-pgpkeyring
all-all:
@unset DESTDIR || true; \
cd ${.CURDIR}/../../../doc/en_US.ISO8859-1; \
${MAKE} FORMATS="html-split html" \
INSTALL_COMPRESSED= all
all-install:
@unset DESTDIR || true; \
cd ${.CURDIR}/../../../doc/en_US.ISO8859-1; \
${MAKE} FORMATS="html-split html" DOCDIR=${.OBJDIR} \
INSTALL_COMPRESSED= install
all-pgpkeyring:
@unset DESTDIR || true; \
cd ${.CURDIR}/../../../doc/en_US.ISO8859-1/books/handbook; \
${MAKE} \
pgpkeyring > ${.OBJDIR}/pgpkeyring.txt
install clean:
(unset DESTDIR || true; cd ${.CURDIR}/../../../doc/en_US.ISO8859-1 && ${MAKE} FORMATS=html-split\ html DOCDIR=${DESTDIR}/data/doc ${.TARGET})
@unset DESTDIR || true; \
cd ${.CURDIR}/../../../doc/en_US.ISO8859-1; \
${MAKE} FORMATS="html-split html" DOCDIR=${DESTDIR}/data/doc \
INSTALL_COMPRESSED= ${.TARGET}
.if make(install)
(unset DESTDIR || true; cd ${.CURDIR}/../../../doc/en_US.ISO8859-1/books/handbook && ${MAKE} pgpkeyring > ${DESTDIR}/data/doc/pgpkeyring.txt)
@unset DESTDIR || true; \
cd ${.CURDIR}/../../../doc/en_US.ISO8859-1/books/handbook; \
${MAKE} \
pgpkeyring > ${DESTDIR}/data/doc/pgpkeyring.txt
.endif
.if make(clean)
rm -rf en* handbook faq pgpkeyring.txt
${RM} -rf en* handbook faq pgpkeyring.txt
.endif
obj:
cd ${.CURDIR}/../../../doc/en_US.ISO8859-1 && ${MAKE} ${.TARGET}
.include "${.CURDIR}/../../share/mk/web.site.mk"
obj: _OBJUSE
_OBJUSE: .USE
@unset DESTDIR || true; \
cd ${.CURDIR}/../../../doc/en_US.ISO8859-1; \
${MAKE} ${.TARGET}

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/gallery/Makefile,v 1.12 2001/08/07 15:55:35 nik Exp $
# $FreeBSD: www/en/gallery/Makefile,v 1.13 2001/09/05 07:51:40 kuriyama Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -7,29 +7,33 @@
.include "../Makefile.inc"
.endif
XSLT= env SGML_CATALOG_FILES=/usr/local/share/xml/dtd/xhtml/xhtml.soc \
xsltproc --catalogs
XSLTPROCFLAGS= --catalogs
XSLT= ${SETENV} SGML_CATALOG_FILES=${PREFIX}/share/xml/dtd/xhtml/xhtml.soc \
${XSLTPROC} ${XSLTPROCFLAGS}
INDEXLINK= gallery.html
DATA+= gallery.html cgallery.html npgallery.html pgallery.html
CLEANFILES+= cgallery.html npgallery.html pgallery.html gallery.html
CLEANFILES+= ${DATA}
gallery.html: gallery.xml gallery.xsl ../includes.xsl
${XSLT} gallery.xsl gallery.xml > gallery.html
-tidy -i -m -f /dev/null gallery.html
${XSLT} ${.CURDIR}/gallery.xsl ${.CURDIR}/gallery.xml > ${.TARGET}
-${TIDY} ${TIDYFLAGS} ${.TARGET}
cgallery.html: gallery.xml gallery-entry.xsl
${XSLT} --param type \'commercial\' gallery-entry.xsl gallery.xml > cgallery.html
-tidy -i -m -f /dev/null cgallery.html
${XSLT} --param type \'commercial\' \
${.CURDIR}/gallery-entry.xsl ${.CURDIR}/gallery.xml > ${.TARGET}
-${TIDY} ${TIDYFLAGS} ${.TARGET}
npgallery.html: gallery.xml gallery-entry.xsl
${XSLT} --param type \'nonprofit\' gallery-entry.xsl gallery.xml > npgallery.html
-tidy -i -m -f /dev/null npgallery.html
${XSLT} --param type \'nonprofit\' \
${.CURDIR}/gallery-entry.xsl ${.CURDIR}/gallery.xml > ${.TARGET}
-${TIDY} ${TIDYFLAGS} ${.TARGET}
pgallery.html: gallery.xml gallery-entry.xsl
${XSLT} --param type \'personal\' gallery-entry.xsl gallery.xml > pgallery.html
-tidy -i -m -f /dev/null pgallery.html
${XSLT} --param type \'personal\' \
${.CURDIR}/gallery-entry.xsl ${.CURDIR}/gallery.xml > ${.TARGET}
-${TIDY} ${TIDYFLAGS} ${.TARGET}
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,5 +1,5 @@
#
# $FreeBSD: www/en/handbook/Makefile,v 1.6 2001/04/17 09:05:43 nik Exp $
# $FreeBSD: www/en/handbook/Makefile,v 1.7 2001/06/11 02:39:00 ache Exp $
#
.if exists(../Makefile.conf)
@ -12,13 +12,15 @@
# At build time, we have to link to the doc/ directory at the same level
# as the www/ tree.
all:
ln -fs ${.CURDIR}/../../../doc/en_US.ISO8859-1/books/handbook/* .
${LN} -fs ${.OBJDIR}/../../../doc/en_US.ISO8859-1/books/handbook/* .
# At install time the ../doc/ directory has been populated, so we can
# link in to there instead.
install:
[ -d ${DOCINSTALLDIR} ] || mkdir ${DOCINSTALLDIR}
(cd ${DOCINSTALLDIR} && ln -fs ../doc/en_US.ISO8859-1/books/handbook/* ${DOCINSTALLDIR})
[ -d ${DOCINSTALLDIR} ] || ${MKDIR} ${DOCINSTALLDIR}
cd ${DOCINSTALLDIR}; \
${LN} -fs ../doc/en_US.ISO8859-1/books/handbook/* \
${DOCINSTALLDIR}
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/news/1997/Makefile,v 1.2 2000/03/22 16:22:49 phantom Exp $
# $FreeBSD: www/en/news/1997/Makefile,v 1.3 2000/11/07 04:05:20 kuriyama Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -10,4 +10,3 @@
DOCS= index.sgml
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,4 +1,4 @@
# $FreeBSD$
# $FreeBSD: www/en/news/1998/Makefile,v 1.1 2001/04/13 00:54:06 eric Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -10,4 +10,3 @@
DOCS= index.sgml
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,4 +1,4 @@
# $FreeBSD$
# $FreeBSD: www/en/news/1999/Makefile,v 1.1 2001/04/13 00:54:09 eric Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -10,4 +10,3 @@
DOCS= index.sgml
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,4 +1,4 @@
# $FreeBSD$
# $FreeBSD: www/en/news/2000/Makefile,v 1.1 2001/04/13 00:54:11 eric Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -10,4 +10,3 @@
DOCS= index.sgml
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/news/Makefile,v 1.28 2001/08/10 10:32:11 nik Exp $
# $FreeBSD: www/en/news/Makefile,v 1.29 2001/09/05 15:31:58 kuriyama Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -35,14 +35,17 @@ DATA= newsflash.html news.rdf press.html
CLEANFILES+= newsflash.html news.rdf press.html
newsflash.html: newsflash.xsl news.xml includes.xsl ../includes.xsl
xsltproc -nonet -o newsflash.html newsflash.xsl news.xml
-tidy -i -m -f /dev/null newsflash.html
${XSLTPROC} ${XSLTPROCFLAGS} -o ${.TARGET} \
${.CURDIR}/newsflash.xsl ${.CURDIR}/news.xml
-${TIDY} ${TIDYFLAGS} ${.TARGET}
news.rdf: news-rdf.xsl news.xml includes.xsl ../includes.xsl
xsltproc -nonet -o news.rdf news-rdf.xsl news.xml
${XSLTPROC} ${XSLTPROCFLAGS} -o ${.TARGET} \
${.CURDIR}/news-rdf.xsl ${.CURDIR}/news.xml
press.html: press.xsl press.xml includes.xsl ../includes.xsl
xsltproc -nonet -o press.html press.xsl press.xml
-tidy -i -m -f /dev/null press.html
${XSLTPROC} ${XSLTPROCFLAGS} -o ${.TARGET} \
${.CURDIR}/press.xsl ${.CURDIR}/press.xml
-${TIDY} ${TIDYFLAGS} ${.TARGET}
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/news/status/Makefile,v 1.7 2001/10/17 02:33:25 chris Exp $
# $FreeBSD: www/en/news/status/Makefile,v 1.8 2001/10/19 22:22:37 chris Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -21,8 +21,9 @@ DATA+= report-sample.xml
CLEANFILES+= ${DATA:M*.html}
.xml.html: report.xsl includes.xsl
xsltproc -nonet -o ${.TARGET} report.xsl ${.IMPSRC}
-tidy -i -m -f /dev/null ${.TARGET}
${XSLTPROC} ${XSLTPROCFLAGS} -o ${.TARGET} \
${.CURDIR}/report.xsl ${.IMPSRC}
-${TIDY} ${TIDYFLAGS} ${.TARGET}
INDEXLINK= status.html

View file

@ -1,7 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" [
<!ENTITY base CDATA "..">
<!ENTITY email 'freebsd-www'>
<!ENTITY title "Supported Platforms">
<!ENTITY date "$FreeBSD: www/en/platforms/index.sgml,v 1.3 2001/07/06 02:12:05 dd Exp $">
<!ENTITY date "$FreeBSD: www/en/platforms/index.sgml,v 1.4 2001/10/24 18:10:33 phantom Exp $">
<!ENTITY % includes SYSTEM "../includes.sgml"> %includes;]>
<html>

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/ports/Makefile,v 1.32 2001/04/22 17:44:25 wosch Exp $
# $FreeBSD: www/en/ports/Makefile,v 1.33 2001/06/14 03:09:56 dd Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -26,17 +26,16 @@ CVS_OPT+= -d ${PORTSCVSROOT}
.if defined(NOPORTSCVS)
${INDEX}: $${PORTSBASE}/${PINDEX}
cp ${PORTSBASE}/${PINDEX} ${INDEX}
${CP} ${PORTSBASE}/${PINDEX} ${INDEX}
.else
${INDEX}:
cvs ${CVS_OPT} co -p ${PINDEX} > ${INDEX}
${CVS} ${CVS_OPT} co -p ${PINDEX} > ${INDEX}
.endif
# build the list of available packages only on the
# main FreeBSD machines
hostname!= hostname
#
# don't build the packages links if NO_PACKAGES_LINK
# is set and not empty.
@ -48,29 +47,28 @@ hostname!= hostname
hostname= ${NO_PACKAGES_LINK}
.endif
packages.exists:
.if ${hostname} == "hub.freebsd.org" || ${hostname} == "freefall.freebsd.org"
@if sh ${.CURDIR}/packages > ${.TARGET}.temp; then \
mv ${.TARGET}.temp ${.TARGET}; \
@if ${SH} ${.CURDIR}/packages > ${.TARGET}.temp; then \
${MV} ${.TARGET}.temp ${.TARGET}; \
else \
rm ${.TARGET}.temp; touch ${.TARGET}; \
${RM} ${.TARGET}.temp; ${TOUCH} ${.TARGET}; \
fi;
.else
touch ${.TARGET}
${TOUCH} ${.TARGET}
.endif
Makefile.gen: index.sgml .NOTMAIN
echo DOCS= *.sgml > Makefile.gen
${ECHO_CMD} DOCS= *.sgml > Makefile.gen
index.sgml: ${INDEX} categories packages.exists portindex ports.inc .NOTMAIN
rm -f *.sgml
${RM} -f *.sgml
${PORTINDEX} ${INDEX} ${.CURDIR}
install: all
all install clean:
(cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} -f Makefile.inc0 ${.TARGET})
cd ${.CURDIR}; \
${MAKE} ${MAKEFLAGS} -f ${.CURDIR}/Makefile.inc0 ${.TARGET}
.include "${WEB_PREFIX}/share/mk/web.site.mk"

View file

@ -7,10 +7,10 @@
# of relnotes should appear on the web site. The second word is the
# path to that relnotes set.
#
# $FreeBSD: www/en/relnotes/Makefile,v 1.3 2001/08/30 06:59:55 dd Exp $
# $FreeBSD: www/en/relnotes/Makefile,v 1.4 2001/09/09 15:32:29 dd Exp $
#
RELNOTES= CURRENT ${.CURDIR}/../../../relnotes/doc \
RELNOTES?= CURRENT ${.CURDIR}/../../../relnotes/doc \
4-STABLE ${.CURDIR}/../../../relnotes4/doc
all install clean obj:
@ -18,7 +18,7 @@ all install clean obj:
while :; do \
case $$# in \
0) break;; \
1) echo "bad \$$RELNOTES value"; false; break;; \
1) ${ECHO_CMD} "bad \$$RELNOTES value"; false; break;; \
esac; \
webname=$$1; shift; realpath=$$1; shift; \
(unset DESTDIR || true; \

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/search/Makefile,v 1.7 2000/09/30 00:21:39 nbm Exp $
# $FreeBSD: www/en/search/Makefile,v 1.8 2000/11/07 04:05:36 kuriyama Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -18,7 +18,7 @@ CLEANFILES+=atoz.sgml site.sgml
index-site.html: atoz.sgml site.sgml
atoz.sgml: web.atoz
sort -fu ${.ALLSRC} | ${PERL} ${.CURDIR}/atoz.pl > ${.TARGET}
${SORT} -fu ${.ALLSRC} | ${PERL} ${.CURDIR}/atoz.pl > ${.TARGET}
site.sgml: site.map
${PERL} ${.CURDIR}/site.pl < ${.ALLSRC} > ${.TARGET}

View file

@ -1,5 +1,5 @@
# bsd.web.mk
# $FreeBSD: www/share/mk/web.site.mk,v 1.35 2000/11/07 11:39:40 kuriyama Exp $
# $FreeBSD: www/share/mk/web.site.mk,v 1.36 2000/11/22 02:35:42 kuriyama Exp $
#
# Build and install a web site.
@ -27,7 +27,24 @@ CGIOWN?= ${USER}
CGIGRP?= www
CGIMODE?= 775
PERL?= perl5
CP?= /bin/cp
CVS?= /usr/bin/cvs
ECHO_CMD?= echo
SETENV?= /usr/bin/env
LN?= /bin/ln
MKDIR?= /bin/mkdir
MV?= /bin/mv
PERL?= /usr/bin/perl5
RM?= /bin/rm
SED?= /usr/bin/sed
SH?= /bin/sh
SORT?= /usr/bin/sort
TOUCH?= /usr/bin/touch
XSLTPROC?= ${PREFIX}/bin/xsltproc
XSLTPROCFLAGS?= -nonet
TIDY?= ${PREFIX}/bin/tidy
TIDYFLAGS?= -i -m -f /dev/null
#
# Install dirs derived from the above.
@ -64,42 +81,53 @@ PORTSBASE?= /usr
.if defined(REVCHECK)
PREHTML= ${WEB_PREFIX}/ja/prehtml
PREHTMLFLAGS= ${PREHTMLOPTS}
CANONPREFIX0!= cd ${WEB_PREFIX}; echo $${PWD};
CANONPREFIX0!= cd ${WEB_PREFIX}; ${ECHO_CMD} $${PWD};
CANONPREFIX= ${PWD:S/^${CANONPREFIX0}//:S/^\///}
LOCALTOP!= echo ${CANONPREFIX} | perl -pe 's@[^/]+@..@g; $$_.="/." if($$_ eq".."); s@^\.\./@@;'
DIR_IN_LOCAL!= echo ${CANONPREFIX} | perl -pe 's@^[^/]+/?@@;'
LOCALTOP!= ${ECHO_CMD} ${CANONPREFIX} | \
${PERL} -pe 's@[^/]+@..@g; $$_.="/." if($$_ eq".."); s@^\.\./@@;'
DIR_IN_LOCAL!= ${ECHO_CMD} ${CANONPREFIX} | ${PERL} -pe 's@^[^/]+/?@@;'
PREHTMLFLAGS+= -revcheck "${LOCALTOP}" "${DIR_IN_LOCAL}"
.else
DATESUBST= 's/<!ENTITY date[ \t]*"$$Free[B]SD. .* \(.* .*\) .* .* $$">/<!ENTITY date "Last modified: \1">/'
PREHTML= sed -e ${DATESUBST}
PREHTML= ${SED} -e ${DATESUBST}
.endif
.if !defined(OPENJADE)
SGMLNORM= sgmlnorm
SGMLNORM= ${PREFIX}/bin/sgmlnorm
.else
SGMLNORM= osgmlnorm
SGMLNORM= ${PREFIX}/bin/osgmlnorm
.endif
PREFIX?= /usr/local
LOCALBASE?= /usr/local
PREFIX?= ${LOCALBASE}
CATALOG?= ${PREFIX}/share/sgml/html/catalog
SGMLNORMFLAGS= -d ${SGMLNORMOPTS} -c ${CATALOG} -D ${.CURDIR}
GENDOCS+= ${DOCS:M*.sgml:S/.sgml$/.html/g}
ORPHANS:= ${ORPHANS:N*.sgml}
.sgml.html:
(${PREHTML} ${PREHTMLFLAGS} ${.IMPSRC} |\
SGML_CATALOG_FILES='' ${SGMLNORM} ${SGMLNORMFLAGS} > ${.TARGET})\
|| (rm -f ${.TARGET} && false)
${PREHTML} ${PREHTMLFLAGS} ${.IMPSRC} | \
${SETENV} SGML_CATALOG_FILES= \
${SGMLNORM} ${SGMLNORMFLAGS} > ${.TARGET} || \
(${RM} -f ${.TARGET} && false)
.if !defined(NO_TIDY)
-${TIDY} ${TIDYFLAGS} ${.TARGET}
.endif
###
# file.docb --> file.html
#
# Generate HTML from docbook
SGMLFMT?= ${PREFIX}/bin/sgmlfmt
SGMLFMTFLAGS?= -d docbook -f html ${SGMLOPTS}
.SUFFIXES: .docb
GENDOCS+= ${DOCS:M*.docb:S/.docb$/.html/g}
ORPHANS:= ${ORPHANS:N*.docb}
.docb.html:
sgmlfmt -d docbook -f html ${SGMLOPTS} ${.IMPSRC}
${SGMLFMT} ${SGMLFMTFLAGS} ${.IMPSRC}
.if !defined(NO_TIDY)
-${TIDY} ${TIDYFLAGS} ${.TARGET}
.endif
##################################################################
@ -120,7 +148,7 @@ all: ${COOKIE} orphans ${GENDOCS} ${DATA} ${LOCAL} ${CGI} _PROGSUBDIR
#
.if !empty(ORPHANS)
orphans:
@echo Warning! I don\'t know what to do with: ${ORPHANS}
@${ECHO} Warning! I don\'t know what to do with: ${ORPHANS}
.else
orphans:
.endif
@ -132,10 +160,10 @@ orphans:
clean: _PROGSUBDIR
.if defined(DIRS_TO_CLEAN) && !empty(DIRS_TO_CLEAN)
.for dir in ${DIRS_TO_CLEAN}
(cd ${.CURDIR}/${dir} && ${MAKE} clean)
cd ${.CURDIR}/${dir}; ${MAKE} clean
.endfor
.endif
rm -f Errs errs mklog ${GENDOCS} ${LOCAL} ${CLEANFILES}
${RM} -f Errs errs mklog ${GENDOCS} ${LOCAL} ${CLEANFILES}
.endif
#
@ -143,8 +171,8 @@ clean: _PROGSUBDIR
#
.if !target(cleandir)
cleandir: clean _PROGSUBDIR
rm -f ${.CURDIR}/tags .depend
cd ${.CURDIR}; rm -rf obj;
${RM} -f ${.CURDIR}/tags .depend
cd ${.CURDIR}; ${RM} -rf obj
.endif
#
@ -158,30 +186,36 @@ beforeinstall:
afterinstall:
.endif
INSTALL_WEB?= \
${INSTALL} ${COPY} ${INSTALLFLAGS} -o ${WEBOWN} -g ${WEBGRP} -m ${WEBMODE}
INSTALL_CGI?= \
${INSTALL} ${COPY} ${INSTALLFLAGS} -o ${CGIOWN} -g ${CGIGRP} -m ${CGIMODE}
_ALLINSTALL+= ${GENDOCS} ${DATA} ${LOCAL}
realinstall: ${COOKIE} ${GENDOCS} ${DATA} ${LOCAL} ${CGI} _PROGSUBDIR
realinstall: ${COOKIE} ${_ALLINSTALL} ${CGI} _PROGSUBDIR
.if !empty(_ALLINSTALL)
@mkdir -p ${DOCINSTALLDIR}
for entry in ${_ALLINSTALL}; do \
${INSTALL} ${COPY} -o ${WEBOWN} -g ${WEBGRP} -m ${WEBMODE} \
${INSTALLFLAGS} $${entry} ${DOCINSTALLDIR}; \
done
@${MKDIR} -p ${DOCINSTALLDIR}
.for entry in ${_ALLINSTALL}
.if exists(${.CURDIR}/${entry})
${INSTALL_WEB} ${.CURDIR}/${entry} ${DOCINSTALLDIR}
.else
${INSTALL_WEB} ${entry} ${DOCINSTALLDIR}
.endif
.endfor
.if defined(INDEXLINK) && !empty(INDEXLINK)
(cd ${DOCINSTALLDIR}; ln -s -f ${INDEXLINK} index.html)
cd ${DOCINSTALLDIR}; ${LN} -fs ${INDEXLINK} index.html
.endif
.endif
.if defined(CGI) && !empty(CGI)
@mkdir -p ${CGIINSTALLDIR}
for entry in ${CGI}; do \
${INSTALL} ${COPY} -o ${CGIOWN} -g ${CGIGRP} -m ${CGIMODE} \
${INSTALLFLAGS} $${entry} ${CGIINSTALLDIR}; \
done
@${MKDIR} -p ${CGIINSTALLDIR}
.for entry in ${CGI}
${INSTALL_CGI} ${.CURDIR}/${entry} ${CGIINSTALLDIR}
.endfor
.endif
.if defined(DOCSUBDIR) && !empty(DOCSUBDIR)
for entry in ${DOCSUBDIR}; do \
mkdir -p ${DOCINSTALLDIR}/$$entry; \
done
.for entry in ${DOCSUBDIR}
@${MKDIR} -p ${DOCINSTALLDIR}/${entry}
.endfor
.endif
# Set up install dependencies so they happen in the correct order.
@ -197,26 +231,33 @@ realinstall2: realinstall
#SUBDIR+=${DOCSUBDIR}
_PROGSUBDIR: .USE
.if defined(SUBDIR) && !empty(SUBDIR)
@for entry in ${SUBDIR}; do \
(${ECHODIR} "===> ${DIRPRFX}$$entry"; \
cd ${.CURDIR}/$${entry} && \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} DIRPRFX=${DIRPRFX}$$entry/); \
done
.for entry in ${SUBDIR}
@${ECHODIR} "===> ${DIRPRFX}${entry}"
@cd ${.CURDIR}/${entry}; \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} \
DIRPRFX=${DIRPRFX}${entry}/
.endfor
.endif
.if defined(DOCSUBDIR) && !empty(DOCSUBDIR)
@for entry in ${DOCSUBDIR}; do \
(${ECHODIR} "===> ${DIRPRFX}$$entry"; \
cd ${.CURDIR}/$${entry} && \
if [ ${WEBDIR} = "data" -a $$entry = "handbook" -o $$entry = "docproj-primer" ]; then \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} DIRPRFX=${DIRPRFX}$$entry/ ${PARAMS} FORMATS="txt html html-split"; \
elif [ $$entry = "handbook" -a ${WEBDIR} = "data/ja" ]; then \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} DIRPRFX=${DIRPRFX}$$entry/ ${PARAMS} FORMATS="html html-split"; \
else \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} DIRPRFX=${DIRPRFX}$$entry/ ${PARAMS}; \
fi); \
done
.for entry in ${DOCSUBDIR}
@${ECHODIR} "===> ${DIRPRFX}${entry}"
.if (${WEBDIR} = "data" && ${entry} = "handbook") || ${entry} = "docproj-primer"
@cd ${.CURDIR}/${entry}; \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} \
DIRPRFX=${DIRPRFX}${entry}/ ${PARAMS} \
FORMATS="txt html html-split"
.elif ${WEBDIR} = "data/ja" && ${entry} = "handbook"
@cd ${.CURDIR}/${entry}; \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} \
DIRPRFX=${DIRPRFX}${entry}/ ${PARAMS} \
FORMATS="html html-split"
.else
@cd ${.CURDIR}/${entry}; \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} \
DIRPRFX=${DIRPRFX}${entry}/ ${PARAMS}
.endif
.endfor
.endif
#
# cruft for generating linuxdoc stuff
@ -233,4 +274,5 @@ PARAMS+= SGMLOPTS="${SGMLOPTS}"
.endif
.include <bsd.obj.mk>
# THE END