Restyle web.site.mk a bit:

. Move variable declarations from suffix transformation declaration area
  to appropriate place
. Move spellcheck target to place where it belongs
. Fix/add some comments
This commit is contained in:
Alexey Zelkin 2004-04-05 14:19:17 +00:00
parent 6c971ff09d
commit 1150235fc0
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=20517

View file

@ -1,5 +1,5 @@
# bsd.web.mk # bsd.web.mk
# $FreeBSD: www/share/mk/web.site.mk,v 1.52 2004/02/01 22:56:56 ale Exp $ # $FreeBSD$
# #
# Build and install a web site. # Build and install a web site.
@ -7,7 +7,7 @@
# Basic targets: # Basic targets:
# #
# all (default) -- performs batch mode processing necessary # all (default) -- performs batch mode processing necessary
# install -- Installs everything # install -- installs everything
# clean -- remove anything generated by processing # clean -- remove anything generated by processing
# #
@ -40,16 +40,29 @@ SED?= /usr/bin/sed
SH?= /bin/sh SH?= /bin/sh
SORT?= /usr/bin/sort SORT?= /usr/bin/sort
TOUCH?= /usr/bin/touch TOUCH?= /usr/bin/touch
LOCALBASE?= /usr/local
PREFIX?= ${LOCALBASE}
.if !defined(OPENJADE)
SGMLNORM?= ${PREFIX}/bin/sgmlnorm
.else
SGMLNORM?= ${PREFIX}/bin/osgmlnorm
.endif
CATALOG?= ${PREFIX}/share/sgml/html/catalog
SGMLNORMOPTS?= -d ${SGMLNORMFLAGS} -c ${CATALOG} -D ${.CURDIR}
XSLTPROC?= ${PREFIX}/bin/xsltproc
XSLTPROCOPTS?= ${XSLTPROCFLAGS}
TIDY?= ${PREFIX}/bin/tidy
TIDYOPTS?= -i -m -raw -preserve -f /dev/null -asxml ${TIDYFLAGS}
HTML2TXT?= ${PREFIX}/bin/w3m HTML2TXT?= ${PREFIX}/bin/w3m
HTML2TXTOPTS?= -dump ${HTML2TXTFLAGS} HTML2TXTOPTS?= -dump ${HTML2TXTFLAGS}
ISPELL?= ispell ISPELL?= ispell
ISPELLOPTS?= -l -p /usr/share/dict/freebsd ${ISPELLFLAGS} ISPELLOPTS?= -l -p /usr/share/dict/freebsd ${ISPELLFLAGS}
XSLTPROC?= ${PREFIX}/bin/xsltproc
XSLTPROCOPTS?= ${XSLTPROCFLAGS}
TIDY?= ${PREFIX}/bin/tidy
TIDYOPTS?= -i -m -raw -preserve -f /dev/null -asxml ${TIDYFLAGS}
# #
# Install dirs derived from the above. # Install dirs derived from the above.
# #
@ -60,10 +73,14 @@ CGIINSTALLDIR= ${DESTDIR}${WEBBASE}/${CGIDIR}
# The orphan list contains sources specified in DOCS that there # The orphan list contains sources specified in DOCS that there
# is no transform rule for. We start out with all of them, and # is no transform rule for. We start out with all of them, and
# each rule below removes the ones it knows about. If any are # each rule below removes the ones it knows about. If any are
# left over at the end, the user is warned about them. # left over at the end, the user is warned about them and build
# breaks.
# #
ORPHANS:= ${DOCS} ORPHANS:= ${DOCS}
#
# Tell install(1) to always copy file being installed.
#
COPY= -C COPY= -C
# #
@ -72,8 +89,8 @@ COPY= -C
PORTSBASE?= /usr PORTSBASE?= /usr
# #
# Instruction for bsd.subdir.mk to not to process SUBDIR directive. # Instruct bsd.subdir.mk to NOT to process SUBDIR directive. It is not
# It is not neccessary since web.site.mk do it too. # neccessary since web.site.mk do it using own rules.
# #
NO_SUBDIR= YES NO_SUBDIR= YES
@ -149,24 +166,10 @@ PREHTMLOPTS?= -revcheck "${LOCALTOP}" "${DIR_IN_LOCAL}" ${PREHTMLFLAGS}
DATESUBST?= 's/<!ENTITY date[ \t]*"$$Free[B]SD. .* \(.* .*\) .* .* $$">/<!ENTITY date "Last modified: \1">/' DATESUBST?= 's/<!ENTITY date[ \t]*"$$Free[B]SD. .* \(.* .*\) .* .* $$">/<!ENTITY date "Last modified: \1">/'
PREHTML?= ${SED} -e ${DATESUBST} PREHTML?= ${SED} -e ${DATESUBST}
.endif .endif
.if !defined(OPENJADE)
SGMLNORM?= ${PREFIX}/bin/sgmlnorm
.else
SGMLNORM?= ${PREFIX}/bin/osgmlnorm
.endif
LOCALBASE?= /usr/local
PREFIX?= ${LOCALBASE}
CATALOG?= ${PREFIX}/share/sgml/html/catalog
SGMLNORMOPTS?= -d ${SGMLNORMFLAGS} -c ${CATALOG} -D ${.CURDIR}
GENDOCS+= ${DOCS:M*.sgml:S/.sgml$/.html/g} GENDOCS+= ${DOCS:M*.sgml:S/.sgml$/.html/g}
ORPHANS:= ${ORPHANS:N*.sgml} ORPHANS:= ${ORPHANS:N*.sgml}
spellcheck:
.for _entry in ${GENDOCS}
@echo "Spellcheck ${_entry}"
@${HTML2TXT} ${HTML2TXTOPTS} ${.CURDIR}/${_entry} | ${ISPELL} ${ISPELLOPTS}
.endfor
.sgml.html: ${SGML_INCLUDES} .sgml.html: ${SGML_INCLUDES}
${PREHTML} ${PREHTMLOPTS} ${.IMPSRC} | \ ${PREHTML} ${PREHTMLOPTS} ${.IMPSRC} | \
${SETENV} SGML_CATALOG_FILES= \ ${SETENV} SGML_CATALOG_FILES= \
@ -178,20 +181,32 @@ spellcheck:
################################################################## ##################################################################
# Targets # Special Targets
# #
# If no target is specified, .MAIN is made # Spellcheck all generated documents in the current directory.
#
spellcheck:
.for _entry in ${GENDOCS}
@echo "Spellcheck ${_entry}"
@${HTML2TXT} ${HTML2TXTOPTS} ${.CURDIR}/${_entry} | ${ISPELL} ${ISPELLOPTS}
.endfor
##################################################################
# Main Targets
#
# If no target is specified, .MAIN is made.
# #
.MAIN: all .MAIN: all
# #
# Build most everything # Build most everything.
# #
all: ${COOKIE} orphans ${GENDOCS} ${DATA} ${CGI} _PROGSUBDIR all: ${COOKIE} orphans ${GENDOCS} ${DATA} ${CGI} _PROGSUBDIR
# #
# Warn about anything in DOCS that has no suffix translation rule # Warn about anything in DOCS that has no suffix translation rule.
# #
.if !empty(ORPHANS) .if !empty(ORPHANS)
orphans: orphans:
@ -202,7 +217,7 @@ orphans:
.endif .endif
# #
# Clean things up # Clean things up.
# #
.if !target(clean) .if !target(clean)
clean: _PROGSUBDIR clean: _PROGSUBDIR
@ -210,7 +225,7 @@ clean: _PROGSUBDIR
.endif .endif
# #
# Really clean things up # Really clean things up.
# #
.if !target(cleandir) .if !target(cleandir)
cleandir: clean _PROGSUBDIR cleandir: clean _PROGSUBDIR
@ -233,9 +248,11 @@ afterinstall:
.endif .endif
INSTALL_WEB?= \ INSTALL_WEB?= \
${INSTALL} ${COPY} ${INSTALLFLAGS} -o ${WEBOWN} -g ${WEBGRP} -m ${WEBMODE} ${INSTALL} ${COPY} ${INSTALLFLAGS} \
-o ${WEBOWN} -g ${WEBGRP} -m ${WEBMODE}
INSTALL_CGI?= \ INSTALL_CGI?= \
${INSTALL} ${COPY} ${INSTALLFLAGS} -o ${CGIOWN} -g ${CGIGRP} -m ${CGIMODE} ${INSTALL} ${COPY} ${INSTALLFLAGS} \
-o ${CGIOWN} -g ${CGIGRP} -m ${CGIMODE}
_ALLINSTALL+= ${GENDOCS} ${DATA} _ALLINSTALL+= ${GENDOCS} ${DATA}
realinstall: ${COOKIE} ${_ALLINSTALL} ${CGI} _PROGSUBDIR realinstall: ${COOKIE} ${_ALLINSTALL} ${CGI} _PROGSUBDIR