2019-06-01 10:08:55 +02:00
# SPDX-License-Identifier: GPL-2.0-only
2015-07-28 13:25:25 +08:00
# tools/power/acpi/Makefile.config - ACPI tool Makefile
#
# Copyright (c) 2015, Intel Corporation
# Author: Lv Zheng <lv.zheng@intel.com>
#
2016-11-16 17:27:34 +08:00
i f e q ( $( srctree ) , )
srctree := $( patsubst %/,%,$( dir $( shell pwd ) ) )
srctree := $( patsubst %/,%,$( dir $( srctree) ) )
#$(info Determined 'srctree' to be $(srctree))
2015-07-28 13:25:25 +08:00
e n d i f
2016-11-16 17:27:34 +08:00
i n c l u d e $( srctree ) / . . / . . / s c r i p t s / M a k e f i l e . i n c l u d e
OUTPUT = $( srctree) /
i f e q ( "$(origin O)" , "command line" )
2019-12-14 00:27:12 +08:00
OUTPUT := $( O) /tools/power/acpi/
2015-07-28 13:25:25 +08:00
e n d i f
2016-11-16 17:27:34 +08:00
#$(info Determined 'OUTPUT' to be $(OUTPUT))
2015-07-28 13:25:25 +08:00
# --- CONFIGURATION BEGIN ---
# Set the following to `true' to make a unstripped, unoptimized
# binary. Leave this set to `false' for production use.
DEBUG ?= true
# make the build silent. Set this to something else to make it noisy again.
V ?= false
# Prefix to the directories we're installing to
DESTDIR ?=
# --- CONFIGURATION END ---
# Directory definitions. These are default and most probably
# do not need to be changed. Please note that DESTDIR is
# added in front of any of them
bindir ?= /usr/bin
sbindir ?= /usr/sbin
mandir ?= /usr/man
# Toolchain: what tools do we use, and what options do they need:
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${ INSTALL }
INSTALL_DATA = ${ INSTALL } -m 644
INSTALL_SCRIPT = ${ INSTALL_PROGRAM }
# If you are running a cross compiler, you may want to set this
# to something more interesting, like "arm-linux-". If you want
# to compile vs uClibc, that can be done here as well.
CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
2016-06-17 16:01:08 +03:00
CROSS_COMPILE ?= $( CROSS)
2018-04-24 09:43:44 +02:00
LD = $( CC)
2015-07-28 13:25:25 +08:00
# check if compiler option is supported
cc-supports = ${ shell if $( CC) ${ 1 } -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo " $( 1) " ; fi; }
# use '-Os' optimization if available, else use -O2
OPTIMIZATION := $( call cc-supports,-Os,-O2)
WARNINGS := -Wall
WARNINGS += $( call cc-supports,-Wstrict-prototypes)
WARNINGS += $( call cc-supports,-Wdeclaration-after-statement)
2016-11-16 17:27:34 +08:00
KERNEL_INCLUDE := $( OUTPUT) include
ACPICA_INCLUDE := $( srctree) /../../../drivers/acpi/acpica
2015-07-28 13:25:25 +08:00
CFLAGS += -D_LINUX -I$( KERNEL_INCLUDE) -I$( ACPICA_INCLUDE)
CFLAGS += $( WARNINGS)
2021-11-23 21:23:30 +08:00
MKDIR = mkdir
2015-07-28 13:25:25 +08:00
i f e q ( $( strip $ ( V ) ) , f a l s e )
QUIET = @
ECHO = @echo
e l s e
QUIET =
ECHO = @\#
e n d i f
# if DEBUG is enabled, then we do not strip or optimize
i f e q ( $( strip $ ( DEBUG ) ) , t r u e )
CFLAGS += -O1 -g -DDEBUG
STRIPCMD = /bin/true -Since_we_are_debugging
e l s e
CFLAGS += $( OPTIMIZATION) -fomit-frame-pointer
STRIPCMD = $( STRIP) -s --remove-section= .note --remove-section= .comment
e n d i f