git: c5c0e79bb0ad - main - Add local.meta.stage.mk

From: Simon J. Gerraty <sjg_at_FreeBSD.org>
Date: Wed, 16 Oct 2024 16:27:13 UTC
The branch main has been updated by sjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=c5c0e79bb0ad0a1b9b9688aaf919826c4c386411

commit c5c0e79bb0ad0a1b9b9688aaf919826c4c386411
Author:     Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2024-10-16 16:25:16 +0000
Commit:     Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2024-10-16 16:26:29 +0000

    Add local.meta.stage.mk
    
    We need to undo NO_OBJ if we are staging
    as it causes us to drop the stage* target cookies in src tree
    which is bad, and may break doing the same targets for multiple
    architectures.
    
    Reviewed by:    stevek
---
 share/mk/local.meta.stage.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/share/mk/local.meta.stage.mk b/share/mk/local.meta.stage.mk
new file mode 100644
index 000000000000..8a59631e57ae
--- /dev/null
+++ b/share/mk/local.meta.stage.mk
@@ -0,0 +1,6 @@
+.if defined(NO_OBJ) && ${__objdir:U${.CURDIR}} != ${.CURDIR}
+# NO_OBJ would cause us to dribble stage* into .CURDIR
+# which will prevent the targets being done for multiple MACHINES
+.undef NO_OBJ
+.OBJDIR: ${__objdir}
+.endif