Author: bdrewery
Date: Sat Nov 11 01:10:55 2017
New Revision: 325699
URL: https://svnweb.freebsd.org/changeset/base/325699

Log:
  Don't work out of a TARGET. directory if TARGET_ARCH is not defined.
  
  This fixes 'TARGET=<target> make universe_kernels' creating an empty TARGET.
  directory and showing it in SIGINFO.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/share/mk/src.sys.obj.mk

Modified: head/share/mk/src.sys.obj.mk
==============================================================================
--- head/share/mk/src.sys.obj.mk        Sat Nov 11 01:10:50 2017        
(r325698)
+++ head/share/mk/src.sys.obj.mk        Sat Nov 11 01:10:55 2017        
(r325699)
@@ -75,12 +75,20 @@ OBJROOT:=   ${OBJROOT:H:tA}/${OBJROOT:T}
 # append TARGET.TARGET_ARCH for that case since the user wants to build
 # in the source tree.
 .if ${MK_UNIFIED_OBJDIR} == "yes" && ${SRCTOP} != ${OBJROOT:tA}
-OBJTOP:=       
${OBJROOT}${TARGET:D${TARGET}.${TARGET_ARCH}:U${MACHINE}.${MACHINE_ARCH}}
+.if defined(TARGET) && defined(TARGET_ARCH)
+OBJTOP:=       ${OBJROOT}${TARGET}.${TARGET_ARCH}
+.elif defined(TARGET) && ${.CURDIR} == ${SRCTOP}
+# Not enough information, just use basic OBJDIR.  This can happen with some
+# 'make universe' targets or if TARGET is not being used as expected.
+OBJTOP:=       ${OBJROOT:H}
 .else
+OBJTOP:=       ${OBJROOT}${MACHINE}.${MACHINE_ARCH}
+.endif
+.else
 # TARGET.TARGET_ARCH handled in OBJROOT already.
 OBJTOP:=       ${OBJROOT:H}
 .endif # ${MK_UNIFIED_OBJDIR} == "yes"
-.endif
+.endif # empty(OBJTOP)
 
 # Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX but leave it alone
 # for DIRDEPS_BUILD which really wants to know the absolute top at
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to