Browse Source

make: always include toolchain dependent Makefile

pr/gpio
Oleg Hahm 7 years ago
parent
commit
a82556d818
  1. 26
      Makefile.include
  2. 26
      cpu/Makefile.include.cortexm_common

26
Makefile.include

@ -136,6 +136,32 @@ ifneq (0,$(shell test -d $(RIOTBOARD)/$(BOARD); echo $$?))
$(error The specified board $(BOARD) does not exist.)
endif
# Use TOOLCHAIN environment variable to select the toolchain to use.
# Default: gnu
TOOLCHAIN ?= gnu
# TOOLCHAIN = clang is an alias for TOOLCHAIN = llvm
ifeq (clang,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override TOOLCHAIN := llvm
endif
# TOOLCHAIN = gcc is an alias for TOOLCHAIN = gnu
ifeq (gcc,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override TOOLCHAIN := gnu
endif
ifeq (,$(TOOLCHAIN))
override TOOLCHAIN := gnu
endif
export TOOLCHAIN
# Import all toolchain settings
include $(RIOTCPU)/Makefile.include.$(TOOLCHAIN)
# mandatory includes!
include $(RIOTBASE)/Makefile.modules
include $(RIOTBOARD)/$(BOARD)/Makefile.include

26
cpu/Makefile.include.cortexm_common

@ -1,29 +1,6 @@
# Target triple for the build. Use arm-none-eabi if you are unsure.
export TARGET_TRIPLE ?= arm-none-eabi
# Use TOOLCHAIN environment variable to select the toolchain to use.
# Default: gnu
TOOLCHAIN ?= gnu
# TOOLCHAIN = clang is an alias for TOOLCHAIN = llvm
ifeq (clang,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override TOOLCHAIN := llvm
endif
# TOOLCHAIN = gcc is an alias for TOOLCHAIN = gnu
ifeq (gcc,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override TOOLCHAIN := gnu
endif
ifeq (,$(TOOLCHAIN))
override TOOLCHAIN := gnu
endif
export TOOLCHAIN
# default toolchain prefix, defaults to target triple followed by a dash, you
# will most likely not need to touch this.
export PREFIX ?= $(if $(TARGET_TRIPLE),$(TARGET_TRIPLE)-)
@ -116,9 +93,6 @@ endif
# CPU depends on the cortex-m common module, so include it:
include $(RIOTCPU)/cortexm_common/Makefile.include
# Import all toolchain settings
include $(RIOTCPU)/Makefile.include.$(TOOLCHAIN)
# use the nano-specs of Newlib when available
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
export LINKFLAGS += -specs=nano.specs -lc -lnosys

Loading…
Cancel
Save