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 CABOikdO2P9-vwEm=bgQGLAzr5m94DnSBCHEOUyQ9Rb1OuqNwKw@mail.gmail.com
Whole thread Raw
In response to Re: Makefiles don't seem to remember to rebuild everything anymore  (Cédric Villemain <cedric@2ndquadrant.com>)
List pgsql-hackers
On Mon, Dec 17, 2012 at 10:19 PM, Cédric Villemain
<cedric@2ndquadrant.com> wrote:

>
> That's not so obvious.
> The current behavior is expected by .SECONDARY.
> In other words, if I just 'touch rewriteDefine.c' then rewriteDefine.o will be
> rebuilt by make (as expected).
>
> $ touch rewriteDefine.c
> $ make
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-
> statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-
> strict-aliasing -fwrapv -fexcess-precision=standard -I../../../src/include -
> D_GNU_SOURCE   -c -o rewriteDefine.o rewriteDefine.c

Isn't that something very basic make is supposed to do anyways ?

> touch objfiles.txt
>
> It is maybe better to do a special case when you want to force rebuild, but in
> a more intuitive way than specifying each file you want to rebuild.
>

I don't understand what are we trying to achieve by doing what you did
below. ISTM that the real problem is .SECONDARY without any
prerequisites. If at all there are any files that we want to treat as
secondary and not remove at the end, shouldn't we add them as
prerequisites to this special target ? At least, that what I get
reading man pages and samples.

Thanks,
Pavan

> Like that ?!  :
>
> ====
> diff --git a/src/Makefile.global.in b/src/Makefile.global.in
> index 9cc14da..8597792 100644
> --- a/src/Makefile.global.in
> +++ b/src/Makefile.global.in
> @@ -31,8 +31,10 @@ all:
>  # started to update the file.
>  .DELETE_ON_ERROR:
>
> +ifndef NOTSECONDARY
>  # Never delete any intermediate files automatically.
>  .SECONDARY:
> +endif
> ====
>
> $ rm rewriteDefine.o
> $ make
> nothing to do ...
> $ NOTSECONDARY=1  make
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-
> statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-
> strict-aliasing -fwrapv -fexcess-precision=standard -I../../../src/include -
> D_GNU_SOURCE   -c -o rewriteDefine.o rewriteDefine.c
> touch objfiles.txt
>
>
> --
> Cédric Villemain +33 (0)6 20 30 22 52
> http://2ndQuadrant.fr/
> PostgreSQL: Support 24x7 - Développement, Expertise et Formation



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



pgsql-hackers by date:

Previous
From: Cédric Villemain
Date:
Subject: Re: Makefiles don't seem to remember to rebuild everything anymore
Next
From: Tom Lane
Date:
Subject: Re: Makefiles don't seem to remember to rebuild everything anymore