bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make -j and multiple targets


From: Peter Gammie
Subject: make -j and multiple targets
Date: Thu, 6 Sep 2001 19:02:26 +1000 (EST)

g'day,

i'm using make 3.79.1.

if i write a rule like so:

----Makefile----
... overall target that depends on lexer.o ...
... rules that depend on lexer.h ....

lexer.c lexer.h: lexer.l
        flex -t lexer.l > lexer.c
        genHeader.pl lexer.l # generates lexer.h and appends stuff to lexer.c

lexer.o: lexer.c # and some other stuff
----

and run make like so:

% make -j2

i get the rule for lexer.c/lexer.h firing twice, which makes the
compilation bomb sometimes due to the two appends (race).

now, this is probably well understood behaviour, but could you at least
add a caveat to the info page? (specifically in "parallel"). i'd prefer
the semantics to be something like the following:

"apply the rule once, taking the timestamp of the lhs to be the oldest of
the n lhs files, and of the rhs to be the youngest of the m source files."

rather than firing the rule several times.

being completely naive about build systems, however, i'm sure someone will
point out why this is a bad idea.

cheers
peter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]