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

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: cedric(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: Makefiles don't seem to remember to rebuild everything anymore
Date: 2012-12-15 18:53:44
Message-ID: CABOikdPdfzx7GvmuGpFn_Q6czrHJk=36GkBHoDx+4HjM5_w+oQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 15, 2012 at 9:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> =?iso-8859-15?q?C=E9dric_Villemain?= <cedric(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2012-12-15 21:47:48 LATERAL and VOLATILE functions
Previous Message Tom Lane 2012-12-15 17:07:22 Re: is allow_nonpic_in_shlib still useful?