lib/meson.build: disable PIC
PIC does not apply to microcontrollers.
README.md: change wording
README.md: insert information about the port
meson: fix source generation
Meson treats files appearing in the sources list differently depending
on their extension. Files that end in .c are assumed to be valid compilation
units with a corresponding object file. Files that do not end in .c, which
includes .h files, are not treated as precursors to object files, but still
represent dependencies of a target, possibly generated. Therefore, Meson does
not support generating .c files which are not intended to be valid compilation
units themselves.
Of course, this is precisely the case with the vector_nvic.c for each target.
It is not a valid compilaton unit, but is included by another file which is.
Therefore, I changed the extension to suit Meson. The Make build system should
be able to adapt to Meson's enforced convention.
Note that other possible extensions are also valid, which may better convey
the intent to readers. vector_nvic.h is not a proper header file, but neither
is it a "proper" C file according to Meson. Perhaps it needs a different
extension to reflect this atypical status.
scripts/make2meson.sh: add meson.build gen script
This command is run often enough to warrant its own script.
scripts/make2meson.awk: fix use before def typo
Awk is perhaps not the best choice for robust programming.
meson: simplify irq file specification
No need to have so many one-line files.
scripts/irq2nvic_h.py: accept path to input file
The previous version of this script constructed the path of the input
file based on assuming the value of @SOURCE_ROOT@ to be the root of
the libopencm3 project. When the project is used as a subproject, this
assumption is false, and the script fails because miscalculates the
path of the input file.
To fix this, let Meson calculate the path of the input file and let
the script accept that path.
meson: use declare_dependency
meson: allow superprojects to depend on libs
Set a variable for each static library.
meson: try to be a better subproject
- Don't build all targets by default if we're a subproject.
- Don't set global project arguments.
meson.build: remove unused variable
scripts/make2meson.awk: fix typo in usage comment
port to meson
I'm not porting all 425987 microcontrollers by hand, so I wrote
scripts/make2meson.awk to generate many meson.build files. Complexity
in this script is driven by inconsistencies across targets in the Make
build system. To reduce that complexity, I changed some Makefiles to
be more consistent. I have not tested the Make build system with
these changes.
meson.build: separate fp and c arguments
meson: define targets using data in lib/
There's only support for one target at the moment, but this
approach is likely to generalize well and is compatible with
libopencm3's existing tree structure.
The basic idea is to use dictionaries instead of subdir(). subdir()
doesn't provide fine enough control. The Make-based build system allows
each target to specify exactly which object files it includes. In
general, a target does not use all the object files from a subdir.
Therefore, Meson also has to use this level of precision. This is not
to preclude future optimizations using subdir(), but to ensure we have
an accurate build.
cross: move into lib/
This is in preparation of moving most information from cross
files into meson.build files. The rationale for this change:
- all targets use the same toolchain
- targets differ only in compiler options
- compiler options can be specified per target
In other words, there is no reason to use multiple cross
files.
cross/arm: specify host CPU
This isn't a real specification, but Meson seems content with it.
meson.build: break a long line