From simon@arthur.nitro.dk  Wed May 21 13:41:19 2003
Return-Path: <simon@arthur.nitro.dk>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2AF8F37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 May 2003 13:41:19 -0700 (PDT)
Received: from arthur.nitro.dk (port324.ds1-khk.adsl.cybercity.dk [212.242.113.79])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7007B43F85
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 May 2003 13:41:18 -0700 (PDT)
	(envelope-from simon@arthur.nitro.dk)
Received: by arthur.nitro.dk (Postfix, from userid 1000)
	id 34CAA10BF81; Wed, 21 May 2003 22:41:17 +0200 (CEST)
Message-Id: <20030521204117.34CAA10BF81@arthur.nitro.dk>
Date: Wed, 21 May 2003 22:41:17 +0200 (CEST)
From: Simon L.Nielsen <simon@nitro.dk>
Reply-To: Simon L.Nielsen <simon@nitro.dk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] Fix to stop make warnings when building docs on FreeBSD 5.X
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52540
>Category:       docs
>Synopsis:       [patch] Fix to stop make warnings when building docs on FreeBSD 5.X
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    trhodes
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 21 13:50:16 PDT 2003
>Closed-Date:    Wed May 21 14:23:58 PDT 2003
>Last-Modified:  Wed May 21 14:23:58 PDT 2003
>Originator:     Simon L. Nielsen
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
>Description:
I finally got tired of the all the warnings about duplicate script
targets when build the documentation on FreeBSD 5.X... so here is a
patch to fix them.

I don't think it should break anything since make(1) has previously
just ignored the double targets, but I would recommend to test the
patch prior to commit anyway...

I'm still not really sure why install-${_curformat}.${_compressext} is
being defined twice, but it is...

Note: bsd.obj.mk already includes bsd.subdir.mk so there is no need
to include it twice.

Tested on: FreeBSD 4.8-STABLE and 5.1-BETA.
>How-To-Repeat:
>Fix:
--- doc-build-no-5x-whine.patch begins here ---
Index: doc.docbook.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/doc.docbook.mk,v
retrieving revision 1.86
diff -u -d -r1.86 doc.docbook.mk
--- doc.docbook.mk	21 May 2003 11:23:45 -0000	1.86
+++ doc.docbook.mk	21 May 2003 22:12:53 -0000
@@ -512,12 +512,14 @@
 ${DOC}.tex-ps: ${DOC}.tex
 	${LN} -f ${.ALLSRC} ${.TARGET}
 
+.if !target(${DOC}.tex-pdf)
 ${DOC}.tex-pdf: ${SRCS} ${IMAGES_PDF} ${INDEX_SGML} ${PRINT_INDEX} \
 		${LOCAL_IMAGES_TXT}
 	${RM} -f ${.TARGET}
 	${CAT} ${PDFTEX_DEF} > ${.TARGET}
 	${JADE} -V tex-backend ${PRINTOPTS} -ioutput.print.pdf \
 		${JADEOPTS} -t tex -o /dev/stdout ${MASTERDOC} >> ${.TARGET}
+.endif
 
 ${DOC}.dvi: ${DOC}.tex ${LOCAL_IMAGES_EPS}
 .for _curimage in ${LOCAL_IMAGES_EPS:M*share*}
@@ -530,6 +532,7 @@
 	@${ECHO} "==> TeX pass 3/3"
 	-${TEX} "&jadetex" '${TEXCMDS} \nonstopmode\input{${DOC}.tex}'
 
+.if !target(${DOC}.pdf)
 ${DOC}.pdf: ${DOC}.tex-pdf ${IMAGES_PDF}
 .for _curimage in ${IMAGES_PDF:M*share*}
 	${CP} -p ${_curimage} ${.CURDIR:H:H}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR}||}
@@ -540,6 +543,7 @@
 	-${PDFTEX} "&pdfjadetex" '${TEXCMDS} \nonstopmode\input{${DOC}.tex-pdf}'
 	@${ECHO} "==> PDFTeX pass 3/3"
 	${PDFTEX} "&pdfjadetex" '${TEXCMDS} \nonstopmode\input{${DOC}.tex-pdf}'
+.endif
 
 ${DOC}.ps: ${DOC}.dvi
 	${DVIPS} ${DVIPSOPTS} -o ${.TARGET} ${.ALLSRC}
@@ -794,12 +798,14 @@
 .endfor
 .else
 .for _compressext in ${KNOWN_COMPRESS}
+.if !target(install-${_curformat}.${_compressext})
 install-${_curformat}.${_compressext}: ${DOC}.${_curformat}.${_compressext}
 	@[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR}
 	${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
 .if ${_cf} == "pdb"
 	${LN} -f ${DESTDIR}/${.ALLSRC} \
 		 ${DESTDIR}/${.CURDIR:T}.${_curformat}.${_compressext}
+.endif
 .endif
 .endfor
 .endif
Index: doc.subdir.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/doc.subdir.mk,v
retrieving revision 1.9
diff -u -d -r1.9 doc.subdir.mk
--- doc.subdir.mk	13 Dec 2001 23:51:26 -0000	1.9
+++ doc.subdir.mk	21 May 2003 19:52:22 -0000
@@ -121,7 +121,6 @@
 .if !defined(NOINCLUDEMK)
 
 .include <bsd.obj.mk>
-.include <bsd.subdir.mk>
 
 .else
 
--- doc-build-no-5x-whine.patch ends here ---


>Release-Note:
>Audit-Trail:

From: Tom Rhodes <trhodes@FreeBSD.org>
To: "Simon L.Nielsen" <simon@nitro.dk>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: docs/52540: [patch] Fix to stop make warnings when building
 docs on FreeBSD 5.X
Date: Wed, 21 May 2003 16:46:03 -0400

 On Wed, 21 May 2003 22:41:17 +0200 (CEST)
 "Simon L.Nielsen" <simon@nitro.dk> wrote:
 
 > I finally got tired of the all the warnings about duplicate script
 > targets when build the documentation on FreeBSD 5.X... so here is a
 > patch to fix them.
 > 
 > I don't think it should break anything since make(1) has previously
 > just ignored the double targets, but I would recommend to test the
 > patch prior to commit anyway...
 > 
 > I'm still not really sure why install-${_curformat}.${_compressext} is
 > being defined twice, but it is...
 > 
 > Note: bsd.obj.mk already includes bsd.subdir.mk so there is no need
 > to include it twice.
 > 
 
 This seems to work.  I'm doing a few more tests before it gets
 committed.
 
 --
 Tom Rhodes
State-Changed-From-To: open->closed 
State-Changed-By: trhodes 
State-Changed-When: Wed May 21 14:23:29 PDT 2003 
State-Changed-Why:  
Committed thanks! 


Responsible-Changed-From-To: freebsd-doc->trhodes 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Wed May 21 14:23:29 PDT 2003 
Responsible-Changed-Why:  
Over to me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52540 
>Unformatted:
