1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

552 Commits

Author SHA1 Message Date
Cenk Gündoğan
07c84a4fc3
Merge pull request #12840 from leandrolanzieri/pr/makefiles_remove_ccache_basedir
makefiles: Generate proper dependency files when using ccache
2019-12-02 11:40:36 +01:00
Leandro Lanzieri
d868c9c5c3 makefiles: Do not set CCACHE_BASEDIR environmental variable
When CCACHE_BASEDIR variable is set, ccache rewrites absolute paths into
relative paths before computing the hash that identifies the compilation
for all the paths under that directory.

The problem is that those paths are also used when the compiler is
called, so the generated dependency files (*.d) will have a relative
path to the object files, and thus, it will not match our rule for
compiling (we use absolute paths). As dependency files define the
targets this way, any change on its dependencies (e.g. an included
header file) will not re-trigger a build.
2019-11-28 15:40:22 +01:00
Gunar Schorcht
5e22de215d makefiles: fix LOG_LEVEL handling 2019-11-27 12:50:47 +01:00
b4da3b464f make: pass BLOBS to makefiles/application.inc.mk
For regular modules, adding files to BLOBS is sufficient to create the
corresponding headers.

Application modules are different, as they use a minimal makefile
(makefiles.application.inc.mk) to build, thus application level
variables are not available.

This commit makes Makefile.include pass BLOBS to the application
Makefile as APPLICATION_BLOBS, and application.inc.mk use that variable
as value for BLOBS.

The indirection is necessary so submakefiles (e.g., those visited by
DIRS) do not hard override BLOBS.
2019-11-18 17:53:48 +01:00
Francisco Molina
f9ebc8658f dist/tools/jlink: cleanup doc 2019-11-18 13:04:42 +01:00
Francisco
9352b88da4
Merge pull request #12417 from cladmi/pr/make/boards/cpu_cpu_model_to_features
Makefile.features: assert CPU is defined by BOARD/Makefile.features
2019-11-12 10:09:23 +01:00
benpicco
c9166c691c
Merge pull request #12435 from fhessel/fix-riotbuild-freebsd
Makefile.include: Fix call to sed for FreeBSD
2019-10-28 11:26:32 +01:00
Francisco
720d4bde4a
Merge pull request #12452 from aabadie/pr/make/fail_by_default_on_expect_errors
Makefile.include: fail by default when errors are expected
2019-10-23 10:47:36 +02:00
6ff2b6408a
Makefile.include: fail by default when errors are expected
The build can still be forced by adding WERROR=0 to the command line
2019-10-22 18:43:55 +02:00
Francisco Molina
45c8eafd42 Makefile.include: remove repeated OS declaration 2019-10-18 10:36:43 +02:00
Francisco Molina
de2ba4ff1a Makefile.include: get OS and OS_ARCH from UNAME 2019-10-18 08:46:51 +02:00
Francisco Molina
c010f59b8c Makefile.include: remove repeated OS declaration
- OS := $(shell uname) is already declared in `Makefile.include`
  re-declaring it means it will be re-evalauted multiple times
  uselessly.
2019-10-18 08:46:51 +02:00
Francisco
01779508d6
Merge pull request #12394 from aabadie/pr/make/iotlab_support_fix
make/testbed-support: fix error with FLASHFILE not defined
2019-10-17 23:21:12 +02:00
8a877b58df
Merge pull request #12479 from fjmolinas/pr_ensure_port_is_set
makefiles/tools/serial: ensure PORT is set and fail early.
2019-10-17 10:56:32 +02:00
Juan Carrano
fe9704dbd6 makefiles/tools/serial: ensure PORT is set and fail early.
By ensuring the PORT auto-detection worked, we can give meaningful
error messages and fail earlier.

This uses ensure_value from makefiles/utils/checks.mk. An include was
added to Makefile.include to make this fuction available to all other
makefiles.
2019-10-17 08:54:16 +02:00
8d0afb2d5a
Merge pull request #12468 from cladmi/pr/make/parallel_flash_test
Makefile.include:  TERMFLASHDEPS to TERMDEPS so it also applies to `test`
2019-10-16 11:46:18 +02:00
41a2249ec6
Makefile.include: include iotlab.single.inc.mk before checking FLASHFILE
This way FLASHFILE is either already defined by the board and, if not,
the default one for iotlab can be used.
2019-10-16 11:44:59 +02:00
6c7acf4188
Merge pull request #12453 from aabadie/pr/make/features_blacklisted
make: handle blacklisted features separately from missing requirements
2019-10-15 19:15:10 +02:00
benpicco
c9b76a9585
Merge pull request #12406 from maribu/pain_in_the_ass
examples: Moved CI infos to Makefile.ci
2019-10-15 14:40:40 +02:00
42f9689c7d
make: manage blacklisted features independently 2019-10-15 11:39:16 +02:00
Marian Buschsieweke
ba90ba2e2f
examples: BOARD_INSUFFICIENT_MEMORY -> Makefile.ci
- Decluttered Makefile by moving BOARD_INSUFFICIENT_MEMORY lists from Makefile
  to Makefile.ci
- Optimized the list for use of tools:
    - One entry per line reduces the number of merge conflicts
    - One entry per line allows alphabetical sorting e.g. via Vim's sort command
- Sorted all lists alphabetically
2019-10-15 09:55:07 +02:00
cc80961b5f make: allow feature based blacklisting (FEATURES_BLACKLIST) 2019-10-13 21:03:41 +02:00
Frank Hessel
ec869ebef9
Makefile.include: Fix call to sed for FreeBSD 2019-10-13 15:33:53 +02:00
cladmi
a37ce12fa3
Makefile.features: assert CPU is defined by BOARD/Makefile.features
CPU must now be defined by `$(RIOTBOARD)/$(BOARD)/Makefile.features` or
one of its common included Makefile.features file.
The cpu `Makefile.dep` file can now automatically be included when it exists.
2019-10-10 12:54:19 +02:00
Gaëtan Harter
18ae34609c
Makefile.include: put TERMFLASHDEPS in TERMDEPS
This makes it now apply also to `test` automatically.
2019-10-10 11:56:57 +02:00
Gaëtan Harter
4fe875c92f
Makefile.include/term: define 'flash/flash-only' as TERMFLASHDEPS
This puts the handling of `flash/flash-only` in common for both
`term/cleanterm` commands.
2019-10-10 11:55:43 +02:00
Gaëtan Harter
2c3c275694
Makefile.include: also do 'cleanterm' after 'flash-only'
Harmonize with `term`.
2019-10-10 11:52:20 +02:00
Francisco
1c5c027ee7
Merge pull request #12004 from cladmi/pr/make/dependencies/debug_targets
make: add targets to debug dependencies variables
2019-10-08 17:41:34 +02:00
Gaëtan Harter
58cf46c706
make: add targets to debug dependencies variables
Add a 'dependency-debug' and a 'DEPENDENCY_DEBUG=1' option for
'info-boards-supported' to save some variables used when resolving
dependencies.

Print some some 'sorted' variables to simplify comparing the actual value
when the parsing order changed.

This should help tracking changes introduced when refactoring the
dependency parsing.
2019-10-07 14:45:40 +02:00
5b265088fe
Makefile.include: use external setsid with debug target
Only when setsid is not provided by the system which is typically the case on MacOSX
2019-10-03 12:43:49 +02:00
Gaëtan Harter
baad72c44a
Makefile.include: allow sending newline with cleanterm
Disable repeating the command on empty line to allow sending empty
lines.
2019-10-01 14:13:02 +02:00
Gaëtan Harter
d27a43f89a
Makefile.include: add cleanterm target
It is similar to 'term' but with removing possible additional behaviors
from pyterm.

It currently removes the logging prefix.
2019-10-01 14:13:02 +02:00
Gaëtan Harter
3bfe30ae57
Makefile.include: only keep macros in riotbuild.h
Rely on creating an intermediate riotbuild.h.in file that is updated on
CFLAGS changes, but then generate 'riotbuild.h' without the comments.
The updated timestamp will still trigger a rebuild but not cause ccache
miss due to the content of the CFLAGS that contains absolute path.

This removes the caching issue due to the absolute path that was
added to `CFLAGS` and so the comment in that file.
2019-10-01 11:26:02 +02:00
Francisco
c215deb952
Merge pull request #12317 from aabadie/pr/make/iotlab_node_flash
Makefile.include: set default PROGRAMMER value when flashing on IoT-LAB
2019-10-01 09:46:55 +02:00
Gaëtan Harter
fbac80d357
Makefile.include: convert board/cpu macros with utils function
Convert *DEF variables to uppercase using the 'makefiles/utils' functions.
2019-09-30 17:25:24 +02:00
06123ef85b
Makefile.include: set default PROGRAMMER value when flahsing on IoT-LAB
This will avoid to load edbg logic and especially adds it to the list of FLASHDEPS: it won't be unnecessarily built when flashing a samr21-xpro/arduino-zero board on IoT-LAB
2019-09-30 16:16:43 +02:00
fe6d892969
Merge pull request #12302 from fjmolinas/pr_build_files
Makefile.include: add BUILD_FILES variable that holds all files to be built
2019-09-30 14:26:24 +02:00
Francisco Molina
ded2ebc8e7 Makefile.include: add BUILD_FILES
- Add BULD_FILES that holds all files that need to be built
  and linked.
2019-09-30 13:00:25 +02:00
68aae9c848
Merge pull request #12262 from cladmi/pr/cflags/fix_spaces_and_rebuild
makefiles: do not remove defines from CFLAGS
2019-09-28 09:42:56 +02:00
Gaëtan Harter
41d10cf005
makefiles: do not remove defines from CFLAGS
Do not remove the '-D' and '-U' values from CFLAGS.
This prevents issues where a '-D' could contain a space.

Some values way be duplicated from the 'riotbuild.h' header and the
command line but with the same value so without conflict.

To not put too many things in the command line, the -DMODULE_NAME are
only put in CFLAGS_WITH_MACROS.

Also, as now, the deferred value of CFLAGS is used for 'riotbuild.h',
macros set after the inclusion of `Makefile.include` will be taken into
account.
2019-09-27 19:29:06 +02:00
Francisco Molina
ab12e292af Makefile.include: add flash-only as pre-requisite of term 2019-09-26 10:06:28 +02:00
Sebastian Meiling
7bbdb74981
Merge pull request #10554 from jcarrano/make-minimum-version
Makefile.include: require make version 4.
2019-09-23 23:13:50 +02:00
Juan Carrano
9289fee618 Makefile.include: require make version 4.
Old versions of GNU Make (especially on OSX) are a pain to deal
with. This commit introduces a warning when such an old version
is found. The goal is the future the warning will be turned into
an error.

2020.01 is set as the date we remove support.

Complying with version 4.x is easy on OSX by using homebrew, and
on Linux, even Debian stable has the required version.
2019-09-23 18:54:19 +02:00
Gaëtan Harter
a019faaedd
Makefile.include: use an os independant 'relpath'
This should now work on 'osx'.
2019-09-16 15:52:36 +02:00
Juan Carrano
d9132eec90 Makefile.include: add rule to verify thin archives.
This adds a new target "archive-check".

Thin archives should be created with relative paths so that archives created
in a build container are useful in the host. This check ensures there are no
absolute paths inside thin archives.
2019-09-10 11:21:42 +02:00
Gaëtan Harter
765f3e9327
makefiles/utils: functions for lowercase and uppercase
Add make only function to convert strings to lowercase and uppercase.
This can replace the `$(shell echo $(var) | tr 'a-z-' 'A-Z_')` pattern.
Using the 'make' implementation results in being around 100 times faster.
2019-08-29 13:59:31 +02:00
Juan I Carrano
a4a1dc4dfe
Merge pull request #11771 from cladmi/pr/make/remove_riot_version_override
Makefile.include: remove RIOT_VERSION_OVERRIDE
2019-08-20 16:54:24 +02:00
Gaëtan Harter
ce8d10c945
makefiles: end of 'FLASHFILE' transition phase
* Remove the transition documentation.
* assert that FLASHFILE is now defined
2019-08-19 16:30:10 +02:00
Gaëtan Harter
4ebf3dcb7c
makefiles: update FLASHFILE possible values
Update the documentation to say it can also be 'ELFFILE'
The first version was setting it to EFLFILE by default but the default
behavior was removed to prevent hiding errors.

It can also be overwritten for application specific needs, like when
using 'riotboot'.
2019-08-19 16:30:10 +02:00
Gaëtan Harter
a048001e96
makefiles/buildtest: add a buildtest-indocker
Add a 'buildtest-indocker' that forces executing 'buildtest' for loop
completely inside the container.
It prevents starting one container per compilation wich is slower but
it could hide errors where the host toolchain would be used

It is currently equivalent to `buildtest` but will change when the
`buidtest` handling will be move outside of `BUILD_IN_DOCKER`.

Display an error when executed without BUILD_IN_DOCKER=1.
2019-08-14 17:02:35 +02:00
Gaëtan Harter
e04850b27b
Makefile.include: remove RIOT_VERSION_OVERRIDE
RIOT_VERSION is not used for building a specific RIOT version anymore
since #10543. The variable can now be used directly.
Add deprecation warning.
2019-08-12 16:28:19 +02:00
Gaëtan Harter
8859e1e1d9
Makefile.include: Only evaluate RIOT_VERSION when needed
This changes CFLAGS_WITH_MACROS to be:

* a deferred variable
* not exported so only evaluated when actually used

The value is only used by `Makefile.include` and `makefiles/eclipse.inc.mk`
so not required to export it.
2019-07-22 12:03:05 +02:00
Gaëtan Harter
cfd4677315
Makefile.include: use GIT_VERSION for RIOT_VERSION
Use 'GIT_VERSION' for 'RIOT_VERSION'.

This prevents evaluating 'git describe' and 'git rev-parse' when their
value is not used.
2019-07-22 12:01:18 +02:00
Gaëtan Harter
37e72e13ca
Makefile.include: do not build HEXFILE by default anymore
All boards must now use FLASHFILE
2019-07-15 19:15:58 +02:00
Francisco
827d2d9333
Merge pull request #11697 from kaspar030/pr/murdock_allow_multiple_files_for_test_job
murdock: allow multiple files to be sent along with a test job
2019-07-14 14:54:00 +02:00
a214ba493d murdock: allow multiple files to be sent along with a test job
Previously, this was hard-coded to allow one file, hard-coded to be
called "flash file".
This commit allows multiple files to be specified via adding them to the
TEST_EXTRA_FILES variable. All files will be stored in the worker's
application bin directory.

Also, the existence check has been removed, as dwqc bails out on missing
file anyways.
2019-07-13 11:57:53 +02:00
4e051f8592 make: make use CLEAN in Makefile.include 2019-07-12 15:22:48 +02:00
cb8e335c29 make: introduce $(CLEAN)
Currently, some targets are serialized before "clean" by conditionally
adding a dependency.

Make does allow ordering using "|" syntax in prerequisites, but for
"clean" that would always trigger the clean target.
By only conditionally setting $(CLEAN) to clean, that can be
circumvented.

The new CLEAN allows any recipe to be run after "clean" by specifying "|
$(CLEAN)" as prerequisite.
2019-07-12 15:22:48 +02:00
Gaëtan Harter
c9666b5d23
Merge pull request #11762 from kaspar030/add_termdeps_target
make: add termdeps target
2019-07-04 11:57:34 +02:00
6d22f942f7 make: introduce "termdeps" target 2019-07-01 19:58:54 +02:00
Gaëtan Harter
376b09b875
Makefile.features: include CPU/Makefile.features when CPU is defined
Prepare for when boards define `CPU` in `BOARD/Makefile.features`.

Include '$(RIOTCPU)/$(CPU)/Makefile.features' directly when it is
defined. This will allow removing the file inclusion from the
`BOARD/Makefile.features`. The board must then not include it directly.

Transitional change to allow migrating part by parts.

Part of moving CPU/CPU_MODEL definition to Makefile.features to have it
available before Makefile.include.
2019-07-01 17:23:14 +02:00
Juan I Carrano
50ea0d822c
Merge pull request #11664 from cladmi/pr/make/variables_lazy_evaluation
makefiles/utils/variables: add functions to help managing variables
2019-06-28 17:11:29 +02:00
Gaëtan Harter
25a1bc48bb
makefiles/utils: include in Makefile.include
Import utils functions in Makefile.include to allow using them.
2019-06-28 11:34:43 +02:00
Francisco
ff317f2221
Merge pull request #11492 from cladmi/pr/features/declarative
Makefile.features: add declarative FEATURES_ variables definition
2019-06-14 18:03:24 +02:00
Gaëtan Harter
6130918ca8
Makefile.include: use the variables from makefiles/boards.inc.mk
BOARDS is defined, so the `find` line in `makefiles/info-global` is not
needed anymore.
2019-06-07 16:32:04 +02:00
166ed18939
make: add LOG_LEVEL to overridable variables 2019-05-28 22:49:04 +02:00
Gaëtan Harter
6d7a70b16b
Makefile.features: declare FEATURES_CONFLICTING and make use of it
Define a variable for used features that conflict and use it in
`Makefie.include`.

It was not used by `info-global.inc.mk` and is still currently not.
2019-05-28 19:21:53 +02:00
Gaëtan Harter
e1c60ead36
Makefile.features: declare FEATURES_MISSING and make use of it
Put the definition of `FEATURES_MISSING` in common and use the variable
instead of duplicating code.
2019-05-28 19:21:53 +02:00
Gaëtan Harter
700b5fb835
makefiles: Update FEATURES_OPTIONAL meaning
Update the FEATURES_OPTIONAL meaning to be more in line since
FEATURES_USED is defined. Handle FEATURES_OPTIONAL as a configuration from
the BSP/build that should not be changed anymore after.

`FEATURES_OPTIONAL` are by definition optional so are not supposed to
cause a build to fail.
Only the 'REQUIRED' ones that are not 'PROVIDED' are 'MISSING'.

* Do not change FEATURES_OPTIONAL to remove REQUIRED features
  * Prepare for having a different variable for the previous value
* Update dependency resolution/info-build as FEATURES_OPTIONAL cannot be missing
2019-05-28 19:21:53 +02:00
Gaëtan Harter
545a5f74aa
Merge pull request #11433 from cladmi/pr/make/flash_recipe/allow_overriding
Makefile.include: allow overwriting flash-recipe
2019-05-28 14:45:47 +02:00
Gaëtan Harter
13de591a95
Makefile.include: allow overwriting flash-recipe
This allows changing the flashing commands from the outside or in a BSP.
2019-05-13 19:42:07 +02:00
Gaëtan Harter
7d326e663b
Makefile.features: add a common file for the features parsing
This will allow sharing it between Makefile.include and
makefiles/info-global.inc.mk.

Also some common variables definition can also be moved to here.

Part of moving CPU/CPU_MODEL definition to Makefile.features to have it
available before Makefile.include.
2019-05-02 17:45:51 +02:00
Martine Lenders
0eba62e5b0 make: don't execute tilde files on test target
My system (Ubuntu 16.04) creates a backup when opening a file with
`vim`. This backup is called `filename~`. Due to it being a copy of the
file before opening, it also is executable, which is why it is selected
for execution with the `make test` target.

This change makes the `TESTS` macro exclude files ending in `~`. This
way files ending in `~` are not executed with `make test`.

Since e.g. projects like NextCloud are excluding such files also from
their sync [[1]], I think this is fine.

[1]: d7b881feb6/sync-exclude.lst (L3)
2019-04-17 19:48:35 +02:00
6e5c56608f make: add test-input-hash target 2019-04-04 13:37:36 +02:00
Gaëtan Harter
ec4d83727a
Makefile.include: add a 'test/available' target
This allows querying the build system if there are test available.

Before, one should rely on 'info-debug-variable-TESTS' to print the list
of test files. But was not reliable as sometime the build system printed
messages anyway.

    BOARD=esp32-wroom-32 make --silent --no-print-directory \
        -C examples/hello-world/ info-debug-variable-TESTS
    ESP32_SDK_DIR should be defined as /path/to/esp-idf directory
    ESP32_SDK_DIR is set by default to /opt/esp/esp-idf
    # empty line here

Now the return code can be trusted.
2019-03-25 16:17:26 +01:00
Gaëtan Harter
45e1b47b26
Makefile.include: declare 'test' PHONY 2019-03-25 16:16:25 +01:00
MichelRottleuthner
3427dcd168
Merge pull request #10961 from MrKevinWeiss/pr/addshellcommands
sys/app_metadata: Add a shell command to print application metadata
2019-03-06 13:36:14 +01:00
MrKevinWeiss
0738084657 Makefile: add APPLICATION to macro defines
This allows the application code to know what application it is running
2019-03-05 14:00:41 +01:00
Gaëtan Harter
ecfdece104
Makefile.include: include 'riotboot.mk' before using FLASHFILE
Include the 'riotboot.mk' file before using FLASHFILE/ELFFILE/HEXFILE
variables. This will allow setting variables to values from riotboot.mk
like `FLASHFILE = $(RIOTBOOT_COMBINED_BIN)` before it is evaluated in
Makefile.include.

It should be included after defining 'BINFILE' for 'riotboot.bin'
handling.
2019-03-05 11:22:11 +01:00
Gaëtan Harter
1d268c4cdb
Makefile.include: introduce FLASHFILE
Introduce FLASHFILE variable to start migrating boards to use it.

This is the file that will be used for flashing.
Boards do not currently use it but will migrated in upcoming PRs.
2019-02-28 18:11:49 +01:00
Gaëtan Harter
434328debf
Makefile.include: append the values to GLOBAL_GOALS
This allows setting other GLOBAL_GOALS by setting it before.
This could be the case for the application `Makefile` or files parsed
from `RIOT_MAKEFILES_GLOBAL_PRE`.
2019-01-18 16:40:16 +01:00
bb97c05b36
Merge pull request #10543 from jcarrano/no-building-with-different-version
Makefile.include: remove functionality to build with another version.
2019-01-17 15:55:07 +01:00
Gaëtan Harter
61452669b9
Merge pull request #10038 from smlng/pr/make/buildoutdir
make: introduce common BUILD_DIR
2019-01-16 14:18:48 +01:00
5aa3a2b4b7 make: handle disabled default modules before dependencies 2019-01-10 11:59:28 +01:00
smlng
5b3d26453a make: introduce BUILDOUT_DIR
This introduces a new environment variable for a common directory
that holds all output of the build process, such as application or
package binaries. This would also allow to easily redirect output
to any other location, e.g. for out-of-source builds.
2019-01-07 21:16:36 +01:00
Francisco Acosta
281d8084bf riotboot: add riot-based minimal bootloader
riotboot is introduced here and makes use of riotboot_hdr,
which indentifies the images encapsulated as slots.
The slot size and offset is configurable, which makes
slots extendable if needed, e.g. 2 or more slots can be
transparently added.

Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
Co-authored-by: Gaëtan Harter <gaetan.harter@fu-berlin.de>
2018-12-18 19:31:35 +01:00
Gaëtan Harter
321dc5292f
Merge pull request #10548 from jcarrano/flash-canned-recipe
Makefile.include: flash: do not peek into MAKECMDGOALS.
2018-12-18 14:09:55 +01:00
Juan Carrano
ae524e917f Makefile.include: flash: do not peek into MAKECMDGOALS.
When flash-only was introduced (in #8373), the `flash` rule was
made conditionally dependent on `all` by looking for `flash-only`
in MAKECMDGOALS. This was done to avoid code duplication.

There's a cleaner way, by using canned recipes. When we upgrade the
requirements to gnu make 4, the flash recipe can be defined as ?=.
2018-12-18 13:15:50 +01:00
Juan Carrano
8945a9513e Makefile.include: remove rule to remake PKGs' Makefile.include
This rule is not being used, it complicates the makefile and causes
make clean to permform unnecessary actions.

All packages have a Makefile.include, so the rule is not needed anyways.
Also, it is defined with a double colon for no reason.
2018-12-07 17:49:22 +01:00
Kevin "Bear Puncher" Weiss
35626eda50
Merge pull request #10270 from cladmi/pr/make/pre_post_include
Makefile.include: allow specifying makefiles to be parsed
2018-12-07 17:42:21 +01:00
Gaëtan Harter
efddd4aef9
Makefile.include: allow specifying makefiles to be parsed
This allows specifying a list of files that should be parsed by make at
the beginning and at the end of Makefile.include.

It is a generic mechanism to allow specifying system wide configuration:

* Globally overwrite the 'TERMPROG'
* Specify a hard written port / debug_adapter_id for some BOARD values
* Define you own specific targets
* Override default targets

It can include file before and after Makefile.include to allow handling
different configurations.
2018-12-06 14:49:34 +01:00
Gaëtan Harter
135d2f7fba
Makefile.include: building in docker should be done after clean
When building in parallel, clean is done at the same time as the
container starts building.

So the parallel `clean all` handling should also be done for the
`..in-docker-container` target.
2018-12-06 12:34:22 +01:00
Juan Carrano
e666c3864c eclipse.inc.mk: Split eclipse support into it's own file.
To keep Makefile.include clean and to be consistent with other tools,
the Eclipse IDE support is put in a separate file.
2018-12-05 15:22:42 +01:00
Juan Carrano
4589c3b8d3 Makefile.include: remove functionality to build with another version.
Makefile.include contained logic to clone a different RIOT version and
build the application against it. This can be easily achieved by making
a git worktree and overriding RIOTBASE, without adding any complexity
to our makefiles. Therefore, the feature is being removed.
2018-12-04 16:18:07 +01:00
Gaëtan Harter
2fc5ad6bae
Merge pull request #10302 from cladmi/pr/make/docker/fix_riotproject_is_appdir
Makefile.include: Fix BUILDRELPATH when RIOTPROJECT is CURDIR.
2018-11-01 09:46:33 +01:00
Gaëtan Harter
a5b2af1baf
Makefile.include: Fix BUILDRELPATH when RIOTPROJECT is CURDIR.
This fixes building an example that is outside of RIOT with docker and
also fixes building from a release archive.
2018-10-30 17:16:07 +01:00
Gaëtan Harter
f82ace910f
Makefile.include: Fix default RIOTBASE when there is Makefile.local
When an application only includes Makefile.include without specifying
RIOTBASE and uses a `Makefile.local` file, RIOTBASE would use a wrong
default value and get the value of the directory where `Makefile.local` is.
2018-10-30 17:08:57 +01:00
smlng
7d1bf26128 build: remove hostname from RIOT_VERSION string
The hostname does not provide any additional or necessary information to
the RIOT_VERSION string. On the contrary, some might consider the hostname
as personal information, which should not be exposed unsolicitedly.
2018-10-29 09:02:47 +01:00
Gaëtan Harter
357a4a0db9
makefiles: make the build system aware of GIT_CACHE_DIR
Currently the default value was set by `dist/tools/git/git-cache`.
This moves/duplicates the default value in the build system.
2018-10-23 15:00:47 +02:00
Gaëtan Harter
6b534a935f
make: process include and dep for external modules
Process `Makefile.include` for external modules. It is included after the others
so it could overwrite some of the configuration if wanted.

Process `Makefile.dep` for external modules. It is included before the others so
it could be parsed before setting 'default' values to dependencies.
2018-10-23 13:22:25 +02:00
cladmi
d809d82b91
Makefile.include: sanity check that cpu Makefile.features is used
This prepares for being able to always include Makefile.features
globally. It prevents new board for missing this until it is done.
2018-10-11 17:12:47 +02:00
cladmi
4652cb2b28
Makefile.include: Replace pkg archive file targets by phony targets
It fixes issues with the current rule that it is wrong that each
`$(BINDIR)/pkgname.a` is built by going in the package directory:

* `nordic_softdevice_ble.a` is built using `DIRS` and so the
  `$(APPLICATION_MODULE).a` target.
* It prevents having packages that are pseudomodules, which may be
  required to only use one "library" part of a package.

It also simplifies handling changes in 'ld -r' PR that could produce
objects instead of archives for packages.

Limitation of the current implementation
----------------------------------------

It removes rules being 'file' target and makes them depend on `.PHONY`
targets so always forces re-build.
But having a file target whose file is silently generated by another
target does not trigger a rebuild in Make.

They may have been declared as `order-only` prerequisites but as there are
some edge-cases that may not always work and does not currently add anything,
it was decided to keep them as normal prerequisites until it can be
globally solved.
2018-09-20 15:47:42 +02:00
cladmi
8a6771ac50
Makefile.include: do not create BINDIR for usepkg build
BINDIR has already have been created by `pkg-prepare` and the real build
directory for the package will be created by the make target itself.
2018-09-20 14:20:54 +02:00
cladmi
e082ee6766
Makefile.include: add a target name in usepkg build target
Explicit the target name so the stem can be extracted.
2018-09-20 14:20:29 +02:00
cladmi
5f3d0eab4d
Makefile.include: also detect features and blacklist on flash
Now also print warnings if there are missing features or a blacklisted
board when doing 'make flash'

Before, only when doing 'make' or 'make all' the FEATURES_REQUIRED,
BOARD_BLACKLIST/WHITELIST and TOOLCHAINS were checked and a warning was printed.

However as 'flash' triggers 'all' it is a common case to do 'make flash'
directly instead of 'make all flash'. So better also print warnings in
this case.
2018-09-18 16:19:03 +02:00
cladmi
19e1731993
Makefile.include: always include board Makefile.features
makefiles/info-global.inc.mk already includes this file unconditionally.
So it is misleading to say it is optional.
2018-09-10 18:33:45 +02:00
adb25fb075 make: add global test target 2018-09-07 15:13:08 +02:00
Gaëtan Harter
cc63d2d21c
genconfigheader: use lazysponge for file management
Remove file management from `genconfigheader` script and use `lazysponge` in
Makefile.include.

Use --verbose option when in non QUIET building mode.
2018-08-20 11:34:55 +02:00
Gaëtan Harter
94f2a499a3
make: add LAZYSPONGE and LAZYSPONGE_FLAGS variables 2018-08-20 11:34:52 +02:00
Gaëtan Harter
623e3e156d
Merge pull request #9730 from miri64/make/enh/toolchain-supported-list
make: provide support for listing supported and blacklisting toolchains
2018-08-16 17:11:26 +02:00
Martine Lenders
814a7c3a21 Makefile.include: add output for unsupported toolchains
Assuming `TOOLCHAIN_SUPPORTED` is provided by the board and
`TOOLCHAIN_BLACKLIST` by a module or `pkg`, this outputs the fact that
a toolchain is not supported or blacklisted in a similar manner as
(un-)supported features and boards are.
2018-08-16 16:41:58 +02:00
Joakim Nohlgård
dda55731ff Makefile.include: Remove -Wno-implicit-fallthrough 2018-08-14 10:20:37 +02:00
Joakim Nohlgård
9e5dd332cf Makefile.include: Set CCACHE_CPP2 to fix false warnings 2018-08-14 10:20:14 +02:00
Gaëtan Harter
67e3b3a8dd
Merge pull request #9761 from cladmi/pr/release/version
Makefile.include: Include VERSION file for release
2018-08-10 16:49:17 +02:00
Gaëtan Harter
5c9213dfc6
Makefile.include: Include VERSION file for release
When downloading the release archive and building an example, the RIOT_VERSION string is not set to "Version 2018.04" but to
    
    Version: UNKNOWN (builddir: /home/me/Downloads/RIOT-2018.04)

This allows sourcing a global VERSION file to manually set it before releases.
2018-08-10 16:15:56 +02:00
smlng
68a6ba8987 make: introduce common Python lib path
Introduce dist/pythonlibs directory to store RIOT python packages.
This directory is exported via PYTHONPATH by the build system to
make it commonly available.
2018-08-10 11:37:43 +02:00
Juan Carrano
2ba8683315 Makefile.include: Make config header FORCE instead of PHONY. 2018-07-25 12:35:06 +02:00
Juan Carrano
c60a06b058 Makefile.include: Make eclipsesym.xml FORCE (not PHONY). 2018-07-25 12:35:06 +02:00
Juan Carrano
b86a326de6 Makefile.include: Make archives FORCE instead of PHONY. 2018-07-25 12:35:06 +02:00
Juan Carrano
8667758cb0 Makefile.include: make pkgs Makefile.include FORCE instead of PHONY
The rule to rebuild the Makefile.include(s) should be removed at some
point.
2018-07-25 12:35:06 +02:00
Juan Carrano
5ce0720bcf Makefile.include: Explain usage of FORCE and PHONY. 2018-07-25 12:35:06 +02:00
Martine Lenders
ff46796002 make: make BUILDRELPATH dependent on selected path
When selecting a directory to build using `-C` with make
`BUILD_IN_DOCKER` will fail, because the `BUILDRELPATH` chooses the path
`make` is executed in, not the path selected by `-C`. This fixes this
bug by replacing `PWD` in the macro's definition with `CURDIR`.
2018-07-16 15:15:04 +02:00
Gaëtan Harter
82c8d69f34
Makefile.include: remove debug '$(info)'
Remove debug '$(info)' added by https://github.com/RIOT-OS/RIOT/pull/9451
2018-07-10 18:37:06 +02:00
Gaëtan Harter
17545e4389
Merge pull request #9002 from cladmi/pr/makefiles/builddeps
make: Add 'BUILDDEPS' variable
2018-07-10 18:22:32 +02:00
smlng
98c02b8045 make: fix dedup USEMODULE_INCLUDES in Makefile.include
Fixes a regression introduces #9479 which breaks building on macOS.
    The introduces `uniq` function is never called, hence the includes
    ie. USEMODULE_INCLUDES are not used.
2018-07-10 15:41:33 +02:00
Cenk Gündoğan
202e73dcdf make: dedup USEMODULE_INCLUDES w/o shelling out
Currently, `USEMODULE_INCLUDES` is deduplicated using a combination of
`tr` and `awk`. The proposed method achieves a deduplication (no
sorting) without the need to shell out by using make internals only.
2018-07-09 15:06:38 +02:00
Gaëtan Harter
61f13baf14
Makefile.include: set pkg-prepare as BUILDDEPS
Use BUILDDEPS to define pkg-prepare dependency
2018-07-06 18:56:46 +02:00
Gaëtan Harter
2f41244adc
Makefile.include: set APPDEPS as BUILDDEPS
Use BUILDDEPS to define the APPDEPS dependency
2018-07-06 18:56:43 +02:00
Gaëtan Harter
ba83f1c9c6
Makefile.include: set RIOTBUILD_CONFIG_HEADER_C as BUILDDEPS
Use BUILDDEPS to define the RIOTBUILD_CONFIG_HEADER_C dependency
2018-07-06 18:56:39 +02:00
Gaëtan Harter
fb10a181a0
make: Add 'BUILDDEPS' variable
BUILDDEPS are files / make targets that should be build before compiling.
It can include packages source download, generating headers, modules.

It is the equivalent of `APPDEPS` but not limited to the application.
It cannot be done right now with `APPDEPS` as it is used in `BASELIBS` and
fixing it requires changing mips using it for source files.
2018-07-06 18:56:33 +02:00
Gaëtan Harter
534b0da9a5
Merge pull request #9451 from cladmi/pr/make/makefile_include/define_baselibs
Makefile.include: fully define BASELIBS before using its value
2018-07-05 13:37:27 +02:00
Gaëtan Harter
90fdd09176
Makefile.include: detect if BASELIBS changed after its first use 2018-07-04 10:23:05 +02:00
Gaëtan Harter
fb27a801af
Makefile.include: process pkg/*/Makefile.include before using BASELIBS
They can define PSEUDOMODULES which is used to populate BASELIBS.
It means they must be processed before using BASELIBS immediate value.

This moved the processing of all `Makefile.include` before using `BASELIBS`.
It is also moved before setting `BASELIBS` in `modules.inc.mk to keep the
order logical (it would work anyway thanks to deferred variables evaluation).

This fixes the problems for `make -C tests/unittests`
2018-07-04 10:22:57 +02:00
Gaëtan Harter
d8a264312c
Makefile.include: process 'modules.inc.mk' before using BASELIBS
Build targets were using the immediate value of '$(BASELIBS)' before it was
actually set. bindist.inc.mk should also be processed before as it is adding
`BIN_USEMODULE` to `USEMODULE`.

This fixes use before define problems for:

 * `make -C examples/hello-world`
 * `make -C examples/bindist`
2018-07-04 10:20:49 +02:00
Gaëtan Harter
f7f2494426
Makefile.include: fix board/cpu inconsistent include order
Include order for board and cpu was

1. cpu include
2. board include
3. board common includes
4. cpu common includes

Its now changed to:

1. board include
2. board common includes
3. cpu include
4. cpu common includes

Verifications:

There are no common headers names between boards and cpus.
Except native that has a 'periph_conf.h' in cpu instead of being in board.
2018-07-04 09:20:01 +02:00
Joakim Nohlgård
b36afc3964 make: Clean up WERROR handling 2018-06-26 12:50:02 +02:00
Gaëtan Harter
acef97aa15
Merge pull request #9243 from cladmi/pr/warning/missing_include_dirs
makefiles/cflags.inc.mk: add -Wmissing-include-dirs flag
2018-06-18 13:13:54 +02:00
Gaëtan Harter
3bba0c5895
makefile.iotlab.single: add IoT-LAB testbed support for one node
Add support to do flash/reset/term on an IoT-LAB node.
It also allow running test using 'testrunner'.

Configuration variables are:

* `IOTLAB_NODE` which should be set to your node url
  * The full url including site to use from your computer `m3-1.grenoble.iot-lab.info`
  * The short url when used on the IoT-LAB frontend `m3-1`
* `IOTLAB_EXP_ID` for your experiment id for flash and reset.
  By default it tries to use your currently running experiment if you have only one
* `IOTLAB_USER`: is read from `${HOME}/.iotlabrc` as saved by `iotlab-auth`
  * It is expected to have run `iotlab-auth` beforehand.
2018-06-15 15:37:18 +02:00
Gaëtan Harter
d44e4c1f7f
Makefile.include: only use board include directory if it exists
Some boards do not have a boards/BOARD/include directory and rely on a
board/common one.
2018-06-12 14:08:13 +02:00
Gaëtan Harter
98d33a5eca
Makefile.include: use RIOTTOOLS variable 2018-05-09 18:01:44 +02:00
smlng
a83d53f2d9
make: add and export RIOTTOOLS directory
Replacing usage will come in further commits/PRs.
2018-05-03 15:56:00 +02:00
Josarn
1dd7ac0575 Makefile.include: add SIZEFLAGS 2018-04-27 12:23:06 +02:00
Gaëtan Harter
94214cdcae Makefile.include: fix missing target for libraries
Unittests add libraries in 'BASELIBS' which do not have any rules to be built as
they are built by 'application.inc.mk', packages and the DIRS variable.
So make complains about missing target for the unittests archives.

The fix tells these files are generated when building '$(APPLICATION_MODULE).a'.

The bug was introduced by #8844

Fixes #8910
2018-04-16 12:54:41 +02:00
cladmi
45dad9a9d1 Makefile.include: check FEATURES_CONFLICT against FEATURES_USED
The FEATURES_CONFLICT check should be done on used features to also
test for included optional features.
2018-04-11 17:45:41 +02:00
cladmi
ae5e883bca Makefile.include: add targets to get .elf/.bin/.hex 2018-04-09 17:32:46 +02:00
cladmi
70c5079b16 Makefile.include: add %.hex and %.bin rules
Replace HEXFILE rule by a rule for each type.
HACK: Adding '-Oformat' after OFLAGS overwrite the value in flags.
2018-04-09 17:32:46 +02:00
Gaëtan Harter
f64de068b3 Makefile.include: separate link in subtargets
* Add ELFFILE, HEXFILE, print-size targets

$(BINDIR)/$(APPLICATION_MODULE).a target builds libraries in RIOT and in DIRS.

Uses a FORCE phony target dependency to force rebuilding but still let
`make` use the file modification timestamps
2018-04-09 16:50:53 +02:00
Gaëtan Harter
a83c8d220d Makefile.include/OSXNATIVE: refactor into _LINK
Refactor osx-native linker rule into `_LINK` too.
2018-04-09 16:50:52 +02:00
35c73c83d0 make: add test-murdock target 2018-03-28 18:28:42 +02:00
Gaëtan Harter
655186c986 Makefile.include: rm deprecated comment on default goal 2018-03-28 17:32:11 +02:00
Gaëtan Harter
92535234a2 Makefile.include: add an assert that .DEFAULT_GOAL is all 2018-03-28 16:59:00 +02:00
Gaëtan Harter
fff5810191 Makefile.include: FIX .DEFAULT_GOAL not being all
.DEFAULT_GOAL was reset many times which removed 'all' from being the default
goal.
By chance it was then set to `link` so was working by some magic.
2018-03-28 16:59:00 +02:00
Gaëtan Harter
fce7a5409d Makefile.include: refactor command present check
Refactor the code checking if command is present.
Message is taken from the compiler check as it was more precise than the others.
2018-03-27 15:46:48 +02:00
61f1b941ce make: replace curly braces with parenthesis 2018-03-22 20:43:15 +01:00
Francisco Acosta
2e066e8693
Merge pull request #8492 from cladmi/pr/prepend_app_module_by_application
makefiles: Add an APPLICATION_MODULE variable
2018-02-28 12:13:14 +01:00
Jose Alamos
67cbcfb588 make: add flag for no-implicit-fallthrough in CXXFLAGS 2018-02-22 14:28:22 +01:00
Joakim Nohlgård
745f1fc38f
Merge pull request #8365 from beduino-project/fix-clang-5.0-build
makefiles: always link with GCC even if TOOLCHAIN is set to LLVM
2018-02-21 15:13:57 +01:00
Sören Tempel
55b026b349 Makefile.include: Introduce LINKXX variable
This variable can be used to specify the linker which should be used to
link C++ object files. This is needed in order to use g++ for linking
with TOOLCHAIN=llvm.
2018-02-21 12:26:20 +01:00
1c091cc462 make: always set -Wno-implicit-fallthrough 2018-02-20 15:45:18 +01:00
smlng
c4194d4ba9 make: add flash-only target 2018-02-13 17:21:28 +01:00
Gaëtan Harter
d724e71a26 makefiles: Add an APPLICATION_MODULE variable
Set the application module name with APPLICATION_MODULE.
The default module name is "application_$(APPLICATION)".

This should fix name conflicts where an application/test has the same name as
an existing module and so both write to the same archive.
2018-01-30 17:27:03 +01:00
Joakim Nohlgård
33d73d3e5a Makefile.include: Remove --cref from linking flags
Seem to cause internal linker errors and linker segfaults under some
circumstances when using gold as the linker.
2017-12-08 12:02:10 +01:00
smlng
57c5c9b6a6 make: enable Wall and Wextra by default, and optionally Wpedantic 2017-11-28 20:33:39 +01:00
Martine Lenders
16e2829258
Merge pull request #7959 from antmicro/feature/renode-integration
makefiles: tools/renode: add support for Renode
2017-11-24 18:43:31 +01:00
smlng
a7bc9afc4b make: allow for DEVELHELP env variable 2017-11-20 15:56:36 +01:00
Piotr Zierhoffer
b424274a72 makefiles: tools/renode: add support for Renode 2017-11-08 12:43:09 +01:00
268e763d63 make: move mcuboot related stuff to makefiles/mcuboot.mk 2017-11-07 12:28:41 +01:00
8965e9e26c make: make features available to Makefile.include 2017-11-06 12:01:19 +01:00
625d2449d8 make: fix nproc for buildtest 2017-09-20 21:07:11 +02:00
daa277b36e make: refactor info- and buildtest targets 2017-09-14 13:15:53 +02:00
Hauke Petersen
29ee609a2f Merge pull request #7266 from kaspar030/pkg-prepare
make: introduce pkg-prepare target
2017-08-29 17:53:35 +02:00
kYc0o
0dfcc72343 Makefile.include: add multislot makefile 2017-07-06 23:26:56 +02:00
93fb2cee47 make: introduce pkg-prepare target 2017-06-28 14:34:23 +02:00
d69352a237 dist/tools: add dlcache.sh 2017-06-17 17:00:55 +02:00
Hauke Petersen
3098a277ed Makefile.include: add optional TERMDEPS to make term 2017-05-23 14:25:11 +02:00
Hauke Petersen
0d9ba806bc make/tools: added shared script+mk for using BOSSA 2017-05-22 11:42:01 +02:00
Hauke Petersen
fb82e246d9 tools: add means to download and build BOSSA 2017-05-22 11:42:00 +02:00
Joakim Nohlgård
339a4da9dc Makefiles: move to new directory /makefiles 2017-04-04 15:11:54 +02:00
smlng
53b0dd1777 make: set default toolchain for board native on macOS to llvm 2017-03-22 23:07:22 +01:00
95441004b3 make: introduce PKGDIRBASE 2017-03-10 14:18:44 +01:00
47f6ff3056 Merge pull request #6237 from kaspar030/rename_AD_to_Q
make: rename AD to Q
2017-01-17 16:16:02 +01:00
ac9b12263a make: factor out features handling, add default feature handling 2017-01-12 16:26:01 +01:00
fd07b5fd27 make: introduce QQ, use when doing CI build 2016-12-22 23:53:51 +01:00
f44763f346 make: adapt Makefiles to AD -> Q rename 2016-12-22 12:12:38 +01:00
a5603ec1b3 make: rename AD variable to Q 2016-12-22 12:12:38 +01:00
Joakim Nohlgård
d4f2070e8b make: Correct multilib detection when using LLVM
The LLVM makefile needs to be included _after_ the CPU makefiles have
set their CFLAGS in order to get the right multilib directory from GCC.
2016-12-21 13:03:58 +01:00
537b725aed make: introduce RIOT_CI_BUILD (#5162) 2016-12-17 00:17:26 +01:00
560a509036 make: remove trailing slash from BINDIR variable 2016-10-18 23:27:59 +02:00
Cenk Gündoğan
2b3d3995f1 make: export RIOT_VERSION to CFLAGS_WITH_MACROS
All macros are filtered out of the `CFLAGS` variable and during this
process, the `CFLAGS` string is destroyed. This is due to the fact that
the `RIOT_VERSION` string contains spaces, but the filtering process does
not take the whole string into account (following the first space). This
leads to some parts of the `RIOT_VERSION` string be sill existent in the
`CFLAGS` string.

Instead of exporting the `RIOT_VERSION` string to the `CFLAGS` macro to
just remove it again from there, I exported it to `CFLAGS_WITH_MACROS`.

Fixes #5859
2016-09-23 09:02:55 +02:00
Martine Lenders
55a08aeb59 Merge pull request #5827 from miri64/make/enh/quiet-per-default
make: build quiet as default
2016-09-12 16:59:59 +02:00
Martine Lenders
043eb677dd make: build quiet as default 2016-09-06 18:20:02 +02:00
Ludwig Knüpfer
dc183736bc make: include RIOT_VERSION in CFLAGS for riotbuild
fixes #5695
2016-07-27 09:23:39 +02:00
kYc0o
9ba2e5372d Merge pull request #5248 from cgundogan/pr/make/buildrelpath
make: BUILDRELPATH without call to git
2016-07-22 17:05:03 +02:00
1b0d9ef14b make: treat packages like modules when it comes to linking 2016-07-20 19:58:17 +02:00
Joakim Nohlgård
a678e868e9 Makefile.include: Move USEMODULE CFLAGS expansion last
Some USEMODULE parts (e.g. defined in ${BOARD}/Makefile.dep) were not
being properly exported to CFLAGS -DMODULE_xxx options.
2016-07-13 16:44:28 +02:00
Joakim Nohlgård
ffb4573667 Merge pull request #5097 from gebart/pr/make-include
make: Place most configuration macros in a separate file instead of on the command line
2016-07-07 18:03:18 +02:00
a1f8891a41 make: distclean pkg sources on clean-intermediates target 2016-07-06 17:33:28 +02:00
Joakim Nohlgård
77a15e7886 make: Place most configuration macros in a separate file instead of on the command line 2016-07-05 11:22:58 +02:00
Cenk Gündoğan
1d79e07051 make: BUILDRELPATH without call to git 2016-05-18 08:22:08 +02:00
Cenk Gündoğan
e26bb43a03 make: fix typo 2016-04-21 10:57:26 +02:00