Commit Graph

44 Commits

Author SHA1 Message Date
Sebastian Huber
3612dc7d61 build: Print item UID in case of errors
This helps to identify issues in build items.
2023-03-06 16:37:06 +01:00
Sebastian Huber
f20078acea build: Use enabled by for defaults
Merge the "default" and "default-by-variant" attributes.  Use an
"enabled-by" expression to select the default value based on the enabled
set.  This makes it possible to select default values depending on other
options.  For example you could choose memory settings based on whether
RTEMS_SMP is enabled or disabled.

The change was tested by comparing the output of

  ./waf bspdefaults

before and after the change.
2023-01-17 08:31:48 +01:00
Sebastian Huber
cac528f85a build: Add reason to test state definitions 2023-01-17 08:30:21 +01:00
Gedare Bloom
a640854b5e wscript: rename bsp_list to bsplist 2022-11-11 11:58:05 -07:00
Gedare Bloom
9c15524f15 wscript: rename bsp_defaults to bspdefaults 2022-11-11 11:58:05 -07:00
Gedare Bloom
dc8539c108 wscript: fix formatting with yapf 2022-11-07 09:49:38 -07:00
Sebastian Huber
a13047ca0e build: Allow separate optimization flags
Allow separate optimization flags for the BSP, cpukit, and tests.  For example,
the BSP and cpukit may be built without optimization if coverage
instrumentation is enabled, however, the tests may still use optimization.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
42da08dd9d build: Add cppflags, cflags, cxxflags to groups
Propagate the group defined cppflags, cflags, and cxxflags from parent groups
to child items through the build item context.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
0bb7b84698 build: Improve value substitution
The waf build system uses lists for tool flags.  The build items may use
variable substitution.  Add the ability to use the variable substitution in
lists.  For example:

MORE_FLAGS = ['-more', '-flags']

flags:
- -some-flag
- ${MORE_FLAGS}

Before this change, the ${MORE_FLAGS} was substituted to "-more -flags".  This
would be passed by waf as a single command line argument to the tool.

After this change, the ${MORE_FLAGS} list extends the flags list:

flags = ['-some-flag', '-more', '-flags']

This list extension is performed if a list element consists of exactly one
variable.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
4aeebaee5b build: Fix identifier pattern
Allow upper case characters in identifiers.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
281f39a600 build: Move BSP_INCLUDES split
The goal is to let the build items define as much as possible.
2022-07-04 08:29:52 +02:00
Sebastian Huber
857fb17db1 build: Add more flags to BuildItemContext
Add cppflags, cflags, and cxxflags to BuildItemContext.  This allows to
propagate the flags from parent items to child items.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
ed51fad53a build: Assert value properties only if not None 2022-06-08 09:08:26 +02:00
Kinsey Moore
88dc1880ec wscript: Allow start code to be written in C
Start code for most platforms requires hand-coded ASM but some can be
bootstrapped entirely in C, especially for paravirtualized platforms.
This change allows start code to be written in C where possible instead
of requiring architecture-specific ASM to bridge to C.
2022-04-26 09:23:22 -05:00
Kinsey Moore
c3e8a97baf wscript: Allow substitution outside values
This expands the ability to substitute variables outside the current
limitation of values in options to asflags, cflags, cppflags, cxxflags,
ldflags, and includes. It is possible for all of these flags to utilize
user-defined information in config.ini, especially for paths to external
resources.
2022-04-14 13:11:45 -05:00
Sebastian Huber
1a5991e4e7 build: Apply command line options to all variants
Update #4548.
2022-03-18 14:57:43 +01:00
Sebastian Huber
c1395ca056 build: Add --rtems-version command line option
Update #4548.
2021-11-17 09:16:13 +01:00
Sebastian Huber
a0650f5f32 build: Support command line specified options
Update #4548.
2021-11-16 07:46:16 +01:00
Sebastian Huber
ebdfa24bff build: Merge default-by-family into by-variant
Prefix the BSP family name with "bsps/" to make it distinct to the BSP
variant names.

Update #4468.
2021-08-18 11:25:35 +02:00
Sebastian Huber
cc0bd0825b build: Bring Item.link() in line with waf link
The LDFLAGS are placed after the static libraries in the standard waf link
command, see "waflib/Tools/c.py" in the waf sources.
2021-07-26 07:54:25 +02:00
Sebastian Huber
217bf7be83 build: Add "bsps/" prefix to BSP family enable
BSP family and BSP variant names may be equal.  This prefix avoids
ambiguity in the enabled-by expressions.
2021-07-22 08:10:09 +02:00
Sebastian Huber
19e4a3d25c build: Use objects of build context for programs 2021-07-15 15:37:35 +02:00
Sebastian Huber
90f250e23a build: Add the BSP family to the enable set
This makes it possible to use the BSP family in expressions of the enabled-by
attribute.
2021-07-15 08:17:16 +02:00
Sebastian Huber
8bfc2080ca build: Fix format 2021-07-15 08:17:16 +02:00
Sebastian Huber
6c1928caed build: Prefer variant default value over family
Update #4468.
2021-07-15 08:07:28 +02:00
Sebastian Huber
b6092cb82c build: Fix bsp_defaults command
Update #4468.
2021-07-15 08:07:28 +02:00
Chris Johns
6f2aa8ad36 build: Use BSP family for options
- Optionally add support for 'default-by-family' to allow
  option to be set by a family and so all related BSPs

Close #4468
2021-07-15 09:59:14 +10:00
Sebastian Huber
3353820be7 build: Fix format in wscript 2021-02-23 10:05:52 +01:00
Sebastian Huber
9d2db27adf build: Add CPPFLAGS to assembler command line
We use GCC to call the assembler.  This means the assembler files are
processed by the C preprocessor.
2021-01-26 15:29:36 +01:00
Sebastian Huber
7cf7e1d61d build: Add ABI flags to gnatmake compiler flags 2020-12-16 11:00:03 +01:00
Kinsey Moore
b2ea2bc333 wscript: Apply test state expectations correctly
The variety of expected test states are not currently applied to tests
with names containing '-' correctly due to a failure to replace '-' with
'_' before adding the CPPFLAGS to the environment for that test. This
ensures that all additions of CPPFLAGS have that replacement performed
so that the CPPFLAGS are applied properly during compilation.
2020-11-24 08:01:08 -06:00
Sebastian Huber
d5d9a89d03 build: Fix cache file placement
The "bsp_list" and "bsp_defaults" commands get a waflib.Context object
which has no build node.  Use a hard coded build path for these
commands.
2020-11-12 07:51:30 +01:00
Sebastian Huber
6cf0c559dc build: Place cache file in output directory
This improves support for the --out option.  Previously, the cache file
was placed in the source directory under "build/...".  Now, it is placed
in the output directory, which is "build" by default.  So, if you don't
use the --out option nothing changes.  However, if you use the --out
option, then the cache file is placed under the specified directory.
2020-11-05 18:53:49 +01:00
Sebastian Huber
eebad5ffcd build: Improve cache handling
Check the directory modification time to notice file removals.
2020-10-28 07:33:38 +01:00
Sebastian Huber
b052e3aefa build: Report caching errors
The ctx.fatal() method uses an exception to stop the build.  Do not
catch it.
2020-10-28 07:33:38 +01:00
Sebastian Huber
f53712a0e3 build: Use exact match by default for BSP names
Update #3818.
2020-10-02 16:29:48 +02:00
Sebastian Huber
cbd4f542ec build: Add comment
Update #3818.
2020-09-28 06:18:19 +02:00
Sebastian Huber
71ccc156a5 build: Fix option default values
For the option default values we have to use the BSP name defined by the build
specification and not the user.

Update #3818.
2020-09-27 09:36:07 +02:00
Sebastian Huber
b8d84015a4 build: Fix enabled-by evaluation
For the enabled-by evaluation we have to use the BSP name defined by the
build specification and not the user.

Update #3818.
2020-09-27 09:35:06 +02:00
Sebastian Huber
9a27c9cfd8 build: Simplify get_compiler()
Update #3818.
2020-09-27 09:34:27 +02:00
Sebastian Huber
11c1b862df build: Allow test program item UIDs with a "-"
Update #3818.
2020-09-17 17:42:25 +02:00
Sebastian Huber
4eea8d4bc4 build: Fix dependencies for start and asm files
Add a feature to enforce an explicit target file for assembler sources.
Add a build start file node list and use it as a test program
dependency.

The fix for #3846 and #4080 needs to be combined, because the fix
for #3846 requires the removal of 'before=["cstlib"]'. This patch fixes
two issues:

1. The tracking of start file dependencies.

2. Reflect that executables depend on the start files.

We need a start.o file in the right path so that the linker can find is
as specified by the linker script, and not for example a start.S.17.o
file in some path. This part is addressed by the "explicit_asm_target"
feature.

This build process extension

@after("apply_link")
@feature("cprogram", "cxxprogram")
def process_start_files(self):
    if getattr(self, "start_files", False):
        self.link_task.dep_nodes.extend(self.bld.start_files)

addresses 2.

Close #3846.
Close #4080.
2020-09-17 08:57:54 +02:00
Sebastian Huber
aa27a85a83 build: Use Python tarfile instead of pax
This patch is for the new build system.
2020-09-14 07:11:40 +02:00
Sebastian Huber
f3f0370f10 build: Alternative build system based on waf
Update #3818.
2020-09-14 07:11:32 +02:00