1b886d83cSThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 2391fc234SLv Zheng# tools/power/acpi/Makefile.config - ACPI tool Makefile 3391fc234SLv Zheng# 4391fc234SLv Zheng# Copyright (c) 2015, Intel Corporation 5391fc234SLv Zheng# Author: Lv Zheng <lv.zheng@intel.com> 6391fc234SLv Zheng# 7391fc234SLv Zheng 8d5a4b1a5SLv Zhengifeq ($(srctree),) 9d5a4b1a5SLv Zhengsrctree := $(patsubst %/,%,$(dir $(shell pwd))) 10d5a4b1a5SLv Zhengsrctree := $(patsubst %/,%,$(dir $(srctree))) 11d5a4b1a5SLv Zheng#$(info Determined 'srctree' to be $(srctree)) 12d5a4b1a5SLv Zhengendif 13391fc234SLv Zheng 14d5a4b1a5SLv Zhenginclude $(srctree)/../../scripts/Makefile.include 15d5a4b1a5SLv Zheng 16d5a4b1a5SLv ZhengOUTPUT=$(srctree)/ 17391fc234SLv Zhengifeq ("$(origin O)", "command line") 181985f8c7SZhengyuan Liu OUTPUT := $(O)/tools/power/acpi/ 19391fc234SLv Zhengendif 20d5a4b1a5SLv Zheng#$(info Determined 'OUTPUT' to be $(OUTPUT)) 21391fc234SLv Zheng 22391fc234SLv Zheng# --- CONFIGURATION BEGIN --- 23391fc234SLv Zheng 24391fc234SLv Zheng# Set the following to `true' to make a unstripped, unoptimized 25391fc234SLv Zheng# binary. Leave this set to `false' for production use. 26391fc234SLv ZhengDEBUG ?= true 27391fc234SLv Zheng 28391fc234SLv Zheng# make the build silent. Set this to something else to make it noisy again. 29391fc234SLv ZhengV ?= false 30391fc234SLv Zheng 31391fc234SLv Zheng# Prefix to the directories we're installing to 32391fc234SLv ZhengDESTDIR ?= 33391fc234SLv Zheng 34391fc234SLv Zheng# --- CONFIGURATION END --- 35391fc234SLv Zheng 36391fc234SLv Zheng# Directory definitions. These are default and most probably 37391fc234SLv Zheng# do not need to be changed. Please note that DESTDIR is 38391fc234SLv Zheng# added in front of any of them 39391fc234SLv Zheng 40391fc234SLv Zhengbindir ?= /usr/bin 41391fc234SLv Zhengsbindir ?= /usr/sbin 42391fc234SLv Zhengmandir ?= /usr/man 43391fc234SLv Zheng 44391fc234SLv Zheng# Toolchain: what tools do we use, and what options do they need: 45391fc234SLv Zheng 46391fc234SLv ZhengINSTALL = /usr/bin/install -c 47391fc234SLv ZhengINSTALL_PROGRAM = ${INSTALL} 48391fc234SLv ZhengINSTALL_DATA = ${INSTALL} -m 644 49391fc234SLv ZhengINSTALL_SCRIPT = ${INSTALL_PROGRAM} 50391fc234SLv Zheng 51391fc234SLv Zheng# If you are running a cross compiler, you may want to set this 52391fc234SLv Zheng# to something more interesting, like "arm-linux-". If you want 53391fc234SLv Zheng# to compile vs uClibc, that can be done here as well. 54391fc234SLv ZhengCROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- 55a3bcf2d4SAndy ShevchenkoCROSS_COMPILE ?= $(CROSS) 5675539616SJiri SlabyLD = $(CC) 57391fc234SLv Zheng 58391fc234SLv Zheng# check if compiler option is supported 59391fc234SLv Zhengcc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;} 60391fc234SLv Zheng 61391fc234SLv Zheng# use '-Os' optimization if available, else use -O2 62391fc234SLv ZhengOPTIMIZATION := $(call cc-supports,-Os,-O2) 63391fc234SLv Zheng 64391fc234SLv ZhengWARNINGS := -Wall 65391fc234SLv ZhengWARNINGS += $(call cc-supports,-Wstrict-prototypes) 66391fc234SLv ZhengWARNINGS += $(call cc-supports,-Wdeclaration-after-statement) 67391fc234SLv Zheng 68d5a4b1a5SLv ZhengKERNEL_INCLUDE := $(OUTPUT)include 69d5a4b1a5SLv ZhengACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica 70391fc234SLv ZhengCFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE) 71391fc234SLv ZhengCFLAGS += $(WARNINGS) 72*11f8cb89SChen YuMKDIR = mkdir 73391fc234SLv Zheng 74391fc234SLv Zhengifeq ($(strip $(V)),false) 75391fc234SLv Zheng QUIET=@ 76391fc234SLv Zheng ECHO=@echo 77391fc234SLv Zhengelse 78391fc234SLv Zheng QUIET= 79391fc234SLv Zheng ECHO=@\# 80391fc234SLv Zhengendif 81391fc234SLv Zheng 82391fc234SLv Zheng# if DEBUG is enabled, then we do not strip or optimize 83391fc234SLv Zhengifeq ($(strip $(DEBUG)),true) 84391fc234SLv Zheng CFLAGS += -O1 -g -DDEBUG 85391fc234SLv Zheng STRIPCMD = /bin/true -Since_we_are_debugging 86391fc234SLv Zhengelse 87391fc234SLv Zheng CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer 88391fc234SLv Zheng STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment 89391fc234SLv Zhengendif 90