2017-07-07 17:32:27 +02:00
# set default values for selected global variables
FLASH_ADDR ?= 0x0
2016-12-17 01:16:07 +01:00
export Q # Used in front of Makefile lines to suppress the printing of the command if user did not opt-in to see them.
2016-12-22 12:18:38 +01:00
export Q Q # as Q, but be more quiet
2014-05-05 21:53:37 +02:00
export Q U I E T # The parameter to use whether to show verbose makefile commands or not.
2022-04-28 14:02:24 +02:00
export Q U I E T E R # The parameter to use to hide most makefile output
2014-05-05 21:53:37 +02:00
2019-12-12 20:42:44 +01:00
export O S # The operating system of the build host
2021-04-02 18:42:34 +02:00
export O S _ A R C H # The build host's hardware architecture
2019-12-12 20:42:44 +01:00
2014-05-05 21:53:37 +02:00
export A P P L I C A T I O N # The application, set in the Makefile which is run by the user.
2018-01-29 15:48:18 +01:00
export A P P L I C A T I O N _ M O D U L E # The application module name.
2014-05-05 21:53:37 +02:00
export B O A R D # The board to compile the application for.
2019-05-02 18:15:45 +02:00
export C P U # The CPU, set by the board's Makefile.features.
export C P U _ M O D E L # The specific identifier of the used CPU, used for some CPU implementations to differentiate between different memory layouts. Set by the board's Makefile.features.
2020-06-10 13:11:32 +02:00
export C P U _ C O R E # The specific identifier of the core present in the CPU. Needed for depency resolution.
export C P U _ A R C H # The specific identifier of the architecture of the core defined in CPU_CORE.
2019-10-08 14:50:10 +02:00
export C P U _ F A M # An intermediate identifier between CPU and CPU_MODEL that represents a sub-group of a Manufacturers CPU's.
2014-05-05 21:53:37 +02:00
export I N C L U D E S # The extra include paths, set by the various Makefile.include files.
2018-10-15 21:00:20 +02:00
export C X X I N C L U D E S # The extra include paths for c++, set by the various Makefile.include files.
2020-03-26 10:25:09 +01:00
export N A T I V E I N C L U D E S # The native include paths, set by the various native Makefile.include files.
2014-05-05 21:53:37 +02:00
2023-05-20 19:53:00 +02:00
export G C C _ C _ I N C L U D E S # system include dirs implicitly used by GCC's c compiler, only defined with TOOLCHAIN=llvm
export G C C _ C X X _ I N C L U D E S # system include dirs implicitly used by GCC's c++ compiler, only defined with TOOLCHAIN=llvm
2014-05-05 21:53:37 +02:00
export U S E M O D U L E # Sys Module dependencies of the application. Set in the application's Makefile.
2021-10-13 14:22:51 +02:00
export B I N _ U S E M O D U L E # Modules specific to bindist (see bindist.ink.mk). Set in the application's Makefile.
2014-05-05 21:53:37 +02:00
export U S E P K G # Pkg dependencies (third party modules) of the application. Set in the application's Makefile.
export D I S A B L E _ M O D U L E # Used in the application's Makefile to suppress DEFAULT_MODULEs.
2020-06-28 12:14:31 +02:00
# APPDEPS # Files / Makefile targets that need to be created before the application can be build. Set in the application's Makefile.
2018-04-23 13:59:39 +02:00
# BUILDDEPS # Files / Makefile targets that need to be created before starting to build.
2019-10-02 21:12:07 +02:00
# DEBUGDEPS # Files / Makefile targets that need to be created before starting a debug session.
2014-05-05 21:53:37 +02:00
export R I O T B A S E # The root folder of RIOT. The folder where this very file lives in.
export R I O T C P U # For third party CPUs this folder is the base of the CPUs.
2019-09-09 17:27:25 +02:00
export R I O T B O A R D # This folder is the base of the riot boards.
2020-04-14 15:23:23 +02:00
export B O A R D S D I R # This is the folder containing the board dir
export E X T E R N A L _ B O A R D _ D I R S # List of folders containing external board dirs
export B O A R D D I R # This folder contains the board
2016-03-05 00:53:05 +01:00
export R I O T P K G # For overriding RIOT's pkg directory
2018-02-02 10:43:28 +01:00
export R I O T T O O L S # Location of host machine tools
2015-02-05 10:03:05 +01:00
export R I O T P R O J E C T # Top level git root of the project being built, or PWD if not a git repository
2016-01-27 10:47:12 +01:00
export R I O T M A K E # Location of all supplemental Makefiles (such as this file)
2021-11-03 10:04:54 +01:00
export R I O T K C O N F I G # Location of all supplemental Kconfig files
2014-05-05 21:53:37 +02:00
export B I N D I R B A S E # This is the folder where the application should be built in. For each BOARD a different subfolder is used.
export B I N D I R # This is the folder where the application should be built in.
2023-05-04 12:05:06 +02:00
export R I O T _ T E S T _ H A S H _ D I R # The dir to generate the test-input-hash.sha1 file for checking if a test has changed, uses BINDIR by default.
2021-04-02 19:01:19 +02:00
export C A R G O _ T A R G E T _ D I R # This is the folder where Rust parts of the application should be built in.
2018-09-25 17:51:18 +02:00
export B U I L D _ D I R # This is the base folder to store common build files and artifacts, e.g. test results.
2015-04-29 20:50:18 +02:00
export A P P D I R # The base folder containing the application
2022-01-22 21:48:28 +01:00
export P K G _ P A T H S # List of absolute paths where packages of $(USEPKG) can be found
2017-02-25 15:41:22 +01:00
export P K G D I R B A S E # The base folder for building packages
2014-05-05 21:53:37 +02:00
2018-08-10 11:32:38 +02:00
export P Y T H O N P A T H # Python default search path for module filesi, with RIOT specific packages
2017-03-03 10:13:41 +01:00
export F E A T U R E S _ R E Q U I R E D # List of required features by the application
export F E A T U R E S _ P R O V I D E D # List of provided features by the board
export F E A T U R E S _ O P T I O N A L # List of nice to have features
2020-07-10 16:24:30 +02:00
export F E A T U R E S _ U S E D # List of features used
2024-02-16 20:38:25 +01:00
# TOOLCHAINS_SUPPORTED # List of supported toolchains by a CPU (gnu/llvm/...).
2018-08-12 12:26:31 +02:00
# TOOLCHAINS_BLACKLISTED # List of unspported toolchains for a module or an application.
2019-12-12 20:40:54 +01:00
export T O O L C H A I N # Base build toolchain, i.e. GNU or LLVM
2017-03-03 10:13:41 +01:00
2016-03-17 21:55:17 +01:00
export T A R G E T _ A R C H # The target platform name, in GCC triple notation, e.g. "arm-none-eabi", "i686-elf", "avr"
2023-05-20 19:53:00 +02:00
export T A R G E T _ A R C H _ L L V M # The target platform name, in LLVM triple notation, e.g. "arm-none-eabi"
2016-03-17 21:55:17 +01:00
export P R E F I X # The prefix of the toolchain commands, usually "$(TARGET_ARCH)-", e.g. "arm-none-eabi-" or "msp430-".
2014-05-05 21:53:37 +02:00
export C C # The C compiler to use.
export C X X # The CXX compiler to use.
2017-03-01 11:24:11 +01:00
export C C A S # The C compiler to use for assembler files, typically the same as CC.
2014-05-05 21:53:37 +02:00
export C F L A G S # The compiler flags. Must only ever be used with `+=`.
2019-08-27 17:05:37 +02:00
export C F L A G S _ C P U # CPU architecture specific compiler flags
2017-03-01 11:24:11 +01:00
export C X X U W F L A G S # (Patterns of) flags in CFLAGS that should not be passed to CXX.
2014-05-05 21:53:37 +02:00
export C X X E X F L A G S # Additional flags that should be passed to CXX.
2017-03-01 11:24:11 +01:00
export C C A S U W F L A G S # (Patterns of) flags in CFLAGS that should not be passed to CCAS.
export C C A S E X F L A G S # Additional flags that should be passed to CCAS.
2014-05-05 21:53:37 +02:00
export A S # The assembler.
export A S F L A G S # Flags for the assembler.
export L I N K # The command used to link the files. Must take the same parameters as GCC, i.e. "ld" won't work.
2020-06-24 09:43:58 +02:00
export N M # The command used to list symbols from objet files
export R A N L I B # The command used to generate an index to the contents of an archive
2019-01-23 17:17:50 +01:00
# LINKFLAGS # Flags to supply in the linking step.
2020-08-10 14:45:39 +02:00
export A R C H I V E S # List of archives to add in the linking step
2016-08-10 16:03:53 +02:00
export L T O F L A G S # extra CFLAGS for compiling with link time optimization
2019-07-15 19:32:26 +02:00
export O B J C O P Y # The command used to create the HEXFILE and BINFILE.
2014-05-05 21:53:37 +02:00
export O F L A G S # The parameter for OBJCOPY, e.g. to strip the debug information.
2016-02-23 23:55:58 +01:00
export O B J D U M P # The command used to create the assembly listing.
export O B J D U M P F L A G S # The parameter for OBJDUMP.
2014-05-05 21:53:37 +02:00
export S I Z E # The command to read to size of the ELF sections.
2018-04-26 11:18:15 +02:00
export S I Z E F L A G S # The optional size flags.
2018-01-26 19:32:42 +01:00
export UNDEF # Object files that the linker must include in the ELFFILE even if no call to the functions or symbols (ex : interrupt vectors ).
2015-07-21 07:05:14 +02:00
export W E R R O R # Treat all compiler warnings as errors if set to 1 (see -Werror flag in GCC manual)
2019-12-12 20:40:54 +01:00
export W P E D A N T I C # Issue all (extensive) compiler warnings demanded by strict C/C++
2019-11-14 13:51:45 +01:00
# EEPROM_FILE # (Native only!) file path where the content of the EEPROM is stored
2014-05-05 21:53:37 +02:00
2020-06-10 18:47:48 +02:00
# GITCACHE # path to git-cache executable
# GIT_CACHE_DIR # path to git-cache cache directory, only used with packages
2019-05-17 13:52:34 +02:00
# FLASHER # The command to call on "make flash".
2019-10-15 14:12:56 +02:00
# PROG_DEV # The device to connect the FLASHER and DEBUGGER
2019-05-17 13:52:34 +02:00
# FFLAGS # The parameters to supply to FLASHER.
2018-06-05 13:28:23 +02:00
export F L A S H _ A D D R # Define an offset to flash code into ROM memory.
2019-02-25 16:46:44 +01:00
# TERMPROG # The command to call on "make term".
# TERMFLAGS # Additional parameters to supply to TERMPROG.
2022-08-29 16:58:16 +02:00
# TERMENV # Environment variables passed to TERMPROG
2020-07-31 09:46:43 +02:00
# TERMLOG # Optional file to log "make term" output to.
# TERMTEE # Optional pipe to redirect "make term" output. Default: '| tee -a ${TERMLOG}' when TERMLOG is defined else undefined.
2018-06-18 15:16:51 +02:00
# PORT # The port to connect the TERMPROG to.
2014-05-05 21:53:37 +02:00
export E L F F I L E # The unstripped result of the compilation.
2019-03-01 15:29:57 +01:00
export H E X F I L E # The 'intel hex' stripped result of the compilation.
2019-07-15 19:32:26 +02:00
# BINFILE # The 'binary' stripped result of the compilation.
2019-03-01 15:48:02 +01:00
# FLASHFILE # The output file used for flashing
2019-09-25 10:35:33 +02:00
# BUILD_FILES # The list of files to be built
2019-05-17 13:52:34 +02:00
# DEBUGGER # The command to call on "make debug", usually a script starting the GDB front-end.
# DEBUGGER_FLAGS # The parameters to supply to DEBUGGER.
# DEBUGSERVER # The command to call on "make debug-server", usually a script starting the GDB server.
# DEBUGSERVER_FLAGS # The parameters to supply to DEBUGSERVER.
2023-06-10 00:04:56 +02:00
# DEBUGCLIENT # The command to call on "make debug-client", usually a script starting the GDB client.
# DEBUGCLIENT_FLAGS # The parameters to supply to DEBUGCLIENT.
2024-10-03 20:05:19 +02:00
export D E V E L H E L P # Set to 1 to spend ROM, RAM and CPU time for help during development (e.g. enable asserts())
2019-05-17 13:52:34 +02:00
# RESET # The command to call on "make reset", this command resets/reboots the target.
# RESET_FLAGS # The parameters to supply to RESET.
2021-02-11 15:21:45 +01:00
# PROGRAMMER # The programmer to use when flashing, resetting or debugging
# PROGRAMMERS_SUPPORTED # The list of programmers supported by a board
2021-02-09 18:00:57 +01:00
# PROGRAMMER_QUIET # Change verbosity of programmer output (only used with flash and reset targets).
# Default is 1, not verbose. Use 0 to get normal programmer output.
2021-04-28 08:42:09 +02:00
# USE_PROGRAMMER_WRAPPER_SCRIPT # Use the programmer wrapper Python script. Default is 0 (wrapper not used).
2021-02-09 18:00:57 +01:00
make: centralize wget/curl & unzip/7z feature test
With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and
`$(UNZIP_HERE)`.
The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with `tar xz`.
The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.
The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
`cd $(SOME_WHERE) &&`.
The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip"
takes the environment variable `UNZIP` as the source file, even if
another file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.
2014-07-16 00:29:18 +02:00
2017-02-23 17:34:32 +01:00
export D L C A C H E # directory used to cache http downloads
make: centralize wget/curl & unzip/7z feature test
With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and
`$(UNZIP_HERE)`.
The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with `tar xz`.
The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.
The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
`cd $(SOME_WHERE) &&`.
The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip"
takes the environment variable `UNZIP` as the source file, even if
another file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.
2014-07-16 00:29:18 +02:00
export D O W N L O A D _ T O _ F I L E # Use `$(DOWNLOAD_TO_FILE) $(DESTINATION) $(URL)` to download `$(URL)` to `$(DESTINATION)`.
export D O W N L O A D _ T O _ S T D O U T # Use `$(DOWNLOAD_TO_STDOUT) $(URL)` to download `$(URL)` output `$(URL)` to stdout, e.g. to be piped into `tar xz`.
export U N Z I P _ H E R E # Use `cd $(SOME_FOLDER) && $(UNZIP_HERE) $(SOME_FILE)` to extract the contents of the zip file `$(SOME_FILE)` into `$(SOME_FOLDER)`.
2018-08-07 16:13:17 +02:00
export L A Z Y S P O N G E # Command saving stdin to a file only on content update.
export L A Z Y S P O N G E _ F L A G S # Parameters supplied to LAZYSPONGE.
2019-05-28 10:43:17 +02:00
2022-12-15 13:17:42 +01:00
export F L A G S _ F O R _ A F L # Additional command-line flags passed to afl during fuzzing.
2020-01-17 17:01:31 +01:00
2019-05-28 10:43:17 +02:00
# LOG_LEVEL # Logging level as integer (NONE: 0, ERROR: 1, WARNING: 2, INFO: 3, DEBUG: 4, default: 3)
2020-07-27 18:16:11 +02:00
# KCONFIG_ADD_CONFIG # List of .config files to be merged used by Boards and CPUs. See kconfig.mk
2021-09-25 15:16:09 +02:00
# VERBOSE_ASSERT # Set to 1 to print the file and line of a failed assert when assertions blow
2021-04-03 17:33:14 +02:00
export R U S T _ T A R G E T # Rust's own version of the target triple / quadruple.
#
# It is set by the architecture (and thus eventually the CPU), and exported to
# be available when building Rust modules.