build: set platform name without quotes and reuse everywhere

Avoid having to remove quotes wherever the platform name is used
by exporting the variable only once.

Change-Id: I4cb51901e4ac19d70d0310fe6bbacd157f586661
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2015-11-26 16:45:36 -05:00
commit 1e3dca51bb
12 changed files with 17 additions and 20 deletions

View file

@ -746,12 +746,14 @@ libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
libs-y := $(libs-y1) $(libs-y2) libs-y := $(libs-y1) $(libs-y2)
PLATFORM_NAME = $(subst $(DQUOTE),,$(CONFIG_PLATFORM))
export PLATFORM_NAME
# Externally visible symbols (used by link-zephyr.sh) # Externally visible symbols (used by link-zephyr.sh)
export KBUILD_ZEPHYR_MAIN := $(drivers-y) $(core-y) $(libs-y) $(app-y) export KBUILD_ZEPHYR_MAIN := $(drivers-y) $(core-y) $(libs-y) $(app-y)
ifdef CONFIG_HAVE_CUSTOM_LINKER_SCRIPT ifdef CONFIG_HAVE_CUSTOM_LINKER_SCRIPT
export KBUILD_LDS := $(subst $(DQUOTE),,$(CONFIG_CUSTOM_LINKER_SCRIPT)) export KBUILD_LDS := $(subst $(DQUOTE),,$(CONFIG_CUSTOM_LINKER_SCRIPT))
else else
export KBUILD_LDS := $(srctree)/arch/$(SRCARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM))/linker.cmd export KBUILD_LDS := $(srctree)/arch/$(SRCARCH)/platforms/$(PLATFORM_NAME)/linker.cmd
endif endif
export LDFLAGS_zephyr export LDFLAGS_zephyr
# used by scripts/pacmage/Makefile # used by scripts/pacmage/Makefile

View file

@ -1,7 +1,7 @@
subdir-ccflags-y +=-I$(srctree)/arch/arc/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) subdir-ccflags-y +=-I$(srctree)/arch/arc/platforms/$(PLATFORM_NAME)
subdir-ccflags-y +=-I$(srctree)/include/drivers subdir-ccflags-y +=-I$(srctree)/include/drivers
subdir-ccflags-y +=-I$(srctree)/drivers subdir-ccflags-y +=-I$(srctree)/drivers
subdir-asflags-y += $(subdir-ccflags-y) subdir-asflags-y += $(subdir-ccflags-y)
obj-y = core/ obj-y = core/
obj-y += platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM))/ obj-y += platforms/$(PLATFORM_NAME)/

View file

@ -1,10 +1,10 @@
ccflags-y +=-I$(srctree)/arch/arc/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) ccflags-y +=-I$(srctree)/arch/arc/platforms/$(PLATFORM_NAME)
ccflags-y +=-I$(srctree)/arch/x86/platforms/ ccflags-y +=-I$(srctree)/arch/x86/platforms/
ccflags-y +=-I$(srctree)/include ccflags-y +=-I$(srctree)/include
ccflags-y +=-I$(srctree)/include/drivers ccflags-y +=-I$(srctree)/include/drivers
ccflags-y +=-I$(srctree)/drivers ccflags-y +=-I$(srctree)/drivers
asflags-y +=-I$(srctree)/arch/arc/platforms/$(PLATFORM_NAME)
ccflags-$(CONFIG_ADC) +=-I$(srctree)/drivers/adc ccflags-$(CONFIG_ADC) +=-I$(srctree)/drivers/adc
asflags-y +=-I$(srctree)/arch/arc/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM))
asflags-y := ${ccflags-y} asflags-y := ${ccflags-y}

View file

@ -1,7 +1,7 @@
subdir-ccflags-y +=-I$(srctree)/include/drivers subdir-ccflags-y +=-I$(srctree)/include/drivers
subdir-ccflags-y +=-I$(srctree)/drivers subdir-ccflags-y +=-I$(srctree)/drivers
subdir-ccflags-y +=-I$(srctree)/arch/arm/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) subdir-ccflags-y +=-I$(srctree)/arch/arm/platforms/$(PLATFORM_NAME)
subdir-asflags-y := ${subdir-ccflags-y} subdir-asflags-y := ${subdir-ccflags-y}
obj-y += core/ obj-y += core/
obj-y += platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM))/ obj-y += platforms/$(PLATFORM_NAME)/

View file

@ -1,5 +1,5 @@
ccflags-y +=-I$(srctree)/include/drivers ccflags-y +=-I$(srctree)/include/drivers
ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(PLATFORM_NAME)
asflags-y = $(ccflags-y) asflags-y = $(ccflags-y)

View file

@ -1,4 +1,2 @@
DQUOTE = "
# This comment line is to fix the highlighting of some editors due the quote effect."
obj-y += core/ obj-y += core/
obj-y += platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM))/ obj-y += platforms/$(PLATFORM_NAME)/

View file

@ -1,4 +1,5 @@
ccflags-y +=-I$(srctree)/arch/x86 ccflags-y +=-I$(srctree)/arch/x86
ccflags-y +=-I$(srctree)/arch/x86/platforms/$(PLATFORM_NAME)/
ccflags-y +=-I$(srctree)/include/drivers ccflags-y +=-I$(srctree)/include/drivers
ccflags-y +=-I$(srctree)/drivers ccflags-y +=-I$(srctree)/drivers
asflags-y := ${ccflags-y} asflags-y := ${ccflags-y}

View file

@ -1,6 +1,6 @@
subdir-ccflags-y += -I$(srctree)/include/drivers subdir-ccflags-y += -I$(srctree)/include/drivers
subdir-ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) subdir-ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(PLATFORM_NAME)
subdir-asflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) subdir-asflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(PLATFORM_NAME)
obj-y = console/ obj-y = console/
obj-y += random/ obj-y += random/

View file

@ -1,5 +1 @@
ccflags-y +=-I$(srctree)/arch/$(ARCH)
ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM))
asflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM))
obj-$(CONFIG_AIO_DW_COMPARATOR) += aio_dw_comparator.o aio_static_irq_stubs.o obj-$(CONFIG_AIO_DW_COMPARATOR) += aio_dw_comparator.o aio_static_irq_stubs.o

View file

@ -1,3 +1,3 @@
ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(PLATFORM_NAME)
obj-y = main.o obj-y = main.o

View file

@ -1,4 +1,4 @@
ccflags-y += ${PROJECTINCLUDE} -I${srctree}/samples/include ccflags-y += ${PROJECTINCLUDE} -I${srctree}/samples/include
ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(PLATFORM_NAME)
obj-y = atomic.o obj-y = atomic.o

View file

@ -1,5 +1,5 @@
ccflags-y += ${PROJECTINCLUDE} -I${srctree}/samples/include ccflags-y += ${PROJECTINCLUDE} -I${srctree}/samples/include
ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(subst $(DQUOTE),,$(CONFIG_PLATFORM)) ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(PLATFORM_NAME)
ccflags-$(CONFIG_PLATFORM_QUARK_D2000) += -DFIBER_STACKSIZE=256 ccflags-$(CONFIG_PLATFORM_QUARK_D2000) += -DFIBER_STACKSIZE=256
obj-y = context.o obj-y = context.o