Gnumake
maintainers,
I've run into a
functional difference between the standard unix make and GNUmake (3.80)
involving how the :: rules are processed.
In the standard unix
make (Solaris), the :: targets ( i.e., all::) are process in the order they are
found in the Makefile serially, regardless of whether parallelism is used (i.e.,
-jN, where N is > 1).
In GNUmake (3.80),
the when -j1 is used, the "::" targets are executed serially. When -jN is
used the "::" targets are executed in parallel.
Consider the
following -- from an IMAKE generated Makefile:
all::
all.prologue
all:: all.serial
all.parallel
all:: ; @echo $@;
sleep 1; echo [EMAIL PROTECTED]
all::
all.epilogue
all.epilogue
all.prologue:: ; @echo $@; sleep 2; echo [EMAIL PROTECTED]
all.serial:: ; @echo [EMAIL PROTECTED]; sleep 1; echo [EMAIL PROTECTED]
all.serial:: ; @echo [EMAIL PROTECTED]; sleep 1; echo [EMAIL PROTECTED]
all.parallel: aaa
bbb ccc
aaa bbb ccc: ; @echo
$@; sleep 1; echo [EMAIL PROTECTED]
In a non-parallel
make (i.e. -j1) in both Unix and Gnu make, the following is the
result:
all.prologue
all.prologue-done
all.serial-1
all.serial-1-done
all.serial-2
all.serial-2-done
aaa
aaa-done
bbb
bbb-done
ccc
ccc-done
all
all-done
all.epilogue
all.epilogue-done
When run in parallel
using Unix make (i.e., -j12), the following occurs:
all.prologue
all.prologue-done
all.serial-1
aaa
bbb
ccc
all.serial-1-done
aaa-done
bbb-done
ccc-done
all.serial-2
all.serial-2-done
all
all-done
all-epilogue
all-epilogue-done
When run in parallel
using GNUmake (i.e., -j12), the following occurs:
all.prologue
all.serial-1
aaa
bbb
ccc
all.epilogue
all.prologue-done
all.serial-1-done
aaa-done
all.serial-2
all.epilogue-done
bbb-done
ccc-done
all.serial-2-done
all
all-done
It appears that all
the :: targets that exist in the file are started at the same time and not
executed sequentially as is done for standard Unix make. The only
exception to this is the all.serial target which has multiple command, which are
executed in order... As a result of this I cannot port our IMAKE based make utility
to use GNUmake.
The intent of the
above targets is as follows:
+ all.prologue --
things which should be performed before any other all* targets are
made
For example, creating, or removing a directory.
+ all.epilogue --
things which should occur after all* targets have completed -- for example
sending email.
+ a.serial -- rules
that MUST execute serially
+ a.parallel --
rules that may execute in parallel
The following
defines the order of execution:
all:
all.prologue
all: all.serial
all.parallel
[ multiple all,
all-serial, and all.parallel targets]
all:
all.epilogue
I'm interested in
your views on this problem. I think it's a bug because GNUmake is clearly
out of sync with standard make on the order in which :: targets are evaluated in
a parallel build environment.
Reid
Madsen
Principal Engineer -
Architecture Group
Tektronix,
Inc.
214-912-5152
_______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make