Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 include ../../../scripts/Makefile.include
0003 
0004 bindir ?= /usr/bin
0005 
0006 ifeq ($(srctree),)
0007 srctree := $(patsubst %/,%,$(dir $(CURDIR)))
0008 srctree := $(patsubst %/,%,$(dir $(srctree)))
0009 srctree := $(patsubst %/,%,$(dir $(srctree)))
0010 srctree := $(patsubst %/,%,$(dir $(srctree)))
0011 endif
0012 
0013 # Do not use make's built-in rules
0014 # (this improves performance and avoids hard-to-debug behaviour);
0015 MAKEFLAGS += -r
0016 override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I/usr/include/libnl3
0017 override LDFLAGS += -lnl-genl-3 -lnl-3
0018 
0019 ALL_TARGETS := intel-speed-select
0020 ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
0021 
0022 all: $(ALL_PROGRAMS)
0023 
0024 export srctree OUTPUT CC LD CFLAGS
0025 include $(srctree)/tools/build/Makefile.include
0026 
0027 #
0028 # We need the following to be outside of kernel tree
0029 #
0030 $(OUTPUT)include/linux/isst_if.h: ../../../../include/uapi/linux/isst_if.h
0031         mkdir -p $(OUTPUT)include/linux 2>&1 || true
0032         ln -sf $(CURDIR)/../../../../include/uapi/linux/isst_if.h $@
0033 
0034 $(OUTPUT)include/linux/thermal.h: ../../../../include/uapi/linux/thermal.h
0035         mkdir -p $(OUTPUT)include/linux 2>&1 || true
0036         ln -sf $(CURDIR)/../../../../include/uapi/linux/thermal.h $@
0037 
0038 prepare: $(OUTPUT)include/linux/isst_if.h $(OUTPUT)include/linux/thermal.h
0039 
0040 ISST_IN := $(OUTPUT)intel-speed-select-in.o
0041 
0042 $(ISST_IN): prepare FORCE
0043         $(Q)$(MAKE) $(build)=intel-speed-select
0044 $(OUTPUT)intel-speed-select: $(ISST_IN)
0045         $(QUIET_LINK)$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
0046 
0047 clean:
0048         rm -f $(ALL_PROGRAMS)
0049         rm -rf $(OUTPUT)include/linux/isst_if.h
0050         find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete
0051 
0052 install: $(ALL_PROGRAMS)
0053         install -d -m 755 $(DESTDIR)$(bindir);          \
0054         for program in $(ALL_PROGRAMS); do              \
0055                 install $$program $(DESTDIR)$(bindir);  \
0056         done
0057 
0058 FORCE:
0059 
0060 .PHONY: all install clean FORCE prepare