summaryrefslogtreecommitdiff
path: root/tools/arch
diff options
context:
space:
mode:
authorChristian Heusel <christian@heusel.eu>2024-05-31 14:17:58 +0300
committerBorislav Petkov (AMD) <bp@alien8.de>2024-06-12 12:33:45 +0300
commit1d2a03d26a69e4e781077f5fbb5466143928c737 (patch)
tree9fe2132acad4f8514427977946df9b5c7b6820d4 /tools/arch
parent9aae1baa1c5d8b7229b6de38dc9dc17efcb8c55d (diff)
downloadlinux-1d2a03d26a69e4e781077f5fbb5466143928c737.tar.xz
tools/x86/kcpuid: Add missing dir via Makefile
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 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 Some background on DESTDIR: DESTDIR is commonly used in packaging for staged installs (regardless of the used package manager): https://www.gnu.org/prep/standards/html_node/DESTDIR.html So the package is built and installed into a directory which the package manager later picks up and creates some archive from it. What is specific to Arch Linux here is only the usage of $pkgdir in the example, DESTDIR itself is widely used. [ bp: Extend the commit message with Christian's info on DESTDIR as a GNU coding standards thing. ] Signed-off-by: Christian Heusel <christian@heusel.eu> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20240531111757.719528-2-christian@heusel.eu
Diffstat (limited to 'tools/arch')
-rw-r--r--tools/arch/x86/kcpuid/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/arch/x86/kcpuid/Makefile b/tools/arch/x86/kcpuid/Makefile
index 87b554fab14b..d0b4b0ed10ff 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