From 2b1f35a9afacf9c3c324b99bdbb836be153fc41f Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Sun, 20 May 2001 12:14:17 +0000 Subject: [PATCH] Fixed `objwarn' so that it doesn't issue spurious warnings, especially now that ${.OBJDIR} is canonicalized by make(1). Urged by: bde Reviewed by: bde --- share/mk/bsd.obj.mk | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk index 920d2005a61..bb3afe6bc16 100644 --- a/share/mk/bsd.obj.mk +++ b/share/mk/bsd.obj.mk @@ -50,13 +50,28 @@ CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif # -# Warn of unorthodox object directory +# Warn of unorthodox object directory. +# +# The following directories are tried in order for ${.OBJDIR}: +# +# 1. ${MAKEOBJDIRPREFIX}/`pwd` +# 2. ${MAKEOBJDIR} +# 3. obj.${MACHINE} +# 4. obj +# 5. /usr/obj/`pwd` +# 6. ${.CURDIR} +# +# If ${.OBJDIR} is constructed using canonical cases 1 or 5, or +# case 2 (using MAKEOBJDIR), don't issue a warning. Otherwise, +# issue a warning differentiating between cases 6 and (3 or 4). # objwarn: -.if !defined(NOOBJ) && ${.OBJDIR} != ${CANONICALOBJDIR} +.if !defined(NOOBJ) && ${.OBJDIR} != ${CANONICALOBJDIR} && \ + !(defined(MAKEOBJDIRPREFIX) && exists(${CANONICALOBJDIR}/)) && \ + !(defined(MAKEOBJDIR) && exists(${MAKEOBJDIR}/)) .if ${.OBJDIR} == ${.CURDIR} @${ECHO} "Warning: Object directory not changed from original ${.CURDIR}" -.elif !defined(MAKEOBJDIR) && !defined(MAKEOBJDIRPREFIX) +.elif exists(${.CURDIR}/obj.${MACHINE}/) || exists(${.CURDIR}/obj/) @${ECHO} "Warning: Using ${.OBJDIR} as object directory instead of\ canonical ${CANONICALOBJDIR}" .endif