help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: complex Makefile for a bootstrapped self-hosting translator [GCC MEL


From: Michael Ludwig
Subject: Re: complex Makefile for a bootstrapped self-hosting translator [GCC MELT] ?
Date: Sat, 14 Jan 2012 22:27:06 +0100
User-agent: Mutt/1.5.20 (2009-12-10)

Paul Smith schrieb am 09.01.2012 um 13:51 (-0500):
> On Mon, 2012-01-09 at 16:35 +0100, Basile Starynkevitch wrote:

> For "do nothing" wait time, the output of -d is helpful and will
> probably show you that you have pattern rules that are being checked
> over and over.  The more pattern rules you have (especially "match
> anything" pattern rules) the longer make will take to compute and
> check all those options.  -d will show you all it's doing.

The output of make -d is instructive indeed.

> If you haven't done so yet (and you don't need the builtin rules which
> many makefiles don't), you can remove all builtin implicit rules by
> adding this to your makefile:
> 
>         .SUFFIXES:

This clears the suffixes Make is going to make filesystem checks for.
But what does the following do? I understand %,v is for CVS, RCS is its
predecessor, and SCCS seems to have been a competitor of RCS.

>         %:: %,v
>         %:: RCS/%,v
>         %:: RCS/%
>         %:: s.%
>         %:: SCCS/s.%

Okay, the double colon seems to mark a rule as "terminal":

  When a rule is terminal, it does not apply unless its prerequisites
  actually exist. Prerequisites that could be made with other implicit
  rules are not good enough. In other words, no further chaining is
  allowed beyond a terminal rule.

http://www.gnu.org/software/make/manual/html_node/Match_002dAnything-Rules.html

>From comparing "make -d" output before and after the termination of the
CVS/RCS/SCCS rules, I can see that Make got rid of stuff like the
following:

        Trying implicit prerequisite `GNUmakefile,v'.
        Trying pattern rule with stem `GNUmakefile'.
        Trying implicit prerequisite `RCS/GNUmakefile,v'.
        Trying pattern rule with stem `GNUmakefile'.
        Trying implicit prerequisite `RCS/GNUmakefile'.
        Trying pattern rule with stem `GNUmakefile'.
        Trying implicit prerequisite `s.GNUmakefile'.
        Trying pattern rule with stem `GNUmakefile'.
        Trying implicit prerequisite `SCCS/s.GNUmakefile'.
        Trying pattern rule with stem `GNUmakefile'.

        Trying pattern rule with stem `all.cpp'.
        Trying implicit prerequisite `all.cpp,v'.
        Trying pattern rule with stem `all.cpp'.
        Trying implicit prerequisite `RCS/all.cpp,v'.
        Trying pattern rule with stem `all.cpp'.
        Trying implicit prerequisite `RCS/all.cpp'.
        Trying pattern rule with stem `all.cpp'.
        Trying implicit prerequisite `s.all.cpp'.
        Trying pattern rule with stem `all.cpp'.
        Trying implicit prerequisite `SCCS/s.all.cpp'.

These CVS/RCS/SCCS defaults rules seem to be historic.

> Even if you do need some builtin rules it's often better to remove
> them all then add back the ones you want explicitly.

.SUFFIXES:
.SUFFIXES: .cpp .obj

%:: %,v
%:: RCS/%,v
%:: RCS/%
%:: s.%
%:: SCCS/s.%

This reduced my "make -d" output by 70 %. What's left makes sense.

Michael

> If that doesn't help use -d and try to figure out what's taking so
> long then provide some details for us to look at.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]