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.

Nik.Molchanova at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 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

Zootlea at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 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

Nik.Molchanova at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
There isn't a category for dmake, so I used compiler/tools misc.Ian
Zootlea at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
H-mm, strange, yesterday it was there :-)Please, tell me the bug ID, I'll reassign it.Thanks,Nik
Nik.Molchanova at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
CR 6562801Ian
Zootlea at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7
Thank you, this bug is filed properly. It is too late to fix it in Sun Studio 12 release.Probably we can fix it in a patch.Thanks,Nik
Nik.Molchanova at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 8
I'd be happy to do some testing for you once you have a fix.Cheers,Ian.
Zootlea at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 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

Nik.Molchanova at 2007-7-12 9:47:35 > top of Java-index,Development Tools,Solaris and Linux Development Tools...