TechSpider
A searchable, categorised online resourse for finding technical information and solutions to problems
Welcome! You are viewing the Linux category.
Below are the Gnu and problem in using -j with make related pages
Custom Search
You can search the database for more Gnu articles using the box below:
Custom Search

Gnu Articles:


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.







Article list Name Date
Currently Viewing : This ArticleWarren Dodge2010-02-08 22:47:44
Click Here tom honermann 2010-02-09 01:35:33


Copyright Techspider V0.81   |   Techspider Sitemap