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
>    http://stackoverflow.com/q/8727896/841108
> 
> 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
( http://bashdb.sourceforge.net/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:

        .SUFFIXES:
        %:: %,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.


_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to