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

From Pavan Deolasee
Subject Re: Makefiles don't seem to remember to rebuild everything anymore
Date
Msg-id CABOikdPdfzx7GvmuGpFn_Q6czrHJk=36GkBHoDx+4HjM5_w+oQ@mail.gmail.com
Whole thread Raw
In response to Re: 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
On Sat, Dec 15, 2012 at 9:53 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Cédric Villemain <cedric@2ndquadrant.com> writes:
>> Le vendredi 14 décembre 2012 23:02:11, Tom Lane a écrit :
>>> $ 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,
>
> Hm.  I should have made clear that this isn't specific to gram.o ---
> I also tried "rm analyze.o" and that didn't trigger any action either.
> So it doesn't seem to be a case of the bison rule chain being
> specifically at fault.
>
> I do suspect that this was triggered by some fairly recent makefile
> change, though, because I don't recall having seen anything as odd
> as this until recently.
>

I can confirm that this happens on Mac OSX as well. I tried a lot of
things in the Makefiles to see why the object file is not
automatically built even though objfiles.txt is clearly marked as
dependent on the OBJS.

What I found though that the change Cédric mentioned above might have
indeed introduced the problem. So if I comment out .SECONDARY
directive in Makefile.global, .o files are rebuilt properly. I saw
following in the documentation

"When a file is secondary, make will not create the file merely
because it does not already exist, but make does not automatically
delete the file."
(link: ftp://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_10.html#SEC97)

Not sure if the .o files are treated as secondary files though.

Thanks,
Pavan
--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: is allow_nonpic_in_shlib still useful?
Next
From: Tom Lane
Date:
Subject: Re: Set visibility map bit after HOT prune