Subject: bin/5206: no (good) way to make includes without installing them.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cgd@NetBSD.ORG>
List: netbsd-bugs
Date: 03/25/1998 22:33:24
>Number:         5206
>Category:       bin
>Synopsis:       no (good) way to make includes without installing them.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 25 22:35:02 1998
>Last-Modified:
>Originator:     Chris G. Demetriou
>Organization:
Kernel Hackers 'r' Us
>Release:        NetBSD-current as of Wed Mar 25 20:33:24 PST 1998
>Environment:
System: NetBSD brick.int.demetriou.com 1.3E NetBSD 1.3E (BRICK) #47: Sun Mar 22 15:13:37 PST 1998 cgd@brick.int.demetriou.com:/usr/src/sys/arch/i386/compile/BRICK i386


>Description:
	There's no good way to build include files without also trying
	to install them.

	'make includes' tries to both make and install them.  This is
	annoying if you can't do both as root (e.g. source tree under
	your home dir, which is on an NFS mount which was exported with
	root mapped to nobody).

	make -k includes can be used to build include files in this
	situation, but that's highly bogus.

>How-To-Repeat:
	Put a clean source tree in an NFS-mounted directory that was
	exported with root mapped to nobody.

	Try to make and install include files from that source tree.
	Note that when 'make includes' gets to a directory where include
	files need to be built, the make croaks.

	Try to build the include files without installing them, and note
	that there's no make target that'll let you do that.

>Fix:
	Below is a sample diff which adds a 'makeincludes' target
	which just makes include files.

	It works, but I think it's not a particularly good
	solution.  'make includes' should (only) make include files,
	and there should be a new target (maybe "installincludes")
	which is responsible for installing them.

Index: share/mk/bsd.doc.mk
===================================================================
RCS file: /src/kona.cvs/netbsd/share/mk/bsd.doc.mk,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 bsd.doc.mk
*** 1.1.1.2	1997/12/22 22:13:17
--- bsd.doc.mk	1998/01/13 00:28:31
***************
*** 67,70 ****
  spell: ${SRCS}
  	spell ${SRCS} | sort | comm -23 - spell.ok > paper.spell
  
! depend includes lint obj tags:
--- 67,70 ----
  spell: ${SRCS}
  	spell ${SRCS} | sort | comm -23 - spell.ok > paper.spell
  
! depend includes lint makeincludes obj tags:
Index: share/mk/bsd.inc.mk
===================================================================
RCS file: /src/kona.cvs/netbsd/share/mk/bsd.inc.mk,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 bsd.inc.mk
*** 1.1.1.1	1997/12/22 22:13:18
--- bsd.inc.mk	1998/01/13 00:10:59
***************
*** 1,7 ****
  #	$NetBSD: bsd.inc.mk,v 1.10 1997/06/03 16:00:30 cgd Exp $
  
  .PHONY:		incinstall
! includes:	${INCS} incinstall
  
  .if defined(INCS)
  .for I in ${INCS}
--- 1,8 ----
  #	$NetBSD: bsd.inc.mk,v 1.10 1997/06/03 16:00:30 cgd Exp $
  
  .PHONY:		incinstall
! makeincludes:	${INCS}
! includes:	incinstall
  
  .if defined(INCS)
  .for I in ${INCS}
Index: share/mk/bsd.man.mk
===================================================================
RCS file: /src/kona.cvs/netbsd/share/mk/bsd.man.mk,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 bsd.man.mk
*** 1.1.1.2	1997/12/22 22:13:19
--- bsd.man.mk	1998/01/13 00:27:44
***************
*** 150,153 ****
  .endif
  
  # Make sure all of the standard targets are defined, even if they do nothing.
! clean depend includes lint regress tags:
--- 150,153 ----
  .endif
  
  # Make sure all of the standard targets are defined, even if they do nothing.
! clean depend includes lint makeincludes regress tags:
Index: share/mk/bsd.own.mk
===================================================================
RCS file: /src/kona.cvs/netbsd/share/mk/bsd.own.mk,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 bsd.own.mk
*** 1.1.1.2	1997/12/22 22:13:21
--- bsd.own.mk	1998/01/13 00:13:18
***************
*** 82,92 ****
  NOPROFILE=
  .endif
  
! TARGETS+=	all clean cleandir depend includes install lint obj regress \
! 		tags
! .PHONY:		all clean cleandir depend includes install lint obj regress \
! 		tags beforedepend afterdepend beforeinstall afterinstall \
! 		realinstall
  
  .if !target(install)
  install:	.NOTMAIN beforeinstall subdir-install realinstall afterinstall
--- 82,92 ----
  NOPROFILE=
  .endif
  
! TARGETS+=	all clean cleandir depend includes install lint makeincludes \
! 		obj regress tags
! .PHONY:		all clean cleandir depend includes install lint makeincludes \
! 		obj regress tags beforedepend afterdepend beforeinstall \
! 		afterinstall realinstall
  
  .if !target(install)
  install:	.NOTMAIN beforeinstall subdir-install realinstall afterinstall
>Audit-Trail:
>Unformatted: