Lv Zheng | 391fc23 | 2015-07-28 13:25:25 +0800 | [diff] [blame] | 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 | |
| 11 | include ../../../../scripts/Makefile.include |
| 12 | |
| 13 | OUTPUT=./ |
| 14 | ifeq ("$(origin O)", "command line") |
| 15 | OUTPUT := $(O)/ |
| 16 | endif |
| 17 | |
| 18 | ifneq ($(OUTPUT),) |
| 19 | # check that the output directory actually exists |
| 20 | OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) |
| 21 | $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) |
| 22 | endif |
| 23 | |
| 24 | # --- CONFIGURATION BEGIN --- |
| 25 | |
| 26 | # Set the following to `true' to make a unstripped, unoptimized |
| 27 | # binary. Leave this set to `false' for production use. |
| 28 | DEBUG ?= true |
| 29 | |
| 30 | # make the build silent. Set this to something else to make it noisy again. |
| 31 | V ?= false |
| 32 | |
| 33 | # Prefix to the directories we're installing to |
| 34 | DESTDIR ?= |
| 35 | |
| 36 | # --- CONFIGURATION END --- |
| 37 | |
| 38 | # Directory definitions. These are default and most probably |
| 39 | # do not need to be changed. Please note that DESTDIR is |
| 40 | # added in front of any of them |
| 41 | |
| 42 | bindir ?= /usr/bin |
| 43 | sbindir ?= /usr/sbin |
| 44 | mandir ?= /usr/man |
| 45 | |
| 46 | # Toolchain: what tools do we use, and what options do they need: |
| 47 | |
| 48 | INSTALL = /usr/bin/install -c |
| 49 | INSTALL_PROGRAM = ${INSTALL} |
| 50 | INSTALL_DATA = ${INSTALL} -m 644 |
| 51 | INSTALL_SCRIPT = ${INSTALL_PROGRAM} |
| 52 | |
| 53 | # If you are running a cross compiler, you may want to set this |
| 54 | # to something more interesting, like "arm-linux-". If you want |
| 55 | # to compile vs uClibc, that can be done here as well. |
| 56 | CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- |
Andy Shevchenko | a3bcf2d | 2016-06-17 16:01:08 +0300 | [diff] [blame] | 57 | CROSS_COMPILE ?= $(CROSS) |
| 58 | CC = $(CROSS_COMPILE)gcc |
| 59 | LD = $(CROSS_COMPILE)gcc |
| 60 | STRIP = $(CROSS_COMPILE)strip |
Lv Zheng | 391fc23 | 2015-07-28 13:25:25 +0800 | [diff] [blame] | 61 | HOSTCC = gcc |
| 62 | |
| 63 | # check if compiler option is supported |
| 64 | cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;} |
| 65 | |
| 66 | # use '-Os' optimization if available, else use -O2 |
| 67 | OPTIMIZATION := $(call cc-supports,-Os,-O2) |
| 68 | |
| 69 | WARNINGS := -Wall |
| 70 | WARNINGS += $(call cc-supports,-Wstrict-prototypes) |
| 71 | WARNINGS += $(call cc-supports,-Wdeclaration-after-statement) |
| 72 | |
| 73 | KERNEL_INCLUDE := ../../../include |
| 74 | ACPICA_INCLUDE := ../../../drivers/acpi/acpica |
| 75 | CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE) |
| 76 | CFLAGS += $(WARNINGS) |
| 77 | |
| 78 | ifeq ($(strip $(V)),false) |
| 79 | QUIET=@ |
| 80 | ECHO=@echo |
| 81 | else |
| 82 | QUIET= |
| 83 | ECHO=@\# |
| 84 | endif |
| 85 | |
| 86 | # if DEBUG is enabled, then we do not strip or optimize |
| 87 | ifeq ($(strip $(DEBUG)),true) |
| 88 | CFLAGS += -O1 -g -DDEBUG |
| 89 | STRIPCMD = /bin/true -Since_we_are_debugging |
| 90 | else |
| 91 | CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer |
| 92 | STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment |
| 93 | endif |