Subject: lib/6812: libcurses documentation build causes files to be created in the source directory
To: None <gnats-bugs@gnats.netbsd.org>
From: None <woods@proven.weird.com>
List: netbsd-bugs
Date: 01/14/1999 22:08:26
>Number:         6812
>Category:       lib
>Synopsis:       libcurses documentation build causes files to be created in the source directory
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 14 19:20:00 1999
>Last-Modified:
>Originator:     Greg A. Woods
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Release:        NetBSD-1.3I sup Thu Jan 14 08:09:47 EST 1999
>Environment:

>Description:

	The libcurses/PSD.doc/Makefile causes files to be created in the
	source directory during normal builds using BSDOBJDIR and DESTDIR.

	Upon examination I found that the libcurses/PSD.doc Makefile
	wasn't using appropriate or correct dependencies either.

	I noticed this first with my 1.3.3 re-build, but as nothing
	related has changed since, this same problem will aplly to
	-current.

>How-To-Repeat:

	Do a "make DESTDIR=/some/non-root/directory build" in a virgin
	source tree with settings similar to the following in
	/etc/mk.conf:

		BSDSRCDIR=      /usr/src
		BSDOBJDIR=      /var/obj
		OBJMACHINE=     yes
		USR_OBJMACHINE= yes

	To make things painfully obvious do so with /usr/src mounted
	read-only.

	Strictly speaking these settings are irrlevant, as is even I
	believe the DESTDIR setting, but they are typical of situations
	where /usr/src might be mounted read-only.

>Fix:

	It might be more appropriate to get rid of the use of ".so", but
	for the moment the following change fixes the immediate problem.

Index: lib/libcurses/PSD.doc/Makefile
===================================================================
RCS file: /cvs/NetBSD/src/lib/libcurses/PSD.doc/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- lib/libcurses/PSD.doc/Makefile	1998/02/20 00:32:27	1.1.1.1
+++ lib/libcurses/PSD.doc/Makefile	1999/01/14 23:09:12
@@ -4,13 +4,14 @@
 DIR=	psd/19.curses
 SRCS=	Master
 MACROS=	-me
-EXTRA=	appen.A appen.B appen.C c_macros doc.I doc.II doc.III \
-	doc.IV ex1.c ex2.c fns.doc intro.0 intro.1 intro.2 intro.3 \
-	intro.4 intro.5 intro.6 life.c macros twinkle1.c twinkle2.c \
-	win_st.c
+OTHER=	appen.A appen.B appen.C doc.I doc.II doc.III doc.IV fns.doc \
+	intro.0 intro.1 intro.3 intro.4 intro.5 intro.6 \
+	macros c_macros
+CEXAMPLES= ex1.gr ex2.gr life.gr twinkle1.gr twinkle2.gr win_st.gr
+TBLFILES=  intro.2.tbl
+EXTRA=	${OTHER} ${CEXAMPLES:R:S/$/.c/g} ${TBLFILES:R}
 
-CLEANFILES+=win_st.gr twinkle1.gr twinkle2.gr life.gr intro.2.tbl appen.A.tbl \
-	ex1.gr ex2.gr
+CLEANFILES+= ${CEXAMPLES} ${TBLFILES}
 
 .SUFFIXES:
 .SUFFIXES: .c .gr
@@ -26,13 +27,11 @@
 .c.gr:
 	${VFONT} ${.IMPSRC} | grep -v "^'wh" > ${.TARGET}
 
-paper.ps: ${SRCS}
+paper.ps: ${SRCS} ${OTEHR} ${CEXAMPLES} ${TBLFILES}
 	${SOELIM} -I${.CURDIR} ${.ALLSRC} | ${ROFF} > ${.TARGET}
 
-Master: twinkle1.gr ex1.gr ex2.gr fns.doc intro.5 intro.2.tbl intro.0 intro.1 \
-	intro.3 intro.4 intro.6 macros c_macros
-
+# Unfortunately our make doesn't handle single-suffix rules.
 intro.2.tbl: intro.2
-	${TBL} ${.ALLSRC} > intro.2.tbl
+	${TBL} ${.ALLSRC} > ${.TARGET}
 
 .include <bsd.doc.mk>
>Audit-Trail:
>Unformatted: