On Thu, 28 May 2009, Yavor Doganov wrote: [...] > This works perfectly well with parallel make, because these are not > pattern rules. You are assuming that make behaves exactly in the same > "logical" way with pattern rules, which is not the case. > > > Note that I already stated that lib.so depends on both rsrc.res and > > main.o with this rule: > > > > build-%/lib.so: build-%/rsrc.res build-%/main.o > > cat $^ >$@ > > Yes, but you have not stated any order of these prerequisites, so when > make is run in parallel, the first invocation satisfies them, but a > rebuild does not because there's the typical race condition.
That's were you lost me. Doesn't the above rule mean that before rebuilding lib.so we must have both build-%/rsrc.res and build-%/main.o? So if 'make -j2' builds each of them in parallel it should still wait until *both* are available before starting to build lib.so. How does these being pattern rules change any of that? > > build-%/rsrc.res: build-%/rsrc.rc > > cat $< >$@ > > No, this won't work. If your rsrc.* generated files do not really > depend on main.c, but you want lib.so to take into account when your > "real" rsrc.rc.in changes you could implement another technique like a > sentinel or something. What do you suggest? -- Francois Gouget <[email protected]> http://fgouget.free.fr/ $live{free} || die ""; -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

