mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
make: move exported make vars to one place
This commit is contained in:
parent
f33dc4601b
commit
747138cf99
@ -171,7 +171,11 @@ buildinfo:
|
|||||||
@echo 'HEXFILE: $(HEXFILE)'
|
@echo 'HEXFILE: $(HEXFILE)'
|
||||||
@echo ''
|
@echo ''
|
||||||
@echo 'CC: $(CC)'
|
@echo 'CC: $(CC)'
|
||||||
@echo -e 'CFLAGSS:$(patsubst %, \n\t%, $(CFLAGS))'
|
@echo -e 'CFLAGS:$(patsubst %, \n\t%, $(CFLAGS))'
|
||||||
|
@echo ''
|
||||||
|
@echo 'CXX: $(CXX)'
|
||||||
|
@echo -e 'CXXUWFLAGS:$(patsubst %, \n\t%, $(CXXUWFLAGS))'
|
||||||
|
@echo -e 'CXXEXFLAGS:$(patsubst %, \n\t%, $(CXXEXFLAGS))'
|
||||||
@echo ''
|
@echo ''
|
||||||
@echo 'LINK: $(LINK)'
|
@echo 'LINK: $(LINK)'
|
||||||
@echo -e 'LINKFLAGS:$(patsubst %, \n\t%, $(LINKFLAGS))'
|
@echo -e 'LINKFLAGS:$(patsubst %, \n\t%, $(LINKFLAGS))'
|
||||||
|
@ -3,13 +3,13 @@ export __RIOTBUILD_FLAG := RIOT
|
|||||||
|
|
||||||
# set undefined variables
|
# set undefined variables
|
||||||
RIOTBASE ?= $(shell dirname "$(lastword $(MAKEFILE_LIST))")
|
RIOTBASE ?= $(shell dirname "$(lastword $(MAKEFILE_LIST))")
|
||||||
export RIOTBASE := $(abspath $(RIOTBASE))
|
RIOTBASE := $(abspath $(RIOTBASE))
|
||||||
|
|
||||||
RIOTCPU ?= $(RIOTBASE)/cpu
|
RIOTCPU ?= $(RIOTBASE)/cpu
|
||||||
export RIOTCPU := $(abspath $(RIOTCPU))
|
RIOTCPU := $(abspath $(RIOTCPU))
|
||||||
|
|
||||||
RIOTBOARD ?= $(RIOTBASE)/boards
|
RIOTBOARD ?= $(RIOTBASE)/boards
|
||||||
export RIOTBOARD := $(abspath $(RIOTBOARD))
|
RIOTBOARD := $(abspath $(RIOTBOARD))
|
||||||
|
|
||||||
ifeq ($(strip $(MCU)),)
|
ifeq ($(strip $(MCU)),)
|
||||||
MCU = $(CPU)
|
MCU = $(CPU)
|
||||||
@ -32,11 +32,8 @@ BB = $(shell echo $(BOARD)|tr 'a-z' 'A-Z'|tr '-' '_')
|
|||||||
CPUDEF = $(shell echo $(CPU)|tr 'a-z' 'A-Z'|tr '-' '_')
|
CPUDEF = $(shell echo $(CPU)|tr 'a-z' 'A-Z'|tr '-' '_')
|
||||||
CFLAGS += -DBOARD_$(BB) -DCPU_$(CPUDEF)
|
CFLAGS += -DBOARD_$(BB) -DCPU_$(CPUDEF)
|
||||||
|
|
||||||
export CFLAGS
|
BINDIRBASE ?= $(CURDIR)/bin
|
||||||
export APPLICATION
|
BINDIR ?= $(abspath $(BINDIRBASE)/$(BOARD))/
|
||||||
|
|
||||||
export BINDIRBASE ?= $(CURDIR)/bin
|
|
||||||
export BINDIR ?= $(abspath $(BINDIRBASE)/$(BOARD))/
|
|
||||||
|
|
||||||
ifeq ($(QUIET),1)
|
ifeq ($(QUIET),1)
|
||||||
AD=@
|
AD=@
|
||||||
@ -44,7 +41,6 @@ ifeq ($(QUIET),1)
|
|||||||
else
|
else
|
||||||
AD=
|
AD=
|
||||||
endif
|
endif
|
||||||
export AD
|
|
||||||
|
|
||||||
BOARD := $(strip $(BOARD))
|
BOARD := $(strip $(BOARD))
|
||||||
|
|
||||||
@ -87,13 +83,11 @@ BASELIBS += $(USEPKG:%=${BINDIR}%.a)
|
|||||||
|
|
||||||
.PHONY: all clean flash doc term objsize buildsize buildsizes buildsizes-diff buildinfo
|
.PHONY: all clean flash doc term objsize buildsize buildsizes buildsizes-diff buildinfo
|
||||||
|
|
||||||
export ELFFILE ?= $(BINDIR)$(APPLICATION).elf
|
ELFFILE ?= $(BINDIR)$(APPLICATION).elf
|
||||||
export HEXFILE ?= $(ELFFILE:.elf=.hex)
|
HEXFILE ?= $(ELFFILE:.elf=.hex)
|
||||||
|
|
||||||
# variables used to complie and link c++
|
# variables used to complie and link c++
|
||||||
export CPPMIX ?= $(if $(wildcard *.cpp),1,)
|
CPPMIX ?= $(if $(wildcard *.cpp),1,)
|
||||||
export CXXUWFLAGS
|
|
||||||
export CXXEXFLAGS
|
|
||||||
|
|
||||||
# We assume $(LINK) to be gcc-like. Use `LINKFLAGPREFIX :=` for ld-like linker options.
|
# We assume $(LINK) to be gcc-like. Use `LINKFLAGPREFIX :=` for ld-like linker options.
|
||||||
LINKFLAGPREFIX ?= -Wl,
|
LINKFLAGPREFIX ?= -Wl,
|
||||||
@ -159,3 +153,6 @@ debug:
|
|||||||
|
|
||||||
# Extra make goals for testing and comparing changes.
|
# Extra make goals for testing and comparing changes.
|
||||||
include $(RIOTBASE)/Makefile.buildtests
|
include $(RIOTBASE)/Makefile.buildtests
|
||||||
|
|
||||||
|
# Export variables used throughout the whole make system:
|
||||||
|
include $(RIOTBASE)/Makefile.vars
|
||||||
|
42
Makefile.vars
Normal file
42
Makefile.vars
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
export AD # Used in front of Makefile lines to suppress the printing of the command if user did not opt-in to see them.
|
||||||
|
export QUIET # The parameter to use whether to show verbose makefile commands or not.
|
||||||
|
|
||||||
|
export APPLICATION # The application, set in the Makefile which is run by the user.
|
||||||
|
export BOARD # The board to compile the application for.
|
||||||
|
export CPU # The CPU, set by the board's Makefile.include.
|
||||||
|
export MCU # The MCU, set by the board's Makefile.include, or defaulted to the same value as CPU.
|
||||||
|
export INCLUDES # The extra include paths, set by the various Makefile.include files.
|
||||||
|
|
||||||
|
export USEMODULE # Sys Module dependencies of the application. Set in the application's Makefile.
|
||||||
|
export USEPKG # Pkg dependencies (third party modules) of the application. Set in the application's Makefile.
|
||||||
|
export DISABLE_MODULE # Used in the application's Makefile to suppress DEFAULT_MODULEs.
|
||||||
|
export APPDEPS # Files / Makefile targets that need to be created before the application can be build. Set in the application's Makefile.
|
||||||
|
|
||||||
|
export RIOTBASE # The root folder of RIOT. The folder where this very file lives in.
|
||||||
|
export RIOTCPU # For third party CPUs this folder is the base of the CPUs.
|
||||||
|
export RIOTBOARD # For third party BOARDs this folder is the base of the BOARDs.
|
||||||
|
export BINDIRBASE # This is the folder where the application should be built in. For each BOARD a different subfolder is used.
|
||||||
|
export BINDIR # This is the folder where the application should be built in.
|
||||||
|
|
||||||
|
export PREFIX # The prefix of the toolchain commands, e.g. "arm-non-eabi-" or "msp430-".
|
||||||
|
export CC # The C compiler to use.
|
||||||
|
export CXX # The CXX compiler to use.
|
||||||
|
export CFLAGS # The compiler flags. Must only ever be used with `+=`.
|
||||||
|
export CXXUWFLAGS # (Patters of) flags in CFLAGS, that should not be passed to CXX.
|
||||||
|
export CXXEXFLAGS # Additional flags that should be passed to CXX.
|
||||||
|
export AR # The command to create the object file archives.
|
||||||
|
export AS # The assembler.
|
||||||
|
export ASFLAGS # Flags for the assembler.
|
||||||
|
export LINK # The command used to link the files. Must take the same parameters as GCC, i.e. "ld" won't work.
|
||||||
|
export LINKFLAGS # Flags to supply in the linking step.
|
||||||
|
export OBJCOPY # The command used to create the HEXFILE.
|
||||||
|
export OFLAGS # The parameter for OBJCOPY, e.g. to strip the debug information.
|
||||||
|
export SIZE # The command to read to size of the ELF sections.
|
||||||
|
export UNDEF # Set by the BOARD's and CPU's Makefile.include, this contains object files with must not be used in the ELFFILE even if the if no call to the functions.
|
||||||
|
|
||||||
|
export FLASHER # The command to call on "make flash".
|
||||||
|
export FFLAGS # The parameters to supply to FLASHER.
|
||||||
|
export TERMPROG # The command to call on "make term".
|
||||||
|
export PORT # The parameters to supply to TERMPROG.
|
||||||
|
export ELFFILE # The unstripped result of the compilation.
|
||||||
|
export HEXFILE # The stripped result of the compilation.
|
Loading…
Reference in New Issue
Block a user