]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.19.7/tools-power-turbostat-use-curdir-instead-of-pwd-and-add-support-for-o-option-in-makefile.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.19.7 / tools-power-turbostat-use-curdir-instead-of-pwd-and-add-support-for-o-option-in-makefile.patch
CommitLineData
eefdbb8e
GKH
1From f82263c6989c31ae9b94cecddffb29dcbec38710 Mon Sep 17 00:00:00 2001
2From: Thomas D <whissi@whissi.de>
3Date: Mon, 5 Jan 2015 21:37:23 +0100
4Subject: tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in Makefile
5
6From: Thomas D <whissi@whissi.de>
7
8commit f82263c6989c31ae9b94cecddffb29dcbec38710 upstream.
9
10Since commit ee0778a30153
11("tools/power: turbostat: make Makefile a bit more capable")
12turbostat's Makefile is using
13
14 [...]
15 BUILD_OUTPUT := $(PWD)
16 [...]
17
18which obviously causes trouble when building "turbostat" with
19
20 make -C /usr/src/linux/tools/power/x86/turbostat ARCH=x86 turbostat
21
22because GNU make does not update nor guarantee that $PWD is set.
23
24This patch changes the Makefile to use $CURDIR instead, which GNU make
25guarantees to set and update (i.e. when using "make -C ...") and also
26adds support for the O= option (see "make help" in your root of your
27kernel source tree for more details).
28
29Link: https://bugs.gentoo.org/show_bug.cgi?id=533918
30Fixes: ee0778a30153 ("tools/power: turbostat: make Makefile a bit more capable")
31Signed-off-by: Thomas D. <whissi@whissi.de>
32Cc: Mark Asselstine <mark.asselstine@windriver.com>
33Signed-off-by: Len Brown <len.brown@intel.com>
34Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35
36---
37 tools/power/x86/turbostat/Makefile | 6 +++++-
38 1 file changed, 5 insertions(+), 1 deletion(-)
39
40--- a/tools/power/x86/turbostat/Makefile
41+++ b/tools/power/x86/turbostat/Makefile
42@@ -1,8 +1,12 @@
43 CC = $(CROSS_COMPILE)gcc
44-BUILD_OUTPUT := $(PWD)
45+BUILD_OUTPUT := $(CURDIR)
46 PREFIX := /usr
47 DESTDIR :=
48
49+ifeq ("$(origin O)", "command line")
50+ BUILD_OUTPUT := $(O)
51+endif
52+
53 turbostat : turbostat.c
54 CFLAGS += -Wall
55 CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'