Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only
0002 # tools/power/acpi/Makefile.config - ACPI tool Makefile
0003 #
0004 # Copyright (c) 2015, Intel Corporation
0005 #   Author: Lv Zheng <lv.zheng@intel.com>
0006 #
0007 
0008 ifeq ($(srctree),)
0009 srctree := $(patsubst %/,%,$(dir $(shell pwd)))
0010 srctree := $(patsubst %/,%,$(dir $(srctree)))
0011 #$(info Determined 'srctree' to be $(srctree))
0012 endif
0013 
0014 include $(srctree)/../../scripts/Makefile.include
0015 
0016 OUTPUT=$(srctree)/
0017 ifeq ("$(origin O)", "command line")
0018         OUTPUT := $(O)/tools/power/acpi/
0019 endif
0020 #$(info Determined 'OUTPUT' to be $(OUTPUT))
0021 
0022 # --- CONFIGURATION BEGIN ---
0023 
0024 # Set the following to `true' to make a unstripped, unoptimized
0025 # binary. Leave this set to `false' for production use.
0026 DEBUG ?=        true
0027 
0028 # make the build silent. Set this to something else to make it noisy again.
0029 V ?=            false
0030 
0031 # Prefix to the directories we're installing to
0032 DESTDIR ?=
0033 
0034 # --- CONFIGURATION END ---
0035 
0036 # Directory definitions. These are default and most probably
0037 # do not need to be changed. Please note that DESTDIR is
0038 # added in front of any of them
0039 
0040 bindir ?=       /usr/bin
0041 sbindir ?=      /usr/sbin
0042 mandir ?=       /usr/man
0043 
0044 # Toolchain: what tools do we use, and what options do they need:
0045 
0046 INSTALL = /usr/bin/install -c
0047 INSTALL_PROGRAM = ${INSTALL}
0048 INSTALL_DATA  = ${INSTALL} -m 644
0049 INSTALL_SCRIPT = ${INSTALL_PROGRAM}
0050 
0051 # If you are running a cross compiler, you may want to set this
0052 # to something more interesting, like "arm-linux-".  If you want
0053 # to compile vs uClibc, that can be done here as well.
0054 CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
0055 CROSS_COMPILE ?= $(CROSS)
0056 LD = $(CC)
0057 
0058 # check if compiler option is supported
0059 cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
0060 
0061 # use '-Os' optimization if available, else use -O2
0062 OPTIMIZATION := $(call cc-supports,-Os,-O2)
0063 
0064 WARNINGS := -Wall
0065 WARNINGS += $(call cc-supports,-Wstrict-prototypes)
0066 WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
0067 
0068 KERNEL_INCLUDE := $(OUTPUT)include
0069 ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica 
0070 CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
0071 CFLAGS += $(WARNINGS)
0072 MKDIR = mkdir
0073 
0074 ifeq ($(strip $(V)),false)
0075         QUIET=@
0076         ECHO=@echo
0077 else
0078         QUIET=
0079         ECHO=@\#
0080 endif
0081 
0082 # if DEBUG is enabled, then we do not strip or optimize
0083 ifeq ($(strip $(DEBUG)),true)
0084         CFLAGS += -O1 -g -DDEBUG
0085         STRIPCMD = /bin/true -Since_we_are_debugging
0086 else
0087         CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
0088         STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
0089 endif