]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.14.41/tools-power-turbostat-use-curdir-instead-of-pwd-and-add-support-for-o-option-in-makefile.patch
Linux 5.1.3
[thirdparty/kernel/stable-queue.git] / releases / 3.14.41 / tools-power-turbostat-use-curdir-instead-of-pwd-and-add-support-for-o-option-in-makefile.patch
1 From f82263c6989c31ae9b94cecddffb29dcbec38710 Mon Sep 17 00:00:00 2001
2 From: Thomas D <whissi@whissi.de>
3 Date: Mon, 5 Jan 2015 21:37:23 +0100
4 Subject: tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in Makefile
5
6 From: Thomas D <whissi@whissi.de>
7
8 commit f82263c6989c31ae9b94cecddffb29dcbec38710 upstream.
9
10 Since commit ee0778a30153
11 ("tools/power: turbostat: make Makefile a bit more capable")
12 turbostat's Makefile is using
13
14 [...]
15 BUILD_OUTPUT := $(PWD)
16 [...]
17
18 which obviously causes trouble when building "turbostat" with
19
20 make -C /usr/src/linux/tools/power/x86/turbostat ARCH=x86 turbostat
21
22 because GNU make does not update nor guarantee that $PWD is set.
23
24 This patch changes the Makefile to use $CURDIR instead, which GNU make
25 guarantees to set and update (i.e. when using "make -C ...") and also
26 adds support for the O= option (see "make help" in your root of your
27 kernel source tree for more details).
28
29 Link: https://bugs.gentoo.org/show_bug.cgi?id=533918
30 Fixes: ee0778a30153 ("tools/power: turbostat: make Makefile a bit more capable")
31 Signed-off-by: Thomas D. <whissi@whissi.de>
32 Cc: Mark Asselstine <mark.asselstine@windriver.com>
33 Signed-off-by: Len Brown <len.brown@intel.com>
34 Signed-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"'