On Sun, 2019-03-17 at 05:57 -0800, Britton Kerin wrote: > SHELL_CHECKED = \ > $(strip \ > $(if $(shell (($1) 1>/tmp/SC_so) || echo nonempty), \ > $(error shell command '$1' failed. Its stderr should be above \ > somewhere. Its stdout is in '/tmp/SC_so'), \ > $(shell cat /tmp/SC_so && rm -f /tmp/SC_so))) > > Calls can safely be nested but not run in parallel.
Can you show how you're trying to use this? I have to assume that you're trying to use this variable within a recipe. It's an antipattern to use $(shell ...) inside a recipe; it was not designed to be used there (since a recipe is already running in a shell there's little reason to do so) and there are many issues with it. I recommend using real shell commands in your SHELL_CHECKED variable, rather than using make functions. That will solve your problem with status checking. As for locking, I recommend writing to a unique file for each instance: maybe using the $$ value to get the current shell's PID--of course in makefiles you have to write it as $$$$ instead. _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make