help-make
[Top][All Lists]
Advanced

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

Re: pgid of spawned processes


From: Rakesh Sharma
Subject: Re: pgid of spawned processes
Date: Sun, 6 Nov 2016 15:23:49 +0000

The environment is passed on to it's child processes by make, so if you can 
find a way to push the pid of your make run into one then you're done.


a) Invoke make as follows:

tmpf=`mktemp`

TMPF="$tmpf" make -f yourmakefile yourtarget &

pid=$!

echo "$pid" > $tmpf

wait "$pid"

rm -f "$tmpf"


b) Inside yourmakefile:

export MAKE_PID := $(shell while [  !  -s "$(TMPF)"  ]; do :; done; cat < 
$(TMPF))


###

Now all child(s) of this make shall inherit the env $(MAKE_PID)


--Rakesh


________________________________
From: Help-make <address@hidden> on behalf of Jonathan Leonard <address@hidden>
Sent: Saturday, November 5, 2016 2:11 PM
To: address@hidden
Subject: pgid of spawned processes

Hi,

Is it possible to get make to pass on its process group id to any children
processes it spawns?

[Please 'reply all' as I am not subscribed to this group].

Thanks!
_______________________________________________
Help-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-make
Help-make -- Users list for the GNU implementation of 
make<https://lists.gnu.org/mailman/listinfo/help-make>
lists.gnu.org
Help-make -- Users list for the GNU implementation of make About Help-make





reply via email to

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