blob: 4039854560d0d5dffe32150562a6f11b2791033f [file] [log] [blame]
Mark Asselstineee0778a2012-10-09 11:31:44 -04001CC = $(CROSS_COMPILE)gcc
Thomas Df82263c2015-01-05 21:37:23 +01002BUILD_OUTPUT := $(CURDIR)
Mark Asselstineee0778a2012-10-09 11:31:44 -04003PREFIX := /usr
4DESTDIR :=
5
Thomas Df82263c2015-01-05 21:37:23 +01006ifeq ("$(origin O)", "command line")
7 BUILD_OUTPUT := $(O)
8endif
9
Len Brown103a8fe2010-10-22 23:53:03 -040010turbostat : turbostat.c
Len Brownc98d5d92012-06-04 00:56:40 -040011CFLAGS += -Wall
Josh Triplettb731f312013-08-20 17:20:12 -070012CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'
Len Brown103a8fe2010-10-22 23:53:03 -040013
Mark Asselstineee0778a2012-10-09 11:31:44 -040014%: %.c
15 @mkdir -p $(BUILD_OUTPUT)
16 $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@
Len Brown103a8fe2010-10-22 23:53:03 -040017
Mark Asselstineee0778a2012-10-09 11:31:44 -040018.PHONY : clean
Len Brown103a8fe2010-10-22 23:53:03 -040019clean :
Mark Asselstineee0778a2012-10-09 11:31:44 -040020 @rm -f $(BUILD_OUTPUT)/turbostat
Len Brown103a8fe2010-10-22 23:53:03 -040021
Mark Asselstineee0778a2012-10-09 11:31:44 -040022install : turbostat
23 install -d $(DESTDIR)$(PREFIX)/bin
24 install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
25 install -d $(DESTDIR)$(PREFIX)/share/man/man8
26 install turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8