Makefile 624 B

1234567891011121314151617181920212223242526
  1. CC = $(CROSS_COMPILE)gcc
  2. BUILD_OUTPUT := $(CURDIR)
  3. PREFIX := /usr
  4. DESTDIR :=
  5. ifeq ("$(origin O)", "command line")
  6. BUILD_OUTPUT := $(O)
  7. endif
  8. turbostat : turbostat.c
  9. CFLAGS += -Wall
  10. CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
  11. %: %.c
  12. @mkdir -p $(BUILD_OUTPUT)
  13. $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@
  14. .PHONY : clean
  15. clean :
  16. @rm -f $(BUILD_OUTPUT)/turbostat
  17. install : turbostat
  18. install -d $(DESTDIR)$(PREFIX)/bin
  19. install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
  20. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  21. install turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8