Can be overridden from the environment by setting WERROR=0
also remove reversed logic for Werror in Makefile.buildtest
(a typo caused Werror to be always enabled for all builds)
- Better support for passing environment variables to the Docker container.
- Move Docker-related definitions into Makefile.docker.
- Only environment variables that originates from the command line or
the environment will be passed to the Docker container.
export BUILD_IN_DOCKER=1 to use Docker for building inside a Docker
container.
GDB debug file paths will be wrong after building inside the container,
use the script provided in `dist/gdbinit-docker` to set the correct GDB
substitution paths (copy and paste the contents into your `~/.gdbinit`)
The environment variable DOCKER_FLAGS can be used to pass extra
parameters to the Docker process.
llvm-ar does not understand `-rc`, but works for creating empty
archives when called with `rc` (without the leading dash). BSD `ar`
which ships with OSX, which the test is written for, understands the
argument with or without the leading dash (but does not support creating
empty archives.)
The '""' pattern is used so that the variable can be processed as a string
after the preprocessors evaluation. Change to \"\" instead, so that single
quotes can be used externally. The extra quotation marks are unneeded.
Related to #2213
This change allows drivers (or any module for that matter) to provide
features. This is e.g. useful if a board does not have a transceiver,
but your application uses `USEMODULE += some_driver`, which implements
the transceiver interface.
The line `FEATURES_PROVIDED += some_feature` should go to the guarded
block in `{sys,drivers}/Makefile.include`.
Fixes#1876
This PR introduces `FEATURES_OPTIONAL` which can be used to tell the
Make system, that the application would like to use some feature, but
the build should proceed even if the selected board cannot provide the
optional feature.
`make buildtest` and `make info-supported-boards` heed this variable
when examining the list of supported boards.
If a word is present in `FEATURES_REQUIRED` and `FEATURES_OPTIONAL`,
then `FEATURES_OPTIONAL` takes precedence.
distclean
removes all build products, also depends on docclean
clean
removes all build products for the current board
also, silence clean target from Makefile.include and let it ignore errors
Please see #1715.
Closes#1715.
This PR implements the new Makefile variables "FEATURES_PROVIDED" and
"FEATURES_REQUIRED". A board *can* have a new file `Makefile.features`
which looks like:
```make
FEATURES_PROVIDED = transceiver
```
An application can have a corresponding line
```make
FEATURES_REQUIRED = transceiver
```
If the selected BOARD does not fulfil the requirements of the
application, then a *warning* is issued at compile time.
This change only includes the feature "transceiver", further features
are expected to be listed in further PRs. The requirement "transceiver"
is automatically added if the application uses the module
"defaulttransceiver".
`make buildtest` understands the new feature listing, so the user won't
need to add boards to `BOARD_BLACKLIST` manually.
Part of the change are the added Make targets
* `info-features-missing`, which prints the required features
`\setminus` the provided features. The output is empty if there are no
features missing.
* `info-boards-features-missing`, the same as `info-features-missing`
but as a table for all boards, but heeded `BOARD_WHITELIST` and
`BOARD_BLACKLIST`.
Applications don't have to use this new feature. This change does not
break existing Makefile.
Sometimes boards/*/Makefile.include (e. g. in case of the msba2) gets included
twice somehow, leading the TERMFLAG to be set twice and faulty. This
fixes that.
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.
This PR adds the defined `RIOT_BOARD`, `RIOT_CPU` and `RIOT_MCU`.
They each are defined as `BOARD_${BOARD}`, `CPU_${CPU}`, and
`MCU_${CPU}`, resp.
`BOARD_${BOARD}` is defined as the string `"${BOARD}"`, but not in upper
case. Same for the other two.
Building MSP boards gives an error, because `VERSION` is somewhere
defined in their toolchain as an integer.
This PR renames `VERSION` into `RIOT_VERSION`, because that's what it
is.
Almost everything was build sequentially in RIOT, because we employed
explicit for-loops to build directories (DIRS). This PR makes our make
system use normal dependencies to build directories.
All our compiling rules were duplicated, once for the application, once
for modules. This PR makes the application a normal module, removing
this duplication.
Currently most blacklistings for examples and tests are done because the
board provides too little RAM or ROM. Besides of the actual linking all
the compiling should nevertheless work just fine.
This PR adds the variable `BOARD_INSUFFICIENT_RAM` to tell the
`buildtest` to compile the code for a board, but omit the linking step.
Closes#993.
We do not need to descend into the modules to know what to do on
`make clean BOARD=blub`. We can just invoke `rm -rf bin/blub`.
This PR only keeps the descending into the USEPKGs, since they might
want to delete cached/downloaded/extracted data.
Application developers use `$(USEMODULES)` in their Makefiles to have
the relevant functionally automagically added to their apps. This even
does basic dependency tracking by means of `Makefile.dep`.
But an important thing is missing: the automatic adding of include
paths. This is inconvenient, error prone, and will hinder the RIOT core
developers in future to change folder structures.
In #664 I added a test that determines if the supplied compiler
understands the `-fno-delete-null-pointer-checks` flag. The problem is
that the `$(CC)` supplied on command line or in the application's
Makefile is used, but not the one the `$(BOARD)`'s Makefile sets.
That problem was overlooked as all the boards use GCC, and GCC happens
to know the flag. But if some future board does not use GCC, then the
wrong order of the checks could pose a problem.
An application might want to use C11 features. The user would assume
that setting `CFLAGS=-std=gnu11` in the Makefile would work. It does not
since the board's Makefile.include shadows the `-std` flag.
This patch removes the `-std=gnu99` from the various Makefile.includes,
and sets the flag in the common Makefile.include of RIOT instead.
If an `-std` flag was provided by an earlier Makefile (the application,
the board, or the CPU [whilst only the former one should]), then no
additional flag is set. It is first tested if the supplied compiler
understands `-std=gnu99`, then `-std=c99`.
Currently pkg/USING says one should use
`EXTERNAL+=$(RIOTBASE)/pkg/<pkg_name>` to enable PKG modules.
Using this line the PKG will be compiled but not linked.
This change adds a USEPKG variable to be used like
`USEPKG += <pkg_name>`, which looks less clumsy and gets the PKG linked
in the binary.
* add missing $(AD) to osx $(LINK) invocation
* move osx build determination to native makefile
* move old libc test to native makefile
* set objcopy to "true" - it is superfluous for native no matter what the system is
* add some documentation to natives makefile