Tue 06 Dec 2005 03:45:30 PM UTC, comment #1:
Commenting the loop around remake.c:876 out resulted in a regression that shows this loop is there for a reason. Consider the following makefile:
all: foo; @touch $@
foo:: bar; @touch $@
foo:: baz; @touch $@
If we run this makefile (with the look commented out) when bar being older than foo and baz newer then foo then all won't be updated because the decision is made based on "foo:: bar"'s timestamp. The loop ensures that all individual rules in a double-colon family end up with the "latest" timestamp.
The fix that I came up with postpones this timestamp propagation until after all individual rules have been updated (file->updated != 0). It also computes max_mtime among the entries and assigned that to each entry's last_mtime. With this approach there are not regressions in the test suite.
I am going to commit the fix shortly.
|
Tue 30 Aug 2005 08:27:29 AM UTC, original submission:
I am providing a software project with over 250 modules in Fortran and C to colleagues using different platforms, from Suns, Linux, WIN32, and portability is important to me. The software is portable, but recently I discovered that the makefile no longer works as expected under Linux with gnu make 3.80. It works with make 3.79.1 and with the Sun and Microsoft make programs. The problem is with the :: multiple dependencies. I created a simple makefile to demonstrate the problem. (In the original, I am creating a library from Fortran and C modules separately.)
test.tmp :: one.tmp
echo Dependence One>>test.tmp
test.tmp :: two.tmp
echo Dependence Two>>test.tmp
If test.tmp does not exist, both commands are to be executed. With 3.80, test.tmp is created with the first command, then tested against two.tmp, which is obviously older, and so the second is skipped. All other make's, including gnu make 3.79.1, test both conditions at the start and execute both commands, as I want.
So I tried replacing the :: with a single : with the result that 3.80 ignores the first block, telling me that the second has overwritten the first. The other make's behave as though I put everything into a single block. This is what I finally did to get portability, but then everything is reprocessed even when only one block is necessary. Rather too much than too little, but it does take longer.
Consistency with other make programs, as well as with earlier versions of the gnu program, should be paramount for something that is so fundamental. I do not want a special makefile just for gnu make 3.80 and later.
Regards, Patrick
|