From nobody Fri Feb 11 19:52:25 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 B9A2F19AB1C5; Fri, 11 Feb 2022 19:52:25 +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 4JwPQx4npJz4dj7; Fri, 11 Feb 2022 19:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644609145; 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=wSwp8n9sV3Wu9GXPtr+ZH1IkXLvBJ5nznZ6GiDiaTjc=; b=X7QaRPPsItI1TfoeqOTFfMEzEW4/13OpM+S6frjLSoU9JzKdOufwFipTAlcrUlnPuoxBqA rr9jvIv3yyZqiFMofRKGa1ukFVBdsT3YEqfTl7UqgZjU1tybZQbieOyRMwsG5yOuE9B3VH Rr4+NIjPhN87gjvBYzBR2SqwhxrgCgKyzIJgJRL0l9cmHOz9oL19Gj1hXiRaFDDBHP2Pol TWxHcM2ItGjHr4GZcMlU80XbHPH3LvUYUWQc6RQlEHDaPJLDGcdfLRMoFJ2zj35hqBgYxs 6W3efeWTCf/uMMKzpyTZ6ClWGcoX+Vic74j/fyjOBQxOeCO+pYO+S2sctR3GpA== 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 84F931A713; Fri, 11 Feb 2022 19:52:25 +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 21BJqPwL074522; Fri, 11 Feb 2022 19:52:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21BJqPCC074521; Fri, 11 Feb 2022 19:52:25 GMT (envelope-from git) Date: Fri, 11 Feb 2022 19:52:25 GMT Message-Id: <202202111952.21BJqPCC074521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3e65b7d94dfc - main - cleankernel: A target to delete the kernel compile file 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e65b7d94dfc866cfa3f725ddbe44c8bef525d6c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644609145; 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=wSwp8n9sV3Wu9GXPtr+ZH1IkXLvBJ5nznZ6GiDiaTjc=; b=SRGh9bh5wz/LKj1mlIZFgsnpeJZF1Y/OrKpkdAGcbd+eB3XZ2UdQrscDK74j3rR+dhuk5F 2uNCz9suMSyw5l5cmZeZhhbukuVxjb51TeVWuNw5batefjUSpCX5FwdddSr8JKWB/EGDkT maGp4u3zk9+SVUfXiyAAT54nLISsJml//alHfBJVPQQHWP4IwOJjhi2kFGNWrHJ1VS5GXi ohZGb+f5mlWmnECBb1QhRHag6aIK3BT+rYizjan83tA76Vh62aJummaeqhqfOjttb/Wg0d UjJnJZUirRQiSqeqzrGZGwV2/fBQuYP3Sr9IXc46uEwPwYgvX01775G/hRbZ9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644609145; a=rsa-sha256; cv=none; b=selbzwHOASJ9rJko41irF++DVRozwtiQjddR3w9dvEKukkmnCtFk5Py6cabbf/2P0qD5zY TVYL+9+DYGSiXYZYZf12W1JUj7uuC1J393gCgtDpxkQMRV5A4xin8S/P6xUmQTrIFOqE5m 1RtMtAdOOiE8bqGlt+42CrD0uOB4CdGbTz+qlcwfvY8aj6DA67AvTI0252AdlhdhX5aeck NvUT3Ddi5D2cKh9QX8mkydEXUn6orDv3Kdr2ZeDm8Vi3SAGDW5pbbHB4AigHUiHgRzuDEI y7lszopnUuw2jVT1RdUkT3vKjh+DL+woDhDtx9fSKe9gbDvv3AAcG55h6dgDKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e65b7d94dfc866cfa3f725ddbe44c8bef525d6c commit 3e65b7d94dfc866cfa3f725ddbe44c8bef525d6c Author: Warner Losh AuthorDate: 2022-02-11 19:50:51 +0000 Commit: Warner Losh CommitDate: 2022-02-11 19:51:24 +0000 cleankernel: A target to delete the kernel compile file With the meta-build, it's always a NO_CLEAN build. Provide a way to remove so one can rebuild from scratch. 'cleankernel' will delete the kernel and modules object directories. Document this in build(7). Sponsored by: Netflix Reviewed by: debdrup, markj Differential Revision: https://reviews.freebsd.org/D32978 --- Makefile | 6 +++--- Makefile.inc1 | 8 +++++--- share/man/man7/build.7 | 7 ++++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2b39f814250c..8bd9e37dc016 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# The user-driven targets are: +# The common user-driven targets are (for a complete list, see build(7)): # # universe - *Really* build *everything* (buildworld and # all kernels on all architectures). Define @@ -148,8 +148,8 @@ __DO_KERNELS?=yes TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ check check-old check-old-dirs check-old-files check-old-libs \ - checkdpadd checkworld clean cleandepend cleandir cleanworld \ - cleanuniverse \ + checkdpadd checkworld clean cleandepend cleandir cleankernel \ + cleanworld cleanuniverse \ delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ distributeworld distrib-dirs distribution doxygen \ diff --git a/Makefile.inc1 b/Makefile.inc1 index cbbb2bc83ffc..b7aff83a31d2 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3420,18 +3420,20 @@ builddtb: .PHONY # .if make(cleanworld) BW_CANONICALOBJDIR:=${OBJTOP}/ +.elif make(cleankernel) +BW_CANONICALOBJDIR:=${KRNLOBJDIR}/${KERNCONF}/ .elif make(cleanuniverse) BW_CANONICALOBJDIR:=${OBJROOT} .if ${MK_UNIFIED_OBJDIR} == "no" .error ${.TARGETS} only supported with WITH_UNIFIED_OBJDIR enabled. .endif .endif -cleanworld cleanuniverse: .PHONY +cleanworld cleanuniverse cleankernel: .PHONY .if !empty(BW_CANONICALOBJDIR) && exists(${BW_CANONICALOBJDIR}) && \ ${.CURDIR:tA} != ${BW_CANONICALOBJDIR:tA} - -rm -rf ${BW_CANONICALOBJDIR}* + -(cd ${BW_CANONICALOBJDIR} && rm -rf *) -chflags -R 0 ${BW_CANONICALOBJDIR} - rm -rf ${BW_CANONICALOBJDIR}* + -(cd ${BW_CANONICALOBJDIR} && rm -rf *) .endif .if make(cleanworld) && ${MK_AUTO_OBJ} == "no" && \ (empty(BW_CANONICALOBJDIR) || ${.CURDIR:tA} == ${BW_CANONICALOBJDIR:tA}) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 7a9ef72fda65..4e499c81b45c 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -216,10 +216,15 @@ for native builds, and for cross builds and native builds with variable .Va CROSS_BUILD_TESTING set. +.It Cm cleankernel +Attempts to clean up targets built by a preceding +.Cm buildkernel , +or similar step, built from the same source directory and +.Va KERNCONF . .It Cm cleanworld Attempt to clean up targets built by a preceding .Cm buildworld , -or similar step built from this source directory. +or similar step, built from this source directory. .It Cm cleanuniverse When .Va WITH_UNIFIED_OBJDIR