1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only 2*4882a593Smuzhiyun# tools/power/acpi/Makefile.config - ACPI tool Makefile 3*4882a593Smuzhiyun# 4*4882a593Smuzhiyun# Copyright (c) 2015, Intel Corporation 5*4882a593Smuzhiyun# Author: Lv Zheng <lv.zheng@intel.com> 6*4882a593Smuzhiyun# 7*4882a593Smuzhiyun 8*4882a593Smuzhiyunifeq ($(srctree),) 9*4882a593Smuzhiyunsrctree := $(patsubst %/,%,$(dir $(shell pwd))) 10*4882a593Smuzhiyunsrctree := $(patsubst %/,%,$(dir $(srctree))) 11*4882a593Smuzhiyun#$(info Determined 'srctree' to be $(srctree)) 12*4882a593Smuzhiyunendif 13*4882a593Smuzhiyun 14*4882a593Smuzhiyuninclude $(srctree)/../../scripts/Makefile.include 15*4882a593Smuzhiyun 16*4882a593SmuzhiyunOUTPUT=$(srctree)/ 17*4882a593Smuzhiyunifeq ("$(origin O)", "command line") 18*4882a593Smuzhiyun OUTPUT := $(O)/tools/power/acpi/ 19*4882a593Smuzhiyunendif 20*4882a593Smuzhiyun#$(info Determined 'OUTPUT' to be $(OUTPUT)) 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun# --- CONFIGURATION BEGIN --- 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun# Set the following to `true' to make a unstripped, unoptimized 25*4882a593Smuzhiyun# binary. Leave this set to `false' for production use. 26*4882a593SmuzhiyunDEBUG ?= true 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun# make the build silent. Set this to something else to make it noisy again. 29*4882a593SmuzhiyunV ?= false 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun# Prefix to the directories we're installing to 32*4882a593SmuzhiyunDESTDIR ?= 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun# --- CONFIGURATION END --- 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun# Directory definitions. These are default and most probably 37*4882a593Smuzhiyun# do not need to be changed. Please note that DESTDIR is 38*4882a593Smuzhiyun# added in front of any of them 39*4882a593Smuzhiyun 40*4882a593Smuzhiyunbindir ?= /usr/bin 41*4882a593Smuzhiyunsbindir ?= /usr/sbin 42*4882a593Smuzhiyunmandir ?= /usr/man 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun# Toolchain: what tools do we use, and what options do they need: 45*4882a593Smuzhiyun 46*4882a593SmuzhiyunINSTALL = /usr/bin/install -c 47*4882a593SmuzhiyunINSTALL_PROGRAM = ${INSTALL} 48*4882a593SmuzhiyunINSTALL_DATA = ${INSTALL} -m 644 49*4882a593SmuzhiyunINSTALL_SCRIPT = ${INSTALL_PROGRAM} 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun# If you are running a cross compiler, you may want to set this 52*4882a593Smuzhiyun# to something more interesting, like "arm-linux-". If you want 53*4882a593Smuzhiyun# to compile vs uClibc, that can be done here as well. 54*4882a593SmuzhiyunCROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- 55*4882a593SmuzhiyunCROSS_COMPILE ?= $(CROSS) 56*4882a593SmuzhiyunLD = $(CC) 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun# check if compiler option is supported 59*4882a593Smuzhiyuncc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;} 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun# use '-Os' optimization if available, else use -O2 62*4882a593SmuzhiyunOPTIMIZATION := $(call cc-supports,-Os,-O2) 63*4882a593Smuzhiyun 64*4882a593SmuzhiyunWARNINGS := -Wall 65*4882a593SmuzhiyunWARNINGS += $(call cc-supports,-Wstrict-prototypes) 66*4882a593SmuzhiyunWARNINGS += $(call cc-supports,-Wdeclaration-after-statement) 67*4882a593Smuzhiyun 68*4882a593SmuzhiyunKERNEL_INCLUDE := $(OUTPUT)include 69*4882a593SmuzhiyunACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica 70*4882a593SmuzhiyunCFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE) 71*4882a593SmuzhiyunCFLAGS += $(WARNINGS) 72*4882a593Smuzhiyun 73*4882a593Smuzhiyunifeq ($(strip $(V)),false) 74*4882a593Smuzhiyun QUIET=@ 75*4882a593Smuzhiyun ECHO=@echo 76*4882a593Smuzhiyunelse 77*4882a593Smuzhiyun QUIET= 78*4882a593Smuzhiyun ECHO=@\# 79*4882a593Smuzhiyunendif 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun# if DEBUG is enabled, then we do not strip or optimize 82*4882a593Smuzhiyunifeq ($(strip $(DEBUG)),true) 83*4882a593Smuzhiyun CFLAGS += -O1 -g -DDEBUG 84*4882a593Smuzhiyun STRIPCMD = /bin/true -Since_we_are_debugging 85*4882a593Smuzhiyunelse 86*4882a593Smuzhiyun CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer 87*4882a593Smuzhiyun STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment 88*4882a593Smuzhiyunendif 89