Re: Makefiles don't seem to remember to rebuild everything anymore

From: Cédric Villemain <cedric(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: Makefiles don't seem to remember to rebuild everything anymore
Date: 2012-12-15 12:35:16
Message-ID: 201212151335.34960.cedric@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le vendredi 14 décembre 2012 23:02:11, Tom Lane a écrit :
> In a fully-built source tree:
>
> $ cd pgsql/src/backend/parser
> $ make
> make: Nothing to be done for `all'.
> ... okay so far ...
> $ rm gram.o
> rm: remove regular file `gram.o'? y
> $ make
> make: Nothing to be done for `all'.
>
> WTF?

A previous patch changed the ".SECONDARY" from an if() section to the main
section of src/Makefile.global.in, thus this target is triggered by each 'make'
call.

===
commit 1eb1dde (HEAD, refs/bisect/bad)
Author: Peter Eisentraut <peter_e(at)gmx(dot)net>
Date: Wed Oct 31 23:33:35 2012 -0400

Have make never delete intermediate files automatically

Several hacks in certain modes already thought this was a bad idea, so
just disable it globally.
===

So 'one' fix for this case of gram.o is to add gram.c to the .SECONDARY, like
this in the parser/Makefile

# scan is compiled as part of gram
+.SECONDARY: gram.c
gram.o: scan.c

While it fixes the example, I wonder if we have to maintain each intermediate
files in Makefiles like that.... I also am not sure why the .SECONDARY has been
moved up in the Makefile.global.in (removing this target completely also fix the
issue)

Hope it helps you and Peter find the good fix.
--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2012-12-15 12:42:13 Set visibility map bit after HOT prune
Previous Message Erik Rijkers 2012-12-15 10:39:22 small pg_basebackup display bug