From pst@jnx.com  Sun Feb 16 12:46:28 1997
Received: from red.jnx.com (red.jnx.com [208.197.169.254])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA25998
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 16 Feb 1997 12:46:27 -0800 (PST)
Received: from base.jnx.com (base.jnx.com [208.197.169.238]) by red.jnx.com (8.8.5/8.8.3) with ESMTP id MAA21194 for <FreeBSD-gnats-submit@freebsd.org>; Sun, 16 Feb 1997 12:45:47 -0800 (PST)
Received: (from pst@localhost) by base.jnx.com (8.7.6/8.7.3) id MAA25327; Sun, 16 Feb 1997 12:45:39 -0800 (PST)
Message-Id: <199702162045.MAA25327@base.jnx.com>
Date: Sun, 16 Feb 1997 12:45:39 -0800 (PST)
From: Paul Traina <pst@jnx.com>
Reply-To: pst@jnx.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: NOOBJ conflict in bsd.prog.mk and bsd.obj.mk
X-Send-Pr-Version: 3.2

>Number:         2748
>Category:       bin
>Synopsis:       NOOBJ conflict in bsd.prog.mk and bsd.obj.mk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bde
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 16 12:50:01 PST 1997
>Closed-Date:    Sun Feb 16 23:52:59 PST 1997
>Last-Modified:  Sun Feb 16 23:53:44 PST 1997
>Originator:     Paul Traina
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Juniper Networks
>Environment:

2.2 -CURRENT

>Description:

Setting NOOBJ is used to tell bsd.obj.mk to not screw with object directories.

Setting NOOBJ is used to tell bsd.org.mk to not automaticly create OBJS=
lines from the SRCS= lines.

If you try to disable the warning for object directories using NOOBJ, you
cannot build a program.  This makes the 4bsd makefiles either spew garbage
warnings or bitch.

>How-To-Repeat:

cd /usr/src/bin/cat
make NOOBJ=yes

>Fix:

--- bsd.obj.mk	Mon Oct 21 18:31:37 1996
+++ /tmp/abc	Sun Feb 16 12:46:51 1997
@@ -22,7 +22,7 @@
 #
 #		E.g. use `env MAKEOBJDIRPREFIX=/somewhere/obj make'
 #
-# NOOBJ		Do not create object directories.  This should not be set
+# NOOBJDIR	Do not create object directories.  This should not be set
 #		if anything is built.
 #
 # OBJLINK	Create a symbolic link from ${.CURDIR}/obj to
@@ -47,11 +47,15 @@
 CANONICALOBJDIR:=/usr/obj${.CURDIR}
 .endif
 
+.if defined(NOOBJ)
+NOOBJDIR=${NOOBJ}
+.endif
+
 #
 # Warn of unorthodox object directory
 #
 objwarn:
-.if !defined(NOOBJ) && ${.OBJDIR} != ${CANONICALOBJDIR}
+.if !defined(NOOBJDIR) && ${.OBJDIR} != ${CANONICALOBJDIR}
 .if ${.OBJDIR} == ${.CURDIR}
 	@${ECHO} "Warning: Object directory not changed from original ${.CURDIR}"
 .elif !defined(MAKEOBJDIR) && !defined(MAKEOBJDIRPREFIX) && !defined(OBJLINK)
@@ -61,7 +65,7 @@
 .endif
 
 .if !target(obj)
-.if defined(NOOBJ)
+.if defined(NOOBJDIR)
 obj:
 .else
 .if !defined(OBJLINK)

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bde 
Responsible-Changed-By: jkh 
Responsible-Changed-When: Sun Feb 16 15:01:23 PST 1997 
Responsible-Changed-Why:  
Invoking the ancient law of HTIL (He Touched It Last), I hereby 
assign this bug to Bruce! :-) * 

* Well, I actually touched it last from CVS's point of view, but that 
was a spam so it magically doesn't count. :-) 

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@freebsd.org, pst@jnx.com
Cc:  Subject: Re: bin/2748: NOOBJ conflict in bsd.prog.mk and bsd.obj.mk
Date: Mon, 17 Feb 1997 14:05:09 +1100

 >Setting NOOBJ is used to tell bsd.obj.mk to not screw with object directories.
 
 >Setting NOOBJ is used to tell bsd.org.mk to not automaticly create OBJS=
                                    prg
 >lines from the SRCS= lines.
 
 This is a bug.  It was broken in rev.1.18-rev.1.19.  rev.1.18 added a
 NOOBJS ifdef and rev.1.19 got confused this with NOOBJ.  If an ifdef
 like the NOOBJS one is needed at all, then it probably should just
 test of ${OBJ} is undefined or empty.
 
 >>Fix:
 >
 >Change NOOBJ to NOOBJDIR everywhere it occurs in bsd.obj.mk.
 >	
 >sed -s 's/NOOBJ/NOOBJDIR/g' /usr/src/share/mk/bsd.obj.mk >\
 >			    /usr/src/share/mk/bsd.obj.mk
 
 No, it means "don't build obj directories" there, and it is used
 in hundreds of scattered makefiles.  It shouldn't work to prevent
 warnings about unusual obj directories :-).  There should be a
 different warning if NOOBJ is set but an obj dir exists (even
 if it is /usr/obj`pwd`).
 
 Bruce

From: Paul Traina <pst@jnx.com>
To: Bruce Evans <bde@zeta.org.au>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/2748: NOOBJ conflict in bsd.prog.mk and bsd.obj.mk 
Date: Sun, 16 Feb 1997 19:11:43 -0800

 Agreed 100%.  I changed the bug report, but it didn't mail it out to
 the list.  I suggested a NOOBJDIR= variable for bsd.obj.mk that would
 automagicly be set to NOOBJ if noobj was present for backwards
 compatibility.  If you're happy with the diffs attached to the bug,
 please commit, or let me know and I'll be happy to commit.
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Sun Feb 16 23:52:59 PST 1997 
State-Changed-Why:  
Fixed in rev.1.43 of bsd.prog.mk. 
>Unformatted:
