2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-12-03 02:52:58 +00:00
rules_foreign_cc/tools/build_defs
Attila Oláh ea571fcdd1
Add a GNU Make toolchain (#379)
* Use `.format()` instead of `%` for constructing `make_commands`.

I'm about to add a third substitution parameter to these lines, and it's
already getting a bit crowded. This is a no-op change, but should make
the follow-up commits more readable.

* Add `make_toolchain` toolchain type.

Add a toolchain that implements it using the pre-installed system
`make`. Make use of this toolchain in the `make()` rule.

* Use the `make` toolchain in configure and cmake scripts as well.

This allows the registered `make` toolchain to be used not just in make,
but also in cmake and configure_make targets. As a result, one can
either ship their own `make`, built for the execution environment, or
use a custom `make`, e.g. one that calls `emmake make`.

To make this backwards compatible with `make_commands`, the substitution
will only replace the leading word `make` from any line in
`make_commands`. Thus, existing rules that specify a `make_commands`
attribute that refers to the binary simply as `make` should still work
with any toolchain implementation that provides the binary.

* Update `README.md`.

Describe the new toolchain type.

* Add `BootstrapMake` to bootstrap a `make` toolchain.

This allows the `make` toolchain to be used even without GNU Make being
pre-installed on the system.

* Add example Gnu Make boostrap target.

Test manually using:

```
$ cd examples
$ bazel build //build_make_itself:maketool
```
2020-09-07 10:48:26 +02:00
..
native_tools Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00
shell_toolchain Fix shell function symlink_contents_to_dir, add test (#377) 2020-05-08 11:43:40 +02:00
boost_build.bzl Migrate for --incompatible_enable_cc_toolchain_resolution (#262) 2019-05-15 14:43:13 +02:00
BUILD Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00
cc_toolchain_util.bzl Fix extension-stripping logic. 2020-08-21 13:52:49 +02:00
cmake.bzl Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00
cmake_script.bzl Fix Buildifier warnings (#395) 2020-05-04 19:50:45 +02:00
configure.bzl Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00
configure_script.bzl Handle case where LDFLAGS is undefined (#407) 2020-06-08 19:05:29 +02:00
detect_root.bzl Fix shell function symlink_contents_to_dir, add test (#377) 2020-05-08 11:43:40 +02:00
framework.bzl Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00
make.bzl Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00
run_shell_file_utils.bzl Extract shell fragments into a toolchain (#196) 2019-01-18 18:06:10 +01:00
shell_script_helper.bzl Fix shell_script_helper.bzl to replace function calls inside function… (#375) 2020-04-30 11:24:25 +02:00
version.bzl Fix using Bazel-built libraries by cmake_external and configure_make (#249) 2019-05-09 10:35:00 +02:00