From nobody Tue Jul 26 20:24:42 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LspL22FCyz4X5gJ; Tue, 26 Jul 2022 20:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LspL21l5Wz3NfD; Tue, 26 Jul 2022 20:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658867082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HmE8xXMs0yZ49dP04q3k/5ISvSbSrW4BYKajVQeDCDk=; b=NuxwAmLgwEZsWbfmu05g8lK9EMtd+BFF68xwy8xERHBXR+MjNMtd/GcVl83SazOLNQoqDl JjJkVZ6LwrnPX07hczD8VAkVnKuX49XjC3WrzEqBbNTs5piPQtq3IABGW/FxjMfnQg21bD aQFYQqP364VYyd5SB+9G359H/GVDMW1rbDAzM369bK5BbGsnB/lpt3W6fgj1Mp6E1dY8DF lfF3WFH2AWoVYyPYnP4eXaGpHW4yYiWBXjd+5ZqfOoo1dPdeCbEKwsdXKSL1bltpAPZosa PC8QFXrU2h+GvYa6tj2z6PMm8enR+XOyXV3BSMWtt3OCxgPZRgXwZeZhAR3z6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LspL20pk9zqfs; Tue, 26 Jul 2022 20:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26QKOg8Y002637; Tue, 26 Jul 2022 20:24:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QKOgjp002636; Tue, 26 Jul 2022 20:24:42 GMT (envelope-from git) Date: Tue, 26 Jul 2022 20:24:42 GMT Message-Id: <202207262024.26QKOgjp002636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 08604a023dc1 - main - Auto-create bmake/unit-tests objdir if appropriate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08604a023dc1b601289b7de20509462a3a3ed6ad Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658867082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HmE8xXMs0yZ49dP04q3k/5ISvSbSrW4BYKajVQeDCDk=; b=nAxe4PaMZD3zU0z7WGky8+pt2pFfZpUka2kL5OjdzvrZmoa46vZBBMWntIOBNC1u28oGIy d5OqhQKus0xmShCjCZ/wmz2ErJ5UBLytmnk1yLPMG1xjCE0VqR/VujcgtGe9pLYwd1PTNX QFceU7jnRcX62bOlbuy5atjH4H6YXV8PjkxGNjuvtTn0FklXWVCIANakV5y9SLWmJdO512 PrXpSV0hfscsAOPADUSIuHQhV8T8eKGF32tn44tZsp8O/Q6AkQixTkjAprKvklblgOm1BD +r94QZ/rvEfFJJ2OoUxEszRAUsuKHj3UvjuhGZsEFzdMp/uxfbgsPBStxaco0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658867082; a=rsa-sha256; cv=none; b=o0xkG7tX09CUQCo8qZBJNJdyGG++/GGRd0ni85ludG5YobmgtrL80Ry2+nkqeLboRWH9OC lnUYqDMt5fvGcVaott1eZjGUzshVNiKd7IbHUxA0JxhbqdY5QJhADLhrG3MVBS7H49AcYw 0aWPCSN7s5wmwafwG+y641E1p8H5bBD36bD085OoWTkscKX2pE9Dywn2GjfJszKp3GtqRA oTATptfqGDKhV01lvJQXA9CMixfWnCfzoXGvR2qrKBj87lNmDZYY/fE163nUlERxEGkuWQ P3HeHaEtBHeXoKwT3BfXQrAffwfmLI9x7qQdgP0lMqA6alQCyiipiCgSdFZTZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=08604a023dc1b601289b7de20509462a3a3ed6ad commit 08604a023dc1b601289b7de20509462a3a3ed6ad Author: Simon J. Gerraty AuthorDate: 2022-07-26 20:24:34 +0000 Commit: Simon J. Gerraty CommitDate: 2022-07-26 20:24:34 +0000 Auto-create bmake/unit-tests objdir if appropriate Given the way bmake/unit-tests is visited, when doing 'test' MK_AUTO_OBJ=yes will not be effective. So create the objdir before running the sub-make. Also ensure MAKEOBJDIR is passed to opt-m-include-dir Reviewed by: deo --- usr.bin/bmake/Makefile | 15 ++++++++++++++- usr.bin/bmake/unit-tests/Makefile | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/usr.bin/bmake/Makefile b/usr.bin/bmake/Makefile index 14389de562dd..b6d741d30960 100644 --- a/usr.bin/bmake/Makefile +++ b/usr.bin/bmake/Makefile @@ -147,11 +147,24 @@ ${OBJS}: config.h # A simple unit-test driver to help catch regressions TEST_MAKE ?= ${.OBJDIR}/${PROG:T} -accept test: +accept test: .NOMETA cd ${.CURDIR}/unit-tests && \ MAKEFLAGS= ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS=${TESTS:Q}} +.if make(test) && ${MK_AUTO_OBJ} == "yes" +# because of the way unit-tests is visted for test +# the objdir will not be auto-created as expected. +.if defined(MAKEOBJDIRPREFIX) || ${MAKEOBJDIR:Uno:M*/*} != "" +_utobj = ${.OBJDIR}/unit-tests +.else +_utobj = ${.CURDIR}/unit-tests/${MAKEOBJDIR:Uobj} +.endif +utobj: .NOMETA + mkdir -p ${_utobj} +test: utobj +.endif + # override some simple things BINDIR= /usr/bin MANDIR= /usr/share/man/man diff --git a/usr.bin/bmake/unit-tests/Makefile b/usr.bin/bmake/unit-tests/Makefile index 13967ae888a8..a4023c7a98fc 100644 --- a/usr.bin/bmake/unit-tests/Makefile +++ b/usr.bin/bmake/unit-tests/Makefile @@ -505,6 +505,7 @@ ENV.depsrc-optional+= TZ=UTC ENV.deptgt-phony+= MAKESYSPATH=. ENV.directive-undef= ENV_VAR=env-value ENV.envfirst= FROM_ENV=value-from-env +ENV.opt-m-include-dir= ${MAKEOBJDIR:DMAKEOBJDIR=${MAKEOBJDIR}} ENV.varmisc= FROM_ENV=env ENV.varmisc+= FROM_ENV_BEFORE=env ENV.varmisc+= FROM_ENV_AFTER=env