GNU Linux-libre 4.19.304-gnu1
[releases.git] / tools / power / x86 / turbostat / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 CC              = $(CROSS_COMPILE)gcc
3 BUILD_OUTPUT    := $(CURDIR)
4 PREFIX          ?= /usr
5 DESTDIR         ?=
6
7 ifeq ("$(origin O)", "command line")
8         BUILD_OUTPUT := $(O)
9 endif
10
11 turbostat : turbostat.c
12 CFLAGS +=       -Wall -I../../../include
13 CFLAGS +=       -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
14 CFLAGS +=       -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"'
15
16 %: %.c
17         @mkdir -p $(BUILD_OUTPUT)
18         $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@
19
20 .PHONY : clean
21 clean :
22         @rm -f $(BUILD_OUTPUT)/turbostat
23
24 install : turbostat
25         install -d  $(DESTDIR)$(PREFIX)/bin
26         install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
27         install -d  $(DESTDIR)$(PREFIX)/share/man/man8
28         install -m 644 turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8