diff options
author | Richard Braun <rbraun@sceen.net> | 2018-06-26 21:52:53 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-06-26 21:54:16 +0200 |
commit | a18a9d0cc0232dc151cef3d2d61807182ef7f6ea (patch) | |
tree | 5e822f9665fac3f81b8bd560a8183f9eae00687e | |
parent | 30dd97fb786ef5f7ca28049684b17bdc2ee7a718 (diff) |
xbuild: minor changes
Improve the naming of compiler-related variables as well as their
description.
-rw-r--r-- | Kconfig | 7 | ||||
-rw-r--r-- | Makefile | 18 |
2 files changed, 17 insertions, 8 deletions
@@ -26,13 +26,16 @@ config CFLAGS menu "Build options" -config CC_EXE +config COMPILER string "Compiler executable" default CC ---help--- Name of the compiler executable -config CC_OPTIONS + This includes any toolchain prefix, and must be a file name, + not a path. + +config COMPILER_OPTIONS string "Compilation options" default CFLAGS ---help--- @@ -208,17 +208,23 @@ include/generated/autoconf.h: .config $(ALL_MAKEFILES) -include .config -ifdef CONFIG_CC_EXE +ifdef CONFIG_COMPILER # Use printf to remove quotes -CC := $(shell printf -- $(CONFIG_CC_EXE)) +CC := $(shell printf -- $(CONFIG_COMPILER)) else CC := gcc endif -# Export to CONFIG_CC +# The CC variable is used by Kconfig to set the value of CONFIG_COMPILER. export CC -CPP = $(CC) -E +TOOLCHAIN_NAME = $(shell printf "%s" $(CC) | rev | cut -s -d - -f 2- | rev) + +ifneq ($(TOOLCHAIN_NAME),) +TOOLCHAIN_PREFIX = $(TOOLCHAIN_NAME)- +endif + +CPP := $(CC) -E CFLAGS ?= -O2 -g @@ -282,9 +288,9 @@ include $(MAKEFILE_INCLUDES) # Must be defined by the architecture-specific Makefile. export KCONFIG_DEFCONFIG -ifdef CONFIG_CC_OPTIONS +ifdef CONFIG_COMPILER_OPTIONS # Use printf to remove quotes -XBUILD_CFLAGS += $(shell printf -- $(CONFIG_CC_OPTIONS)) +XBUILD_CFLAGS += $(shell printf -- $(CONFIG_COMPILER_OPTIONS)) endif COMPILE := $(CC) $(XBUILD_CPPFLAGS) $(XBUILD_CFLAGS) |