[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem in using -j with make
From: |
Warren Dodge |
Subject: |
problem in using -j with make |
Date: |
Mon, 8 Feb 2010 14:47:44 -0800 |
I have a make file that is causing me a problem when I try to use the -j
option to speed things up.
Here is a simplified version of it that shows my problem.
### Makefile ########
all: a b c d e
touch all
a b c d e:
script.5files
#############################################################################
script.5files contains this
touch a b c d e
#############################################################################
Basically, I want to build the all target if any one of the 5 files is
missing. The script will always build all five files if it is run. As
seen it appears to do that.
rm ? all
make all
script.5files
touch all
make all
make: `all' is up to date.
rm a
make all
script.5files
touch all
rm b d
make all
script.5files
touch all
#############################################################################
Now if I add a -j to the mix it does something strange
rm ? all
make -j all
script.5files
script.5files
script.5files
script.5files
script.5files
touch all
It senses it can do all in parallel and runs the script 5 times. In this
simple case it doesn't really hurt but in my real script it totally
messes thing up as it is a lengthy process to create the 5 files via a
perl script.
I kind of think what it is doing is expected but I am not totally
sure. What I would wonder is why make did not sense that the
prerequisites for all are totally made by just one execution of the
script and thus -j would only call the script once.
If there is another way to approach this I'd like to know it. This is
driving me nuts.
- problem in using -j with make,
Warren Dodge <=