lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri,  6 Jul 2012 11:42:24 +0100
From:	Antonio Meireles <antonio.meireles@...nfiler.com>
To:	linux-kernel@...r.kernel.org
Cc:	len.brown@...el.com,
	Antonio Meireles <antonio.meireles@...nfiler.com>
Subject: [PATCH] tools/power x86: Makefile fixes

	Make the install relative to DESTDIR if specified.
	Honor, as well, custom installation settings, if they are present.

	Signed-off-by: Antonio Meireles <antonio.meireles@...nfiler.com>
---
 tools/power/x86/turbostat/Makefile              |   24 +++++++++++++++++++----
 tools/power/x86/x86_energy_perf_policy/Makefile |   24 +++++++++++++++++++----
 2 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/tools/power/x86/turbostat/Makefile b/tools/power/x86/turbostat/Makefile
index fd8e1f1..8b1c430 100644
--- a/tools/power/x86/turbostat/Makefile
+++ b/tools/power/x86/turbostat/Makefile
@@ -1,8 +1,24 @@
-turbostat : turbostat.c
+OUTPUT=./
+ifeq ("$(origin O)", "command line")
+       OUTPUT := $(O)/
+endif
+
+DESTDIR ?=
+
+bindir ?= /usr/bin
+mandir ?= /usr/man
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA  = ${INSTALL} -m 644
+
+$(OUTPUT)turbostat : turbostat.c
 
 clean :
-	rm -f turbostat
+	rm -f $(OUTPUT)turbostat
 
 install :
-	install turbostat /usr/bin/turbostat
-	install turbostat.8 /usr/share/man/man8
+	$(INSTALL) -d $(DESTDIR)${bindir}
+	$(INSTALL) -d $(DESTDIR)${mandir}/man8
+	$(INSTALL_PROGRAM) $(OUTPUT)turbostat $(DESTDIR)${bindir}/
+	$(INSTALL_DATA) turbostat.8 $(DESTDIR)${mandir}/man8/
diff --git a/tools/power/x86/x86_energy_perf_policy/Makefile b/tools/power/x86/x86_energy_perf_policy/Makefile
index f458237..c20971d 100644
--- a/tools/power/x86/x86_energy_perf_policy/Makefile
+++ b/tools/power/x86/x86_energy_perf_policy/Makefile
@@ -1,8 +1,24 @@
-x86_energy_perf_policy : x86_energy_perf_policy.c
+OUTPUT=./
+ifeq ("$(origin O)", "command line")
+       OUTPUT := $(O)/
+endif
+
+DESTDIR ?=
+
+bindir ?= /usr/bin
+mandir ?= /usr/man
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA  = ${INSTALL} -m 644
+
+$(OUTPUT)x86_energy_perf_policy : x86_energy_perf_policy.c
 
 clean :
-	rm -f x86_energy_perf_policy
+	rm -f $(OUTPUT)x86_energy_perf_policy
 
 install :
-	install x86_energy_perf_policy /usr/bin/
-	install x86_energy_perf_policy.8 /usr/share/man/man8/
+	$(INSTALL) -d $(DESTDIR)${bindir}
+	$(INSTALL) -d $(DESTDIR)${mandir}/man8
+	$(INSTALL_PROGRAM) $(OUTPUT)x86_energy_perf_policy $(DESTDIR)${bindir}/
+	$(INSTALL_DATA) x86_energy_perf_policy.8 $(DESTDIR)${mandir}/man8/
-- 
1.7.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ