Parallel Execution - Job numbers

"Dan" <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization http://groups.google.com
Message-ID <[email protected]>
Hi.  At our work we have dualcore processors, so I want to take
advantage of gnu make's "-j 2" option to run two jobs at the same time.
 We use Windows, and use use two compilers - Watcom and Visualc.   The
Watcom build works fine, and we're seeing our compile times halved.  I
was expecting to get trouble with the precompiled headers, as the two
parallel jobs would probably be fighting with each other over the
precompiled header file.  With Watcom it seems to work okay, with the
occasional warning message, but nothing that slows it down really.
With the VisualC compiler it fails straight away due to the precompiled
header fighting.

Is there anyway I can find out which process a rule is running in?  For
example some kind of automatic variable?  That way I can have two
precompiled header files - one per parallel job.

For example, I could do this ...

%.obj: %.c
	$(cc) $< $(cc_args) /Fo$@ /Fpjob_$(jobnumber).pch

and this would use job_1.pch for job 1, and job_2.pch for job 2.

Is this any functionality like this?

Cheers,
- Dan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.