Date: Fri, 2 Nov 2001 06:40:03 -0800 (PST) From: Cyrille Lefevre <clefevre@citeweb.net> To: freebsd-doc@freebsd.org Subject: Re: docs/31703: TIDYFLAGS cann't work correctly Message-ID: <200111021440.fA2Ee3H66400@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/31703; it has been noted by GNATS.
From: Cyrille Lefevre <clefevre@citeweb.net>
To: Akio Morita <amorita@freebsd.org>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/31703: TIDYFLAGS cann't work correctly
Date: Fri, 2 Nov 2001 15:32:15 +0100 (CET)
Akio Morita wrote:
[snip]
> >Description:
> In comment of doc module, TIDYFLAGS is `Additional flags to pass to Tidy'.
> Before import of Cryrille's patch, action of TIDYFLAGS accorded its comment,
Cyrille ;^)
> and TIDYFLAGS is used in some language sub-directory.
> In old make template, tidy called by following style.
> tidy -i -m -f /dev/null ${TIDYFLAGS} `xargs < HTML.manifest`.
> -- list of Makefiles using TIDYFLAGS --
> % find /usr/doc -name Makefile\* -exec grep TIDYFLAGS /dev/null {} \;
> /usr/doc/ja_JP.eucJP/articles/Makefile.inc:TIDYFLAGS= -raw
> /usr/doc/ja_JP.eucJP/books/Makefile.inc:TIDYFLAGS= -raw
> /usr/doc/ru_RU.KOI8-R/books/Makefile.inc:TIDYFLAGS= -latin1
> /usr/doc/ru_RU.KOI8-R/articles/Makefile.inc:TIDYFLAGS= -latin1
> /usr/doc/zh_TW.Big5/books/faq/Makefile:TIDYFLAGS= -raw
> /usr/doc/de_DE.ISO8859-1/books/Makefile.inc:TIDYFLAGS= -latin1
> /usr/doc/nl_NL.ISO8859-1/books/Makefile.inc:TIDYFLAGS= -latin1
> /usr/doc/sr_YU.ISO8859-2/articles/Makefile.inc:TIDYFLAGS= -raw
> /usr/doc/sr_YU.ISO8859-2/books/Makefile.inc:TIDYFLAGS= -raw
> -- list of Makefiles using TIDYFLAGS --
>
> After import of Cryrille's patch, TIDYFLAGS defines at doc.docbook.mk
grrr, ditto.
> and doc.html.mk as following style.
> TIDYFLAGS?= -i -m -f /dev/null
>
> Therefore, in building html document using TIDYFLAGS,
> tidy option `-i -m -f /dev/null' is forgot.
> Thus TIDY outputs revised html doeucment to stdout
> and html documents on disk are not revised.
it is better to add the following line to doc.docbook.mk, etc.
TIDYOPTS= -i -m -f /dev/null ${TIDYFLAGS}
and to replace :
-${TIDY} ${TIDYFLAGS} $$(${XARGS} < HTML.manifest)
by
-${TIDY} ${TIDYOPTS} $$(${XARGS} < HTML.manifest)
to stay homogeneous w/ the rest of the Makefiles.
> >How-To-Repeat:
> Checkout doc module and build html document using TIDYFLAGS.
[snip]
> >Fix:
> Apply following patch.
NO, this one :P
all XXXFLAGS = YYY have been changed to XXXOPTS = YYY ${XXXFLAGS}
so, no ambiguity doesn't apply anymore.
also, missing XXXOPTS have been added for the same reason.
and to finish, doc.subdir.mk has been fixed to not include
../Makefile.inc twince (the second time occured through bsd.subdir.mk).
PS : .dvi.ps rule was missing DVIPSFLAGS (now DVIPSOPTS).
re-PS : I didn't made a full doc build because my machine is very
slow and will take many (many) hours before everything could be done.
Index: doc.docbook.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/doc.docbook.mk,v
retrieving revision 1.52
diff -u -r1.52 doc.docbook.mk
--- doc.docbook.mk 2001/10/29 09:21:53 1.52
+++ doc.docbook.mk 2001/11/02 14:09:55
@@ -174,14 +176,14 @@
TEX?= ${PREFIX}/bin/tex
PDFTEX?= ${PREFIX}/bin/pdftex
TIDY?= ${PREFIX}/bin/tidy
-TIDYFLAGS?= -i -m -f /dev/null
+TIDYOPTS?= -i -m -f /dev/null ${TYDYFLAGS}
HTML2TXT?= ${PREFIX}/bin/links
-HTML2TXTFLAGS?= -dump
+HTML2TXTOPTS?= -dump ${HTML2TXTFLAGS}
HTML2PDB?= ${PREFIX}/bin/iSiloBSD
-HTML2PDBFLAGS?= -y -d0 -Idef
+HTML2PDBOPTS?= -y -d0 -Idef ${HTML2PDBFLAGS}
DVIPS?= ${PREFIX}/bin/dvips
.if defined(PAPERSIZE)
-DVIPSFLAGS?= -t ${PAPERSIZE:L}
+DVIPSOPTS?= -t ${PAPERSIZE:L} ${DVIPSFLAGS}
.endif
GZIP?= -9
@@ -342,7 +344,7 @@
${JADE} -V html-manifest ${HTMLOPTS} -ioutput.html.images \
${JADEOPTS} -t sgml ${MASTERDOC}
.if !defined(NO_TIDY)
- -${TIDY} ${TIDYFLAGS} $$(${XARGS} < HTML.manifest)
+ -${TIDY} ${TIDYOPTS} $$(${XARGS} < HTML.manifest)
.endif
${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
@@ -351,7 +353,7 @@
${JADEOPTS} -t sgml ${MASTERDOC} > ${.TARGET} || \
(${RM} -f ${.TARGET} && false)
.if !defined(NO_TIDY)
- -${TIDY} ${TIDYFLAGS} ${.TARGET}
+ -${TIDY} ${TIDYOPTS} ${.TARGET}
.endif
# Special target to produce HTML with no images in it.
@@ -371,10 +373,10 @@
${LOCAL_IMAGES_LIB} ${IMAGES_PNG} ${CSS_SHEET:T}
${DOC}.txt: ${DOC}.html-text
- ${HTML2TXT} ${HTML2TXTFLAGS} ${.ALLSRC} > ${.TARGET}
+ ${HTML2TXT} ${HTML2TXTOPTS} ${.ALLSRC} > ${.TARGET}
${DOC}.pdb: ${DOC}.html ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
- ${HTML2PDB} ${HTML2PDBFLAGS} ${DOC}.html ${.TARGET}
+ ${HTML2PDB} ${HTML2PDBOPTS} ${DOC}.html ${.TARGET}
${.CURDIR:T}.pdb: ${DOC}.pdb
${LN} -f ${.ALLSRC} ${.TARGET}
@@ -426,7 +428,7 @@
${PDFTEX} "&pdfjadetex" '\nonstopmode\input{${DOC}.dvi}'
${DOC}.ps: ${DOC}.dvi
- ${DVIPS} -o ${.TARGET} ${.ALLSRC}
+ ${DVIPS} ${DVIPSOPTS} -o ${.TARGET} ${.ALLSRC}
${DOC}.tar: ${SRCS} ${LOCAL_IMAGES} ${LOCAL_CSS_SHEET}
${TAR} cf ${.TARGET} -C ${.CURDIR} ${SRCS} \
Index: doc.html.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/doc.html.mk,v
retrieving revision 1.9
diff -u -r1.9 doc.html.mk
--- doc.html.mk 2001/10/29 09:21:53 1.9
+++ doc.html.mk 2001/11/02 14:11:06
@@ -68,11 +68,11 @@
XARGS?= /usr/bin/xargs
TIDY?= ${PREFIX}/bin/tidy
-TIDYFLAGS?= -i -m -f /dev/null
+TIDYOPTS?= -i -m -f /dev/null ${TIDYFLAGS}
HTML2TXT?= ${PREFIX}/bin/links
-HTML2TXTFLAGS?= -dump
+HTML2TXTOPTS?= -dump ${HTML2TXTFLAGS}
HTML2PDB?= ${PREFIX}/bin/iSiloBSD
-HTML2PDBFLAGS?= -y -d0 -Idef
+HTML2PDBOPTS?= -y -d0 -Idef ${HTML2PDBFLAGS}
GZIP?= -9
GZIP_CMD?= gzip -qf ${GZIP}
@@ -150,14 +150,14 @@
${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET}
${SGMLNORM} -c ${HTMLCATALOG} ${SRCS:S|^|${.CURDIR}/|} > ${.TARGET}
.if !defined(NO_TIDY)
- -${TIDY} ${TIDYFLAGS} ${.TARGET}
+ -${TIDY} ${TIDYOPTS} ${.TARGET}
.endif
${DOC}.txt: ${DOC}.html
- ${HTML2TXT} ${HTML2TXTFLAGS} ${.ALLSRC} > ${.TARGET}
+ ${HTML2TXT} ${HTML2TXTOPTS} ${.ALLSRC} > ${.TARGET}
${DOC}.pdb: ${DOC}.html ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
- ${HTML2PDB} ${HTML2PDBFLAGS} ${DOC}.html ${.TARGET}
+ ${HTML2PDB} ${HTML2PDBOPTS} ${DOC}.html ${.TARGET}
${.CURDIR:T}.pdb: ${DOC}.pdb
${LN} -f ${.ALLSRC} ${.TARGET}
Index: doc.images.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/doc.images.mk,v
retrieving revision 1.12
diff -u -r1.12 doc.images.mk
--- doc.images.mk 2001/10/29 09:21:53 1.12
+++ doc.images.mk 2001/11/02 14:15:51
@@ -96,21 +96,25 @@
IMAGES_PDF=${IMAGES_GEN_PDF}
SCR2PNG?= ${PREFIX}/bin/scr2png
+SCR2PNGOPTS?= ${SCR2PNGFLAGS}
EPS2PNG?= ${PREFIX}/bin/peps
-EPS2PNGFLAGS?= -p -r ${EPS2PNG_RES}
+EPS2PNGOPTS?= -p -r ${EPS2PNG_RES} ${EPS2PNGFLAGS}
PNGTOPNM?= ${PREFIX}/bin/pngtopnm
+PNGTOPNMOPTS?= ${PNGTOPNMFLAGS}
PNMTOPS?= ${PREFIX}/bin/pnmtops
-PNMTOPSFLAGS?= -noturn
+PNMTOPSOPTS?= -noturn ${PNMTOPSFLAGS}
EPSTOPDF?= ${PREFIX}/bin/epstopdf
+EPSTOPDFOPTS?= ${EPSTOPDFFLAGS}
# Use suffix rules to convert .scr files to .png files
.SUFFIXES: .scr .png .eps
.scr.png:
- ${SCR2PNG} < ${.IMPSRC} > ${.TARGET}
+ ${SCR2PNG} ${SCR2PNGOPTS} < ${.IMPSRC} > ${.TARGET}
.scr.eps:
- ${SCR2PNG} < ${.ALLSRC} | ${PNGTOPNM} | \
- ${PNMTOPS} ${PNMTOPSFLAGS} > ${.TARGET}
+ ${SCR2PNG} ${SCR2PNGOPTS} < ${.ALLSRC} | \
+ ${PNGTOPNM} ${PNGTOPNMOPTS} | \
+ ${PNMTOPS} ${PNMTOPSOPTS} > ${.TARGET}
# We can't use suffix rules to generate the rules to convert EPS to PNG and
# PNG to EPS. This is because a .png file can depend on a .eps file, and
@@ -119,17 +123,19 @@
.for _curimage in ${IMAGES_GEN_PNG}
${_curimage}: ${_curimage:S/.png$/.eps/}
- ${EPS2PNG} ${EPS2PNGFLAGS} -o ${.TARGET} ${.ALLSRC}
+ ${EPS2PNG} ${EPS2PNGOPTS} -o ${.TARGET} ${.ALLSRC}
.endfor
.for _curimage in ${IMAGES_GEN_EPS}
${_curimage}: ${_curimage:S/.eps$/.png/}
- ${PNGTOPNM} ${.ALLSRC} | ${PNMTOPS} ${PNMTOPSFLAGS} > ${.TARGET}
+ ${PNGTOPNM} ${PNGTOPNMOPTS} ${.ALLSRC} | \
+ ${PNMTOPS} ${PNMTOPSOPTS} > ${.TARGET}
.endfor
.for _curimage in ${IMAGES_GEN_PDF}
${_curimage}: ${_curimage:S/.pdf$/.eps/}
- ${EPSTOPDF} --outfile=${.TARGET} ${.CURDIR}/${_curimage:S/.pdf$/.eps/}
+ ${EPSTOPDF} ${EPSTOPDFOPTS} --outfile=${.TARGET} \
+ ${.CURDIR}/${_curimage:S/.pdf$/.eps/}
.endfor
.if ${.OBJDIR} != ${.CURDIR}
Index: doc.subdir.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/doc.subdir.mk,v
retrieving revision 1.7
diff -u -r1.7 doc.subdir.mk
--- doc.subdir.mk 2001/10/29 09:21:53 1.7
+++ doc.subdir.mk 2001/11/02 13:53:03
@@ -47,8 +47,11 @@
# Remove the object directory, if any.
#
+.if !target(__initialized__)
+__initialized__:
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
+.endif
.endif
.if !target(install)
Cyrille.
--
Cyrille Lefevre mailto:clefevre@citeweb.net
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111021440.fA2Ee3H66400>
