From owner-svn-src-all@freebsd.org Sun Oct 29 01:21:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3A72E53F0A; Sun, 29 Oct 2017 01:21:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81D8D6358B; Sun, 29 Oct 2017 01:21:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9T1LJQJ068249; Sun, 29 Oct 2017 01:21:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9T1LJTn068247; Sun, 29 Oct 2017 01:21:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201710290121.v9T1LJTn068247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 29 Oct 2017 01:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325079 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Oct 2017 01:21:21 -0000 Author: bdrewery Date: Sun Oct 29 01:21:19 2017 New Revision: 325079 URL: https://svnweb.freebsd.org/changeset/base/325079 Log: Fix xdev TARGET/TARGET_ARCH assertion and expand to native-xtools. The top of Makefile.inc1 requires TARGET/TARGET_ARCH be defined. Just building 'make xdev' would already set them, so this error was never triggered. Moving it to Makefile fixes the problem. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Sun Oct 29 01:21:15 2017 (r325078) +++ head/Makefile Sun Oct 29 01:21:19 2017 (r325079) @@ -135,6 +135,9 @@ TGTS= all all-man buildenv buildenvvars buildkernel bu packages installconfig real-packages sign-packages package-pkg \ print-dir test-system-compiler +# These targets require a TARGET and TARGET_ARCH be defined. +XTGTS= native-xtools xdev xdev-build xdev-install xdev-links + # XXX: r156740: This can't work since bsd.subdir.mk is not included ever. # It will only work for SUBDIR_TARGETS in make.conf. TGTS+= ${SUBDIR_TARGETS} @@ -270,6 +273,11 @@ _TARGET= ${XDEV} .if defined(XDEV_ARCH) _TARGET_ARCH= ${XDEV_ARCH} .endif +# Some targets require a set TARGET/TARGET_ARCH, check before the default +# MACHINE and after the compatibility handling. +.if !defined(_TARGET) || !defined(_TARGET_ARCH) +${XTGTS}: _assert_target +.endif # Otherwise, default to current machine type and architecture. _TARGET?= ${MACHINE} _TARGET_ARCH?= ${MACHINE_ARCH} @@ -277,6 +285,14 @@ _TARGET_ARCH?= ${MACHINE_ARCH} .if make(print-dir) .SILENT: .endif + +_assert_target: .PHONY .MAKE +.for _tgt in ${XTGTS} +.if make(${_tgt}) + @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${_tgt}\" target" + @false +.endif +.endfor # # Make sure we have an up-to-date make(1). Only world and buildworld Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Oct 29 01:21:15 2017 (r325078) +++ head/Makefile.inc1 Sun Oct 29 01:21:19 2017 (r325079) @@ -2760,8 +2760,6 @@ cleanworld: .PHONY ${_+_}@cd ${.CURDIR}; ${MAKE} cleandir .endif -.if defined(TARGET) && defined(TARGET_ARCH) - .if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH} XDEV_CPUTYPE?=${CPUTYPE} .else @@ -2908,7 +2906,3 @@ xdev-links: .PHONY ln -sf ../../${XDTP}/usr/bin/$$i \ ../../../../usr/bin/${XDDIR}${_REVISION}-$$i; \ done -.else -xdev xdev-build xdev-install xdev-links: .PHONY - @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target" -.endif