On 2011-01-28 22:22Z, Oleksandr Gavenko wrote: > Cygwin make does not support jobserver.
Yes. See this discussion: http://lists.gnu.org/archive/html/make-w32/2010-10/msg00009.html You may benefit from parallelism without the jobserver. > Cygwin is our main build platform. [...] > $(TARGETS): > [ -z '$(filter %-2,$@)' ] && \ > make -f Makefile.1 $(patsubst %-1,%,$@) || : > [ -z '$(filter %-1,$@)' ] && \ > make -f Makefile.2 $(patsubst %-2,%,$@) || : [...] > But sadly if I call > > $ make -j 4 dist > > and Make does not support jobserver first and second command > from 'Makefile' running like '-j 1' not '-j 4' (I get this info by > putting 'export MAKEFLAGS += --debug=j' into Makefile)! Try using '$(MAKE)' instead of 'make' in your recipe, e.g. $(MAKE) -f Makefile.1 $(patsubst %-1,%,$@) || : Then the submake runs in parallel. In the following test case, the 'make' line runs one command at a time, but the '$(MAKE)' line runs four concurrent 'sleep' processes and is faster. $make --version GNU Make 3.81 ... This program built for i686-pc-cygwin $cat >j.make <<\EOF this_makefile := $(abspath $(lastword $(MAKEFILE_LIST))) .PHONY: all all: make -f $(this_makefile) foo $(MAKE) -f $(this_makefile) foo .PHONY: foo foo: echo $@ $(MAKEFLAGS) foo: foo1 foo2 foo3 foo4 foo1 foo2 foo3 foo4: @sleep 3 && echo $@ $(MAKEFLAGS) EOF $make -sf j.make -j4 _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
