summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 12 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 5b668553..bcb0daf6 100644
--- a/Makefile
+++ b/Makefile
@@ -137,32 +137,29 @@ endif
# Flag ordering: arch, then -f, then -m, then -W
DEBUG_FLAGS := $(if ${DEBUG},-g -O0,-Os)
WERROR := -Werror
-COMMON_FLAGS := -nostdinc -pipe \
- -ffreestanding -fno-builtin -fno-stack-protector \
- ${WERROR} -Wall -Wstrict-prototypes ${DEBUG_FLAGS}
+FIRMWARE_FLAGS := -nostdinc -ffreestanding -fno-builtin -fno-stack-protector
+COMMON_FLAGS := -pipe ${WERROR} -Wall -Wstrict-prototypes -Wtype-limits \
+ -Wundef -Wmissing-prototypes -Wno-trigraphs -Wredundant-decls \
+ -Wwrite-strings -Wstrict-aliasing -Wshadow -Wdate-time ${DEBUG_FLAGS}
# Note: FIRMWARE_ARCH is defined by the Chromium OS ebuild.
ifeq (${FIRMWARE_ARCH}, arm)
CC ?= armv7a-cros-linux-gnueabihf-gcc
-CFLAGS ?= -march=armv5 \
- -fno-common -ffixed-r8 \
- -mfloat-abi=hard -marm -mabi=aapcs-linux -mno-thumb-interwork \
- ${COMMON_FLAGS}
+CFLAGS ?= -march=armv5 -fno-common -ffixed-r8 -mfloat-abi=hard -marm
+ -mabi=aapcs-linux -mno-thumb-interwork ${FIRMWARE_FLAGS} ${COMMON_FLAGS}
else ifeq (${FIRMWARE_ARCH}, x86)
CC ?= i686-pc-linux-gnu-gcc
# Drop -march=i386 to permit use of SSE instructions
-CFLAGS ?= \
- -ffunction-sections -fvisibility=hidden -fno-strict-aliasing \
- -fomit-frame-pointer -fno-toplevel-reorder -fno-dwarf2-cfi-asm \
- -mpreferred-stack-boundary=2 \
- ${COMMON_FLAGS}
+CFLAGS ?= -ffunction-sections -fvisibility=hidden -fomit-frame-pointer \
+ -fno-toplevel-reorder -fno-dwarf2-cfi-asm -mpreferred-stack-boundary=2 \
+ ${FIRMWARE_FLAGS} ${COMMON_FLAGS}
else ifeq (${FIRMWARE_ARCH}, x86_64)
-CFLAGS ?= ${COMMON_FLAGS} \
- -fvisibility=hidden -fno-strict-aliasing -fomit-frame-pointer
+CFLAGS ?= ${FIRMWARE_FLAGS} ${COMMON_FLAGS} -fvisibility=hidden \
+ -fomit-frame-pointer
else
# FIRMWARE_ARCH not defined; assuming local compile.
CC ?= gcc
-CFLAGS += -DCHROMEOS_ENVIRONMENT -Wall ${WERROR} ${DEBUG_FLAGS}
+CFLAGS += -DCHROMEOS_ENVIRONMENT ${COMMON_FLAGS}
CHROMEOS_ENVIRONMENT = 1
endif