]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | # SPDX-License-Identifier: GPL-2.0 |
ee0778a3 | 2 | CC = $(CROSS_COMPILE)gcc |
f82263c6 | 3 | BUILD_OUTPUT := $(CURDIR) |
ac485cb4 AS |
4 | PREFIX ?= /usr |
5 | DESTDIR ?= | |
ee0778a3 | 6 | |
f82263c6 T |
7 | ifeq ("$(origin O)", "command line") |
8 | BUILD_OUTPUT := $(O) | |
9 | endif | |
10 | ||
103a8fea | 11 | turbostat : turbostat.c |
c98d5d94 | 12 | CFLAGS += -Wall |
b72e7464 | 13 | CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' |
869ce69e | 14 | CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"' |
103a8fea | 15 | |
ee0778a3 MA |
16 | %: %.c |
17 | @mkdir -p $(BUILD_OUTPUT) | |
18 | $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ | |
103a8fea | 19 | |
ee0778a3 | 20 | .PHONY : clean |
103a8fea | 21 | clean : |
ee0778a3 | 22 | @rm -f $(BUILD_OUTPUT)/turbostat |
103a8fea | 23 | |
ee0778a3 MA |
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 turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8 |