help-make
[Top][All Lists]
Advanced

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

Re: outputting which dependencies triggered a target action


From: John Graham-Cumming
Subject: Re: outputting which dependencies triggered a target action
Date: Sat, 20 Aug 2005 14:00:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104

Noel Yap wrote:
Is there an option less verbose than --debug that outputs which dependencies triggered a target action?

You can hack it like this:

    OLD_SHELL := $(SHELL)
SHELL = $(warning Building $@ $(if $?,because $? newer,because $@ is missing))$(OLD_SHELL)

Then you'll get a lot of warnings. If you filter on just those that mention a Makefile name and line number you'll see something like this:

    shell3.mak:8: Building foo because foo is missing
    shell3.mak:8: Building bar because bar is missing
    shell3.mak:5: Building all because foo bar newer

for a Makefile like that:

    all: foo bar
        @echo Make all

    foo bar:
        @echo Make $@

I am planning to write an article for CM Crossroads about tricks with redefining SHELL for the October CM Basics.

John.
--
John Graham-Cumming
address@hidden

Home: http://www.jgc.org/
POPFile: http://getpopfile.org/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/




reply via email to

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