makefile - Make: recursive make ignores -s -
observe difference between make silent , make noisy. asked make silent on bar rule, silent on foo rule, too.
what missing?
noisy: @make foo silent: @make -s foo foo: @make -s bar bar: @echo bar running it:
$ make silent bar $ make noisy make[1]: entering directory `/tmp/s' make[2]: entering directory `/tmp/s' bar make[2]: leaving directory `/tmp/s' make[1]: leaving directory `/tmp/s' i expected noisy foo -> bar call not print "entering directory"
options passed parent make sub-make using makeflags environment variable, sub-make adds command-line flags received. if sub-make doesn't receive -s (--silent), -w (--print-directory), or --no-print-directory, automatically adds -w own makeflags. order of precedence enabling , disabling directory printing seems (from weakest strongest) -s, -w, --no-print-directory.
so, when run make silent, first recursive call adds -s makeflags, , second call knows not touch flags. however, when run make noisy, first recursive call adds -w makeflags since didn't tell not silent, , on, -s won't have effect you're looking for. can use --no-print-directory instead, since overrides -w.
Comments
Post a Comment