[Top][All Lists]

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

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

From: Paul Smith
Subject: Re: complex Makefile for a bootstrapped self-hosting translator [GCC MELT] ?
Date: Mon, 9 Jan 2012 13:51:58 -0500

On Mon, 2012-01-09 at 16:35 +0100, Basile Starynkevitch wrote:
> I have big trouble with my make rules (for GNU make)
> I detailed my issues in the below Stack Overflow question
> I need hints of how to debug parallel make, and how to improve
> multi-stage building.

It would be simpler for us if your questions were more specifically
targeted and detailed.  You have a lot of detail in describing your
environment but not as much in describing the problems.

For debugging GNU make there are not many options other than the -d flag
and the -p flag, both of which can be useful.  There is also remake
( ) which might help, but may be
more useful for incorrect makefiles rather than the higher-level issues
you are raising.

For debugging parallel build issues you normally just need to
characterize what the error was ("file foo was built at the same time as
file bar, but really foo needs bar to be created first") then add
prerequisites to enforce those relationships.  Obviously that's a simple
case and yours may be more complex, but you need to understand it in
detail (then provide us with that detail).

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.

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:

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

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

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.

As for "how to improve multi-stage building", that's too general a
question for me to answer.  Others might have some hints.

reply via email to

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