Makefile 629 字节
Newer Older
1
CC		= $(CROSS_COMPILE)gcc
2
BUILD_OUTPUT	:= $(CURDIR)
3 4 5
PREFIX		:= /usr
DESTDIR		:=

6 7 8 9
ifeq ("$(origin O)", "command line")
	BUILD_OUTPUT := $(O)
endif

L
Len Brown 已提交
10
turbostat : turbostat.c
11
CFLAGS +=	-Wall
12
CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'
L
Len Brown 已提交
13

14 15 16
%: %.c
	@mkdir -p $(BUILD_OUTPUT)
	$(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@
L
Len Brown 已提交
17

18
.PHONY : clean
L
Len Brown 已提交
19
clean :
20
	@rm -f $(BUILD_OUTPUT)/turbostat
L
Len Brown 已提交
21

22 23 24 25 26
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