summaryrefslogtreecommitdiff
path: root/tools/thermal/tmon/Makefile
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-12-07 01:37:06 +0300
committerIngo Molnar <mingo@kernel.org>2017-12-07 01:37:06 +0300
commitd0300e5e8d2fb74852f8116f26546e12cfa66735 (patch)
treea6580aa74a0ebd7965dbc37767717b4f73dd9d79 /tools/thermal/tmon/Makefile
parentc32909741fe93032705e6da29b564b8fec84f415 (diff)
parent34c9ca37aaec2e307b837bb099d3b44f0ea04ddc (diff)
downloadlinux-d0300e5e8d2fb74852f8116f26546e12cfa66735.tar.xz
Merge branch 'perf/urgent' into perf/core, to pick up fixes and to refresh to v4.15
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/thermal/tmon/Makefile')
-rw-r--r--tools/thermal/tmon/Makefile18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/thermal/tmon/Makefile b/tools/thermal/tmon/Makefile
index 21169322baea..735a510230c3 100644
--- a/tools/thermal/tmon/Makefile
+++ b/tools/thermal/tmon/Makefile
@@ -1,10 +1,16 @@
# SPDX-License-Identifier: GPL-2.0
+# We need this for the "cc-option" macro.
+include ../../../scripts/Kbuild.include
+
VERSION = 1.0
BINDIR=usr/bin
WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
-CFLAGS+= -O1 ${WARNFLAGS} -fstack-protector
-CC=$(CROSS_COMPILE)gcc
+CFLAGS+= -O1 ${WARNFLAGS}
+# Add "-fstack-protector" only if toolchain supports it.
+CFLAGS+= $(call cc-option,-fstack-protector)
+CC?= $(CROSS_COMPILE)gcc
+PKG_CONFIG?= pkg-config
CFLAGS+=-D VERSION=\"$(VERSION)\"
LDFLAGS+=
@@ -19,12 +25,12 @@ STATIC := --static
endif
TMON_LIBS=-lm -lpthread
-TMON_LIBS += $(shell pkg-config --libs $(STATIC) panelw ncursesw 2> /dev/null || \
- pkg-config --libs $(STATIC) panel ncurses 2> /dev/null || \
+TMON_LIBS += $(shell $(PKG_CONFIG) --libs $(STATIC) panelw ncursesw 2> /dev/null || \
+ $(PKG_CONFIG) --libs $(STATIC) panel ncurses 2> /dev/null || \
echo -lpanel -lncurses)
-CFLAGS += $(shell pkg-config --cflags $(STATIC) panelw ncursesw 2> /dev/null || \
- pkg-config --cflags $(STATIC) panel ncurses 2> /dev/null)
+CFLAGS += $(shell $(PKG_CONFIG) --cflags $(STATIC) panelw ncursesw 2> /dev/null || \
+ $(PKG_CONFIG) --cflags $(STATIC) panel ncurses 2> /dev/null)
OBJS = tmon.o tui.o sysfs.o pid.o
OBJS +=