Subject: Re: unexpected behaviour of "make"
To: None <tech-userlevel@NetBSD.org>
From: James Chacon <jmc@NetBSD.org>
List: tech-userlevel
Date: 02/13/2005 22:23:31
On Sun, Feb 13, 2005 at 08:15:11PM +0100, Klaus Heinz wrote:
> Hi,
> 
> while working on a PR, I have observed the following:
> 
>  $ cat Makefile
>  Makefile: Makefile.PL
> 	@echo "Makefile.PL is newer than Makefile"
> 
>  $ touch Makefile ; touch Makefile.PL
>  $ ls -1t Make*
>  Makefile.PL
>  Makefile
>  $ make
>  `Makefile' is up to date.
> 
>  $ stat -f '%m'  Makefile Makefile.PL
>  1108321248
>  1108321248
> 
>  $ touch Makefile ; sleep 1; touch Makefile.PL
>  $ stat -f '%m'  Makefile Makefile.PL
>  1108321269
>  1108321270
>  $ make
>  Makefile.PL is newer than Makefile
> 
> Although Makefile.PL is newer, "make" does not recognize that Makefile is
> out of date. I guess "make" does not take time differences smaller than a
> second into account (which "ls" obviously does).
> 
> I would say this violates the POLA, doesn't it?

Only so far as make (to my experience/knowledge) has always acted like this.

Depending on anything less than 1s resolution I'm not sure is portable anyways.

James