Re: Makefiles don't seem to remember to rebuild everything anymore
От | Cédric Villemain |
---|---|
Тема | Re: Makefiles don't seem to remember to rebuild everything anymore |
Дата | |
Msg-id | 201212171749.23219.cedric@2ndquadrant.com обсуждение исходный текст |
Ответ на | Re: Makefiles don't seem to remember to rebuild everything anymore (Andrew Dunstan <andrew@dunslane.net>) |
Ответы |
Re: Makefiles don't seem to remember to rebuild everything anymore
|
Список | pgsql-hackers |
Le lundi 17 décembre 2012 15:29:09, Andrew Dunstan a écrit : > On 12/17/2012 08:46 AM, Peter Eisentraut wrote: > > On 12/15/12 11:23 AM, Tom Lane 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, > > > > Although it's a bit odd, it's not really a problem, I think. If you > > want to rebuild analyze.o, you should write "make analyze.o". If you > > want to rebuild postgres, run make in src/backend, and analyze.o (or > > whatever) will be rebuilt. > > That's a pretty nasty violation of the POLA. If our leading developer > thinks something about our build process is a problem, it's a problem. 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 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. 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
В списке pgsql-hackers по дате отправления: