summaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-02-04 17:24:19 +0900
committerTom Rini <trini@ti.com>2014-02-19 11:07:50 -0500
commit2b3c9d3ddd4e0b5a55d17e164e817b42cb555639 (patch)
tree1e1c4ab380b87fdc02438a58c10ad501b97819fa /config.mk
parentbf4b3de1013c1643ffb8f071292c0f0eabb265c3 (diff)
Makefile: move more flags to the top Makefile
Before this commit, most of compiler flags were defined in config.mk. But it is redundant because config.mk is included from all recursive make. This commit moves many complier flags to the top Makefile and export them. And we use new vaiarables to store them: KBUILD_CPPFLAGS, KBUILD_CFLAGS, KBUILD_AFLAGS. This will allow us to switch more smoothly to Kbuild. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk41
1 files changed, 4 insertions, 37 deletions
diff --git a/config.mk b/config.mk
index ba4264155e..04b63f66b4 100644
--- a/config.mk
+++ b/config.mk
@@ -90,19 +90,13 @@ endif
#########################################################################
-# We don't actually use $(ARFLAGS) anywhere anymore, so catch people
-# who are porting old code to latest mainline but not updating $(AR).
-ARFLAGS = $(error update your Makefile to use cmd_link_o_target and not AR)
RELFLAGS= $(PLATFORM_RELFLAGS)
-DBGFLAGS= -g # -DDEBUG
-OPTFLAGS= -Os #-fomit-frame-pointer
OBJCFLAGS += --gap-fill=0xff
gccincdir := $(shell $(CC) -print-file-name=include)
-CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
- -D__KERNEL__
+CPPFLAGS = $(KBUILD_CPPFLAGS) $(RELFLAGS)
# Enable garbage collection of un-used sections for SPL
ifeq ($(CONFIG_SPL_BUILD),y)
@@ -134,26 +128,10 @@ CPPFLAGS += -I$(OBJTREE)/include
endif
CPPFLAGS += -I$(TOPDIR)/include -I$(SRCTREE)/arch/$(ARCH)/include
-CPPFLAGS += -fno-builtin -ffreestanding -nostdinc \
+CPPFLAGS += -nostdinc \
-isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes
-
-ifdef BUILD_TAG
-CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"'
-endif
-
-CFLAGS_SSP := $(call cc-option,-fno-stack-protector)
-CFLAGS += $(CFLAGS_SSP)
-# Some toolchains enable security related warning flags by default,
-# but they don't make much sense in the u-boot world, so disable them.
-CFLAGS_WARN := $(call cc-option,-Wno-format-nonliteral) \
- $(call cc-option,-Wno-format-security)
-CFLAGS += $(CFLAGS_WARN)
-
-# Report stack usage if supported
-CFLAGS_STACK := $(call cc-option,-fstack-usage)
-CFLAGS += $(CFLAGS_STACK)
+CFLAGS := $(KBUILD_CFLAGS) $(CPPFLAGS)
BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
@@ -165,18 +143,7 @@ endif
endif
endif
-# $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
-# option to the assembler.
-AFLAGS_DEBUG :=
-
-# turn jbsr into jsr for m68k
-ifeq ($(ARCH),m68k)
-ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)
-AFLAGS_DEBUG := -Wa,-gstabs,-S
-endif
-endif
-
-AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
+AFLAGS := $(KBUILD_AFLAGS) $(CPPFLAGS)
LDFLAGS += $(PLATFORM_LDFLAGS)
LDFLAGS_FINAL += -Bstatic