2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-29 12:33:51 +00:00
rules_foreign_cc/for_workspace
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
..
bazel_version.bzl Guard cc_common.configure_features with a version check (#270) 2019-05-28 10:31:58 +02:00
BUILD Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00
cmake_build.bzl Extract shell fragments into a toolchain (#196) 2019-01-18 18:06:10 +01:00
compilation_mode.bzl Pass the value of --compilation_mode dbg to the rule and to CMake (#96) 2018-09-14 10:18:38 +02:00
install_ws_dependency.bzl Fix Buildifier warnings (#395) 2020-05-04 19:50:45 +02:00
make_build.bzl Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00
ninja_build.bzl Extract shell fragments into a toolchain (#196) 2019-01-18 18:06:10 +01:00
repositories.bzl Add a GNU Make toolchain (#379) 2020-09-07 10:48:26 +02:00