diff options
author | Che-Liang Chiou <clchiou@chromium.org> | 2011-01-27 10:23:51 +0800 |
---|---|---|
committer | Che-Liang Chiou <clchiou@chromium.org> | 2011-01-27 10:23:51 +0800 |
commit | 440ad516c4840882557bfb76ddf497ea0041fc03 (patch) | |
tree | f053c8698e834026a4449036a9998f2b22ee2624 /Makefile | |
parent | 30e7f6439b2891993ec370511e65da5073e20fec (diff) | |
download | vboot-440ad516c4840882557bfb76ddf497ea0041fc03.tar.gz |
Import firmware compiler flags
If passed into Makefile, compiler flags for firmware (so far CC and CFLAGS) will
override old values to make sure that the compiled vboot_reference library has
calling convention and etc. compatible with the firmware.
See also CL:6355014
BUG=None
TEST=See the CL for related ebuilds
Review URL: http://codereview.chromium.org/6257018
Change-Id: I46f77c576d2355f5cde506a0240dd2e2d4a74f0e
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -3,19 +3,33 @@ # found in the LICENSE file. export FIRMWARE_ARCH +export FIRMWARE_CONFIG_PATH export CC ?= gcc export CXX ?= g++ -ifeq ($(FIRMWARE_ARCH),) -export CFLAGS = -Wall -Werror -DCHROMEOS_ENVIRONMENT -else -export CFLAGS = -Wall -Werror +export CFLAGS + +# Include compiler flags if provided. +# The CC and CFLAGS should not be overridden hereafter. +ifneq ($(FIRMWARE_CONFIG_PATH),) +include $(FIRMWARE_CONFIG_PATH) endif +# Provides default optimization level if not set by FIRMWARE_CONFIG_PATH ifeq (${DEBUG},) -CFLAGS += -O3 +CFLAGS ?= -O3 else -CFLAGS += -O0 -g -DVBOOT_DEBUG +CFLAGS ?= -O0 +endif + +ifeq ($(FIRMWARE_ARCH),) +CFLAGS += -Wall -Werror -DCHROMEOS_ENVIRONMENT +else +CFLAGS += -Wall -Werror +endif + +ifneq (${DEBUG},) +CFLAGS += -g -DVBOOT_DEBUG endif ifeq (${DISABLE_NDEBUG},) |