Use of .INIT with dmake
I have a large number of targets in a make.rules that are listed as the .INIT target. They are mainly code generation from XML, so they have to precede the targets in the regular makefile. As such they appear to always be built in serial mode. Is there a way to get these target to build in parallel?
Ian
[317 byte] By [
Zootlea] at [2007-11-27 4:37:21]

# 1
> I have a large number of targets in a make.rules that
> are listed as the .INIT target. They are mainly code
> generation from XML, so they have to precede the
> targets in the regular makefile.
Could you please provide a part of a make.rules file with
multiple .INIT: targets? I tried to create a test case, but
dmake executes only the last rule (and prints a warning
that there are too many rules defined for target .INIT):
bash-3.00$ ls
make.rules makefile
bash-3.00$ cat make.rules
.INIT:
@echo "INIT 1 done"
.INIT:
@echo "INIT 2 done"
bash-3.00$ cat makefile
all:
@echo "all done"
bash-3.00$ dmake -j 8 -m parallel all
dmake: Warning: Too many rules defined for target .INIT
INIT 2 done
Dec2006 --> 1 job
Dec2006 --> Job output
all done
bash-3.00$
> As such they appear to always be built in serial mode.
> Is there a way to get these targets to build in parallel?
I'm not sure I can give you a good answer without reading
your makefiles, but, anyway, here is an idea:
If you are sure that all these targets can be built in parallel,
you can specify this in makefile:
.PARALLEL: .INIT1 .INIT2 .INIT3
.INIT: .INIT1 .INIT2 .INIT3
But you have to rename these targets so that they will have
unique names (not .INIT). As you said, they are generated
from XML, so you can probably use a script to rename them.
# 2
Thanks for the response Nik,
Try this example, not how the behavior changes if you uncomment the .INIT line.
one:
@echo "one"
two:
@echo "two"
three:
@echo "three"
.PARALLEL: one two three
#.INIT: one two three
all: one two three
@echo "all"
I can't publish the actual make.rules, but I can send it to you off line if that's OK.
Cheers,
Ian
# 3
Ian, you are right, if I uncomment .INIT: target,
dmake builds "one two three" in serial mode.
I think it is done intentionally, but it looks like
a bug to me. Feel free to file a bug against
dmake through bugs.sun.com
Product/Category: Dmake
Thanks for your report about this problem.
Nik
# 9
Good news! We have a fixed this problem and create new versions
of dmake for all platforms. Currently they are under testing, and if the
results are ok, they will be released in patches for Sun Studio 12.
If you can try this new version with your tests - that's great!
Please, send me email (Nik.Molchanov@sun.com), and I'll send you
a tar.gz file (please indicate what platforms you use).
Thanks,
Nik