bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Document nested -n bomb diffusion


From: 積丹尼 Dan Jacobson
Subject: Document nested -n bomb diffusion
Date: Sat, 10 Apr 2021 08:05:18 +0800

(info "(make) MAKE Variable") still just says

       The special feature makes this do what you want: whenever a recipe
    line of a rule contains the variable 'MAKE', the flags '-t', '-n' and
    '-q' do not apply to that line.  Recipe lines containing 'MAKE' are
    executed normally despite the presence of a flag that causes most
    recipes not to be run.  The usual 'MAKEFLAGS' mechanism passes the flags
    to the sub-'make' (*note Communicating Options to a Sub-'make':
    Options/Recursion.), so your request to touch the files, or print the
    recipes, is propagated to the subsystem.

and (info "(make) Options/Recursion") says regarding MAKEFLAGS:

   (except that '-C', '-f', '-h', '-o', '-W', and
   their long-named versions are ignored;

OK, first, regarding "do what you want": When some users use -n, they
don't want some deeply nested $(MAKE) to suddenly "turn on the nuclear
reactor without also turning on the cooling system."

I.e., (info "(make) MAKE Variable") should mention:

1. How to guaranteed "-n" is passed and honored 100% throughout the
tree. Or,

2. State explicitly that well um it's just not possible.

Or maybe on the man page:

       -n, --just-print, --dry-run, --recon
            Print the commands that would be executed, but do not execute them
            (except in certain circumstances).

Should say

       -n, --just-print, --dry-run, --recon
            Print the commands that would be executed, but do not execute them
            (except in certain circumstances). For more powerful ones, use
            --just-print-100%, --dry-run-100% .


The "except in certain circumstances" I am thankful for. But there is
still no clear "admission in the documents that there is no way to
guarantee -n won't execute something deep down" or "recipe provided how
to achieve this guarantee, without needing to mess with (edit) other
people's makefiles".

Or say:
   How to defuse deep -n: you can't. So,
   if you don't want to worry about deep -n coming to life,
   well, instead of

x:
        $(MAKE) y
   use

x:
        make y

   Sure, to do a dry run, now instead of
$ make -n x
   you will need
$ make -n x y
   but at least it won't blow up (execute) in your face.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]