Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile.in: Export $MAKE to be used by other scripts #9164

Open
wants to merge 2 commits into
base: maint
Choose a base branch
from

Conversation

dumbbell
Copy link
Contributor

@dumbbell dumbbell commented Dec 9, 2024

Why

GNU make is sometimes installed as gmake and make points to another implementation that does not support GNU make extensions.

The name of the make command is stored in $(MAKE) and sub-make processes automatically inherit and use this variable. However other executed commands and scripts do not get this variable by default. Therefore of a script tries to call make(1) again, it will either not find this value or, more likely, will hard-code make.

How

The top-level Makefile now exports the value of $(MAKE) into the environment of all executed sub-shells. This way, scripts can use the correct make command name if they need to run make(1) again.

An example fixed in this patch is make/test_target_script.sh. It used to hard-code make and now uses $MAKE passed from the parent make instance.

[Why]
GNU make is sometimes installed as `gmake` and `make` points to another
implementation that does not support GNU make extensions.

The name of the make command is stored in `$(MAKE)` and sub-make
processes automatically inherit and use this variable. However other
executed commands and scripts do not get this variable by default.
Therefore of a script tries to call make(1) again, it will either not
find this value or, more likely, will hard-code `make`.

[How]
The top-level Makefile now exports the value of `$(MAKE)` into the
environment of all executed sub-shells. This way, scripts can use the
correct make command name if they need to run make(1) again.
... instead of always using the hard-coded `make` command name.

[Why]
This is useful if GNU make is installed under another name (e.g.
`gmake`).

[How]
The correct name is passed through the `$MAKE` environment variable by
the parent make instance: use it.

The script defaults to `make` if the variable is unset.
Copy link
Contributor

github-actions bot commented Dec 9, 2024

CT Test Results

    3 files    143 suites   48m 58s ⏱️
1 596 tests 1 547 ✅ 49 💤 0 ❌
2 340 runs  2 266 ✅ 74 💤 0 ❌

Results for commit 6463837.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@dumbbell dumbbell changed the title Makefile.in: Export $MAKE to be used by other scripts Makefile.in: Export $MAKE to be used by other scripts Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant