Quote Originally Posted by christop View Post
The -w flag is only for printing the directory that a child call to make is entering/leaving, which is pretty much expected behavior.
You're missing the point, if the parent make defaults to assuming the flag is set the the child process should be doing the same, there should be no adding the flag directly unless it is directly seen in the arguments given to make in the 1st place, it's perfectly possible for make to distinguish between an implied flag and an explicit flag simply by comparing the pointer obtained for the flag string to the default string's pointer, something like this:
Code:
...
char const *_arg_w = "-w", *arg_w = _arg_w;
...
arg_w = argv[i];
...
if ( arg_w != _arg_w )
   add_arg( &args, &size, arg_w );
...
Either way the child process still needs to check it's arguments so why make makefiles harder to use than they should be?

Quote Originally Posted by christop View Post
Really? What version of make are you using that doesn't simply use the -f flag only as the makefile to use and falls back on a default makefile?

Code:
$ cat makefile
all:
	echo makefile
$ cat asdfasdf
asdfasdf:
	echo asdfasdf
$ make -f asdfasdf all
make: *** No rule to make target 'all'.  Stop.
Clearly my version of make only reads the file "asdfasdf" and doesn't even look at the default "makefile" file. That's standard, expected behavior.
That's what I thought too, but results did not follow that expectation, as for what version of make I have, this is what "make -v" gav e me:
Code:
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.