diff mbox series

tools/x86_energy_perf_policy: Make destination directories overridable via env variable

Message ID 1677754.PRGFiW9HIp@c100 (mailing list archive)
State New, archived
Delegated to: Len Brown
Headers show
Series tools/x86_energy_perf_policy: Make destination directories overridable via env variable | expand

Commit Message

Thomas Renninger Sept. 25, 2020, 3:16 p.m. UTC
cmp with other tools/../Makefiles:
tools/lib/bpf/Makefile
tools/lib/traceevent/Makefile
...

and consolidate 2 install calls to one without any functional change.

Signed-off-by: Thomas Renninger <trenn@suse.de>

---
 tools/power/x86/x86_energy_perf_policy/Makefile |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

--- a/tools/power/x86/x86_energy_perf_policy/Makefile
+++ b/tools/power/x86/x86_energy_perf_policy/Makefile
@@ -1,8 +1,9 @@ 
 # SPDX-License-Identifier: GPL-2.0
 CC		= $(CROSS_COMPILE)gcc
-BUILD_OUTPUT    := $(CURDIR)
-PREFIX		:= /usr
-DESTDIR		:=
+BUILD_OUTPUT    ?= $(CURDIR)
+PREFIX		?= /usr
+mandir          ?= $(PREFIX)/share/man
+DESTDIR		?=
 
 ifeq ("$(origin O)", "command line")
 	BUILD_OUTPUT := $(O)
@@ -22,8 +23,6 @@ 
 	@rm -f $(BUILD_OUTPUT)/x86_energy_perf_policy
 
 install : x86_energy_perf_policy
-	install -d  $(DESTDIR)$(PREFIX)/bin
-	install $(BUILD_OUTPUT)/x86_energy_perf_policy $(DESTDIR)$(PREFIX)/bin/x86_energy_perf_policy
-	install -d  $(DESTDIR)$(PREFIX)/share/man/man8
-	install -m 644 x86_energy_perf_policy.8 $(DESTDIR)$(PREFIX)/share/man/man8
+	install -D $(BUILD_OUTPUT)/x86_energy_perf_policy $(DESTDIR)$(PREFIX)/bin/x86_energy_perf_policy
+	install -D -m 644 x86_energy_perf_policy.8 $(DESTDIR)$(mandir)/man8/x86_energy_perf_policy.8