help-make
[Top][All Lists]
Advanced

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

Re: how to identify the prerequisite causing the build?


From: David Boyce
Subject: Re: how to identify the prerequisite causing the build?
Date: Thu, 8 Dec 2011 01:00:36 -0500

On Thu, Dec 8, 2011 at 12:28 AM, Martin d'Anjou
<address@hidden> wrote:
> Hi,
>
> I run make with -d, but there are thousands and thousands of lines... I am
> not expecting a re-build, but make thinks a rebuilt is in order. The problem
> is that I cannot find why make thinks this is the right thing to do. Based
> on what make wants to build, no prerequisite is missing, but how do I get
> make to tell me exactly the chain of prerequisites that causes the rebuild?
>
> I do not find a "File does not exist" message, or a missing prerequisite,
> all I see is "Prerequisite is older than target". What should I look for?

For debugging purposes you could try adding the line "echo Rebuilding
due to $?".

In fact I think I've seen a trick something like this:

SHELL = $(info Rebuilding due to $?)/bin/sh

The $(info) causes a print and then disappears leaving /bin/sh to do
its usual job. With the right quoting you should be able to pass this
on the command line and not have to modify the Makefile.

-David Boyce



reply via email to

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