Merge tag 'block-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / power / x86 / turbostat / Makefile
blobf3e3c94ab9bd56f88a6ed03ad888d48ba4b3eab5
1 # SPDX-License-Identifier: GPL-2.0
2 CC = $(CROSS_COMPILE)gcc
3 BUILD_OUTPUT := $(CURDIR)
4 PREFIX ?= /usr
5 DESTDIR ?=
7 ifeq ("$(origin O)", "command line")
8 BUILD_OUTPUT := $(O)
9 endif
11 turbostat : turbostat.c
12 override CFLAGS += -O2 -Wall -I../../../include
13 override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
14 override CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"'
15 override CFLAGS += -D_FILE_OFFSET_BITS=64
16 override CFLAGS += -D_FORTIFY_SOURCE=2
18 %: %.c
19 @mkdir -p $(BUILD_OUTPUT)
20 $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ $(LDFLAGS) -lcap -lrt
22 .PHONY : clean
23 clean :
24 @rm -f $(BUILD_OUTPUT)/turbostat
26 install : turbostat
27 install -d $(DESTDIR)$(PREFIX)/bin
28 install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
29 install -d $(DESTDIR)$(PREFIX)/share/man/man8
30 install -m 644 turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8