On Sun, 2026-06-07 at 08:57 +0000, Heime wrote:
> I want to avoid passing using a variable like this
> 
> make -f myfile.mk opt=--split=chapter
> 
> Rather, I want a direct setting like thisn
> 
> make -f myfile.mk -- --html --split=chapter
> 
> And be able to pass all option to the command part of a 
> makefile rule.

What you want to do is not possible.  Make is not a general-purpose
interpreter that allows makefiles to investigate and interpret its
command-line arguments.

The only thing you can do is write a shell script wrapper around make,
that will parse the arguments and pass them to make using a variable
assignment.

-- 
Paul D. Smith <[email protected]>            Find some GNU Make tips at:
https://www.gnu.org                       http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad
Scientist



Reply via email to