NetBSD Problem Report #783

From gnats  Sat Feb  4 02:00:58 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id CAA03173 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sat, 4 Feb 1995 02:00:57 -0800
Message-Id: <199502040820.TAA22201@zen.void.oz.au>
Date: Sat, 4 Feb 1995 19:20:45 +1100
From: "Simon J. Gerraty" <sjg@zen.void.oz.au>
Reply-To: sjg@zen.void.oz.au
To: gnats-bugs@netbsd.org
Subject: bsd.subdir.mk intollerant of missing dirs
X-Send-Pr-Version: 3.2

>Number:         783
>Category:       misc
>Synopsis:       bsd.subdir.mk chokes if a SUBDIR is not present
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 04 02:05:04 +0000 1995
>Closed-Date:    Wed Jul 09 19:21:32 +0000 1997
>Last-Modified:  Wed Jul 09 19:23:06 +0000 1997
>Originator:     Simon J. Gerraty
>Release:        1.0
>Organization:
Zen Programming...
>Environment:

System: NetBSD zen.void.oz.au 1.0 NetBSD 1.0 (ZEN) #6: Tue Dec 13 09:55:20 EST 1994 root@zen.void.oz.au:/usr/src/sys/arch/i386/compile/ZEN i386


>Description:
	BSD make and the bsd.*.mk macros are great, but some simple
changes would  make them more useful for porjects other than building
the operating system.

For instance, bsd.subdir.mk should (optionally?) not get upset if a
directory mentioned in SUBDIR does not exists.

The patch below modifies bsd.subdir.mk to support the current behavior
(if SUBDIR_MUST_EXIST is defined) or to simply mention that the dir is
missing.  Eg:

sjg:4930$ make obj 
Missing: libcompat skipped.
===> libskey

>How-To-Repeat:

>Fix:
*** bsd.subdir.mk.old	Sat Feb  4 19:17:15 1995
--- bsd.subdir.mk	Sat Feb  4 19:16:11 1995
***************
*** 5,19 ****
  .MAIN: all
  .endif

  _SUBDIRUSE: .USE
  .if defined(SUBDIR)
  	@for entry in ${SUBDIR}; do \
  		(set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
  			echo "===> $${entry}.${MACHINE}"; \
  			cd ${.CURDIR}/$${entry}.${MACHINE}; \
! 		else \
  			echo "===> $$entry"; \
  			cd ${.CURDIR}/$${entry}; \
  		fi; \
  		${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \
  	done
--- 5,27 ----
  .MAIN: all
  .endif

+ .ifdef SUBDIR_MUST_EXIST
+ MISSING_SUBDIR= 
+ .else
+ MISSING_SUBDIR= skipped.; continue
+ .endif
+ 
  _SUBDIRUSE: .USE
  .if defined(SUBDIR)
  	@for entry in ${SUBDIR}; do \
  		(set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
  			echo "===> $${entry}.${MACHINE}"; \
  			cd ${.CURDIR}/$${entry}.${MACHINE}; \
! 		elif test -d ${.CURDIR}/$${entry}; then \
  			echo "===> $$entry"; \
  			cd ${.CURDIR}/$${entry}; \
+ 		else \
+ 			echo "Missing: $$entry" $(MISSING_SUBDIR); \
  		fi; \
  		${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \
  	done

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phil 
State-Changed-When: Wed Jul 9 12:21:32 PDT 1997 
State-Changed-Why:  
Similar change has made to bsd.subdir.mk. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.