All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/power x86: Makefile fixes
@ 2012-07-06 10:42 Antonio Meireles
  0 siblings, 0 replies; only message in thread
From: Antonio Meireles @ 2012-07-06 10:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: len.brown, Antonio Meireles

	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@openfiler.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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-06 10:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-06 10:42 [PATCH] tools/power x86: Makefile fixes Antonio Meireles

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.