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