tech-toolchain archive

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

Re: make: enhancements?



On Wed, 28 Apr 2010 20:22:00 +0000, David Holland writes:
>On Wed, Apr 28, 2010 at 01:55:28PM +0100, David Laight wrote:
> > > > Do you have an example of a makefile that induces different behavior
> > > > in the two cases, and that works predictably in legacy makes, i.e.
> > > > isn't just flatly broken?
> > > 
> > > However, this question stands... it would be good to figure out
> > > exactly what it is and isn't doing with -j1. :-/
> > 
> > The 'traditional make' and '-j1 make' tend to build things in
> > opposite orders.
> > So makefile that make any assumptions about the order may fail
> > in one, but not in the other.
>
>This is not what I've found with simple test cases; do you have an
>example?

"Opposite" may not be correct, but different wrt dependents is easily
demonstrated.  Eg.

# the makefile:
all:    one two three four five

.for t in one two three four five
$t: $t.c

$t $t.c:
        @echo hi $@
.endfor

# behaves differently for 'make' vs 'make -j1'
# $ make -f ~/make-tests/j1     
# hi one.c
# hi one
# hi two.c
# hi two
# hi three.c
# hi three
# hi four.c
# hi four
# hi five.c
# hi five
# $ make -f ~/make-tests/j1 -j1 
# hi one.c
# hi two.c
# hi three.c
# hi four.c
# hi five.c
# hi one
# hi two
# hi three
# hi four
# hi five
# 


Home | Main Index | Thread Index | Old Index