[Top][All Lists]

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

Re: HOWTO debug makefiles?

From: Paul D. Smith
Subject: Re: HOWTO debug makefiles?
Date: Sat, 6 Mar 2004 02:04:34 -0500

%% "Villalovos, John L" <address@hidden> writes:

  vjl> I was wondering if there was some information out there on howto
  vjl> debug makefiles.

Flags passed to the top-level make _should_ be passed to all submakes,
unless the parent make goes out of its way to remove them.

So you should be able to use make -p and/or make -d and that should be
true when your makefile is invoked.

  vjl> Is there a way to echo out a variable even if I don't have a target
  vjl> which is getting called in my Makefile?

Sure; just use something like:

  $(warning variable FOO = $(FOO))

You can also use $(shell) to run shell commands, like this:

  $(shell env | sort 1>&2)

this will show what variables are exported to the environment for
example.  Remember for $(shell) that you have to redirect the output to
stderr, because $(shell) in make behaves like `` (backquotes) do in the
shell or Perl.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

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