2024-09-09 08:57:42 +00:00
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
BUILD_OUTPUT := $(CURDIR)
|
|
|
|
PREFIX := /usr
|
|
|
|
DESTDIR :=
|
|
|
|
|
|
|
|
ifeq ("$(origin O)", "command line")
|
|
|
|
BUILD_OUTPUT := $(O)
|
|
|
|
endif
|
|
|
|
|
2024-09-09 08:52:07 +00:00
|
|
|
turbostat : turbostat.c
|
2024-09-09 08:57:42 +00:00
|
|
|
CFLAGS += -Wall
|
|
|
|
CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'
|
|
|
|
|
|
|
|
%: %.c
|
|
|
|
@mkdir -p $(BUILD_OUTPUT)
|
|
|
|
$(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
.PHONY : clean
|
2024-09-09 08:52:07 +00:00
|
|
|
clean :
|
2024-09-09 08:57:42 +00:00
|
|
|
@rm -f $(BUILD_OUTPUT)/turbostat
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
install : turbostat
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/share/man/man8
|
|
|
|
install turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8
|