Re: Makefiles don't seem to remember to rebuild everything anymore - Mailing list pgsql-hackers

From Cédric Villemain
Subject Re: Makefiles don't seem to remember to rebuild everything anymore
Date
Msg-id 201212151335.34960.cedric@2ndquadrant.com
Whole thread Raw
In response to Makefiles don't seem to remember to rebuild everything anymore  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Makefiles don't seem to remember to rebuild everything anymore
List 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@gmx.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
abad 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.cgram.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

pgsql-hackers by date:

Previous
From: "Erik Rijkers"
Date:
Subject: small pg_basebackup display bug
Next
From: Pavan Deolasee
Date:
Subject: Set visibility map bit after HOT prune