Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: Makefile

Issue 6257018: Import firmware compiler flags (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: reorder CFLAGS assignments Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Makefile
diff --git a/Makefile b/Makefile
index 36250fb67df56a76791c1e34ba88eab4887dc907..94d1f0279bbf6eaf4678cd1393d6d3164ecc45f0 100644
--- a/Makefile
+++ b/Makefile
@@ -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},)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698