Skip to content

Conversation

@tleedjarv
Copy link
Contributor

BSD make is still actively adding new features and some of the features are recent enough that they can't be used blindly without testing their presence.

This PR improves feature test for $^ (added in #1139) and adds a feature test for target-specific local variables (supported by BSD make since NetBSD 10/FreeBSD 13).

Move all local variable definitions together (as was intended already
before).
BSD make in NetBSD < 10 and FreeBSD < 13 does not support defining new
target-specific local variables. Add a feature test for this to generate
appropriate configuration.

At the same time, improve code for executing external shell by:

 - enabling optional exit status check;

 - allowing to provide a string that is piped directly to stdin of the
   shell process. This allows for a universal way of providing input
   even with various non-POSIX compliant shells (don't have to rely on
   echo or printf);

 - passing PATH from the environment to the shell process. (This should
   be the default, but apparently does not (always?) work properly.)
Don't assume that non-empty output on stdout means success. Check for
the exact expected string, ignoring any additional output. There is
no need for checking the exit status as the expected output can only
be produced on success.
@gdt
Copy link
Collaborator

gdt commented Jul 31, 2025

I tested with make (BSD) and gmake on NetBSD 9, 10 and current, all 6 combinations ok.

@gdt gdt merged commit ce6f66b into bcpierce00:master Jul 31, 2025
30 checks passed
@tleedjarv tleedjarv deleted the fix-make-local-vars branch July 31, 2025 19:23
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.

2 participants