Merge remote-tracking branches 'asoc/topic/wm8753', 'asoc/topic/wm8770', 'asoc/topic...
[linux-block.git] / tools / power / acpi / Makefile.config
CommitLineData
391fc234
LZ
1# tools/power/acpi/Makefile.config - ACPI tool Makefile
2#
3# Copyright (c) 2015, Intel Corporation
4# Author: Lv Zheng <lv.zheng@intel.com>
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public License
8# as published by the Free Software Foundation; version 2
9# of the License.
10
d5a4b1a5
LZ
11ifeq ($(srctree),)
12srctree := $(patsubst %/,%,$(dir $(shell pwd)))
13srctree := $(patsubst %/,%,$(dir $(srctree)))
14#$(info Determined 'srctree' to be $(srctree))
391fc234
LZ
15endif
16
d5a4b1a5
LZ
17include $(srctree)/../../scripts/Makefile.include
18
19OUTPUT=$(srctree)/
20ifeq ("$(origin O)", "command line")
21 OUTPUT := $(O)/power/acpi/
391fc234 22endif
d5a4b1a5 23#$(info Determined 'OUTPUT' to be $(OUTPUT))
391fc234
LZ
24
25# --- CONFIGURATION BEGIN ---
26
27# Set the following to `true' to make a unstripped, unoptimized
28# binary. Leave this set to `false' for production use.
29DEBUG ?= true
30
31# make the build silent. Set this to something else to make it noisy again.
32V ?= false
33
34# Prefix to the directories we're installing to
35DESTDIR ?=
36
37# --- CONFIGURATION END ---
38
39# Directory definitions. These are default and most probably
40# do not need to be changed. Please note that DESTDIR is
41# added in front of any of them
42
43bindir ?= /usr/bin
44sbindir ?= /usr/sbin
45mandir ?= /usr/man
46
47# Toolchain: what tools do we use, and what options do they need:
48
49INSTALL = /usr/bin/install -c
50INSTALL_PROGRAM = ${INSTALL}
51INSTALL_DATA = ${INSTALL} -m 644
52INSTALL_SCRIPT = ${INSTALL_PROGRAM}
53
54# If you are running a cross compiler, you may want to set this
55# to something more interesting, like "arm-linux-". If you want
56# to compile vs uClibc, that can be done here as well.
57CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
a3bcf2d4 58CROSS_COMPILE ?= $(CROSS)
391fc234
LZ
59HOSTCC = gcc
60
61# check if compiler option is supported
62cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
63
64# use '-Os' optimization if available, else use -O2
65OPTIMIZATION := $(call cc-supports,-Os,-O2)
66
67WARNINGS := -Wall
68WARNINGS += $(call cc-supports,-Wstrict-prototypes)
69WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
70
d5a4b1a5
LZ
71KERNEL_INCLUDE := $(OUTPUT)include
72ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica
391fc234
LZ
73CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
74CFLAGS += $(WARNINGS)
75
76ifeq ($(strip $(V)),false)
77 QUIET=@
78 ECHO=@echo
79else
80 QUIET=
81 ECHO=@\#
82endif
83
84# if DEBUG is enabled, then we do not strip or optimize
85ifeq ($(strip $(DEBUG)),true)
86 CFLAGS += -O1 -g -DDEBUG
87 STRIPCMD = /bin/true -Since_we_are_debugging
88else
89 CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
90 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
91endif