tools/power turbostat: Fix 32-bit capabilities warning
[linux-block.git] / tools / power / x86 / turbostat / Makefile
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
ee0778a3 2CC = $(CROSS_COMPILE)gcc
f82263c6 3BUILD_OUTPUT := $(CURDIR)
ac485cb4
AS
4PREFIX ?= /usr
5DESTDIR ?=
ee0778a3 6
f82263c6
T
7ifeq ("$(origin O)", "command line")
8 BUILD_OUTPUT := $(O)
9endif
10
103a8fea 11turbostat : turbostat.c
6ac1730f 12override CFLAGS += -O2 -Wall -I../../../include
6b7f98a3
JO
13override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
14override CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"'
6ac1730f 15override CFLAGS += -D_FORTIFY_SOURCE=2
103a8fea 16
ee0778a3
MA
17%: %.c
18 @mkdir -p $(BUILD_OUTPUT)
fcaa681c 19 $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ $(LDFLAGS) -lcap
103a8fea 20
ee0778a3 21.PHONY : clean
103a8fea 22clean :
ee0778a3 23 @rm -f $(BUILD_OUTPUT)/turbostat
103a8fea 24
ee0778a3
MA
25install : turbostat
26 install -d $(DESTDIR)$(PREFIX)/bin
27 install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
28 install -d $(DESTDIR)$(PREFIX)/share/man/man8
e29dc460 29 install -m 644 turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8