[PATCH RESEND] tools/x86/kcpuid: Add missing dir via Makefile

From: Christian Heusel
Date: Fri May 31 2024 - 07:24:26 EST


So far the Makefile just installed the csv into $(HWDATADIR)/cpuid.csv,
which made it unaware about $DESTDIR. Add $DESTDIR to the install
command and while we are at it also create the directory, should it not
exist already. This eases the packaging of kcpuid and allows i.e. for
the install on arch to look like this:

make BINDIR=/usr/bin DESTDIR="$pkgdir" -C tools/arch/x86/kcpuid install

So far this change is carried as a downstream patch.

Signed-off-by: Christian Heusel <christian@xxxxxxxxx>
---
Resend to add missing linux-kernel@xxxxxxxxxxxxxxx to recipients
---
tools/arch/x86/kcpuid/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/arch/x86/kcpuid/Makefile b/tools/arch/x86/kcpuid/Makefile
index 87b554fab14b8..d0b4b0ed10ff9 100644
--- a/tools/arch/x86/kcpuid/Makefile
+++ b/tools/arch/x86/kcpuid/Makefile
@@ -19,6 +19,6 @@ clean :
@rm -f kcpuid

install : kcpuid
- install -d $(DESTDIR)$(BINDIR)
+ install -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(HWDATADIR)
install -m 755 -p kcpuid $(DESTDIR)$(BINDIR)/kcpuid
- install -m 444 -p cpuid.csv $(HWDATADIR)/cpuid.csv
+ install -m 444 -p cpuid.csv $(DESTDIR)$(HWDATADIR)/cpuid.csv
--
2.45.1