All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fuad Tabba <fuad.tabba@linux.dev>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	Pawel Chmielewski <pawel.chmielewski@intel.com>,
	linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev,
	linux-kernel@vger.kernel.org, Fuad Tabba <tabba@google.com>
Subject: [PATCH 1/2] ACPI: tools: Link include/acpi instead of copying it
Date: Mon,  5 Oct 2026 16:37:22 +0100	[thread overview]
Message-ID: <20261005153723.2644331-2-fuad.tabba@linux.dev> (raw)
In-Reply-To: <20261005153723.2644331-1-fuad.tabba@linux.dev>

An incremental build of the ACPI tools uses an old copy of the
include/acpi headers after they change. The copy under $(OUTPUT)include
is made by a rule for the directory with no prerequisites, so once it
exists it's never refreshed.

Link $(OUTPUT)include/acpi to include/acpi instead, which keeps the rest
of include/ out of the tools' include path as the copy did. The link is
recreated on every build, so it also replaces a copy left by an earlier
one, and the objects take it as an order-only prerequisite so that
recreating it rebuilds nothing. Rebuilding them when a header changes
is the next patch.

Fixes: d5a4b1a540b8 ("tools/power/acpi: Remove direct kernel source include reference")
Assisted-by: LLM
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
 tools/power/acpi/Makefile.rules | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/power/acpi/Makefile.rules b/tools/power/acpi/Makefile.rules
index b71aada776889..48d9280a63f72 100644
--- a/tools/power/acpi/Makefile.rules
+++ b/tools/power/acpi/Makefile.rules
@@ -13,13 +13,12 @@ $(OUTPUT)$(TOOL): $(toolobjs) FORCE
 	$(ECHO) "  STRIP   " $(subst $(OUTPUT),,$@)
 	$(QUIET) $(STRIPCMD) $@
 
-$(KERNEL_INCLUDE):
-	$(ECHO) "  MKDIR   " $(subst $(OUTPUT),,$@)
+$(KERNEL_INCLUDE)/acpi: FORCE
 	$(QUIET) mkdir -p $(KERNEL_INCLUDE)
-	$(ECHO) "  CP      " $(subst $(OUTPUT),,$@)
-	$(QUIET) cp -rf $(srctree)/../../../include/acpi $(KERNEL_INCLUDE)/
+	$(QUIET) rm -rf $@
+	$(QUIET) ln -s $(abspath $(srctree)/../../../include/acpi) $@
 
-$(objdir)%.o: %.c $(KERNEL_INCLUDE)
+$(objdir)%.o: %.c | $(KERNEL_INCLUDE)/acpi
 	$(ECHO) "  CC      " $(subst $(OUTPUT),,$@)
 	$(QUIET) $(MKDIR) -p $(objdir) 2>/dev/null
 	$(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
-- 
2.39.5


  reply	other threads:[~2026-10-05 15:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 15:37 [PATCH 0/2] ACPI: tools: Fix stale headers in incremental builds Fuad Tabba
2026-10-05 15:37 ` Fuad Tabba [this message]
2026-10-05 15:37 ` [PATCH 2/2] ACPI: tools: Rebuild objects when a header they include changes Fuad Tabba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261005153723.2644331-2-fuad.tabba@linux.dev \
    --to=fuad.tabba@linux.dev \
    --cc=acpica-devel@lists.linux.dev \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=pawel.chmielewski@intel.com \
    --cc=rafael@kernel.org \
    --cc=tabba@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.