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