Fri 30 May 2003 04:12:55 PM UTC, comment #2:
Here is an even simpler Makefile which shows the problem. It is a stripped down version of the original I submitted, and makes little sense in terms of what it echos
-----------------------------------------
binary: binary.tmp
@cp $^ $@ ; echo Install $@
.INTERMEDIATE: binary.tmp
binary.tmp: lib
@touch $@ ; echo Link new binary in temp place
lib: obj
@if [ ! -e $@ ] ; then touch $@ ; fi ; echo $@ is up to date
obj:
@touch $@ ; echo Compile language file
-------------------------------------------------
run make once, to build 'binary' 'lib' and 'obj'. Then touch 'obj'. If you run 'make' again it echos "lib is up to date", but if you run "make -j2" it echos "lib is up to date", "Link new binary in temp place", "Install binary" and make itself prints "rm binary.tmp".
This problem appears to be related to the line "must_make=noexist;" around line 410 of remake.c. When an 'intermediate' file does not exist, but the rules for it's dependencies are still being run, it is too early to decide that the file must be created. If the rules end up not updating the dependencies, then you do not need to create a missing 'intermediate'.
This case is never encountered in the '-j1' case, as all rules are run to completion before make considers the file, so it never has a file in the "dependencies are being run" (cs_deps_running) state.
|