On 4/9/11 5:44 AM, David Boyce wrote:
> On Fri, Apr 8, 2011 at 7:58 PM, Philip Prindeville 
> <phil...@redfish-solutions.com> wrote:
>> Didn't hear back, so I assume there is no easy way to detect (currently) a 
>> parallel build.
> 
> There was a response by Edward Welbourne - didn't you see it? It's not
> a documented/supported solution but I believe if you find any of -j,
> --jobs, or --jobserver-fds in $(MAKEFLAGS) the build is parallel.
> Since the latter two both match --jobs%, this should boil down to two
> nested findstring function calls on the MAKEFLAGS value.
> 
> David Boyce

I didn't see it, but I might not have been in copy.

I just tried that:

[philipp@builder ~/openwrt2]$ cat /tmp/Makefile
$(info MAKEFLAGS=$(MAKEFLAGS))
$(info MFLAGS=$(MFLAGS))
$(info MAKE=$(MAKE))

PBUILD:=$(if $(filter --jobs% -j%,$(MAKEFLAGS)),y,)

all:
        @echo PBUILD=$(PBUILD)
        @$(MAKE) -f /tmp/Makefile stop

stop:

[philipp@builder ~/openwrt2]$ make -j5 -f /tmp/Makefile
MAKEFLAGS=
MFLAGS=
MAKE=make
PBUILD=
MAKEFLAGS=w
MFLAGS=-w
MAKE=make
make[1]: Entering directory `/home/philipp/openwrt2'
make[1]: Nothing to be done for `stop'.
make[1]: Leaving directory `/home/philipp/openwrt2'
[philipp@builder ~/openwrt2]$

Not sure what I'm missing...



_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to