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

341 Commits

Author SHA1 Message Date
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