help-make
[Top][All Lists]
Advanced

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

Re: Debugging Make


From: Ken Smith
Subject: Re: Debugging Make
Date: Thu, 25 Mar 2004 14:40:44 -0500
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

That almost does what I want. However, I would like to see nothing but plain text in this output, no make variables.

Ken

Noel Yap wrote:

I usually use "gmake -npqr" when debugging makefiles. IIRC, it's the "-p" that's the feature you describe below.

HTH,
Noel

Ken Smith wrote:

While debugging make files, I have frequently thought it might be nice to see what the files contain after make processes them. In particular, I would like to see what the rules and variables look like. Here is an example of a situation where I think this would be useful.

---BEGIN---makefile
$(SOMEPREFIX)%.new : %.in

include anotherfile.mk
---END---makefile

---BEGIN---anotherfile.mk
SOMEPREFIX = prefix
---END---anotherfile.mk

When make runs, we'll have this for the definition of the pattern rule.

---BEGIN---makefile.out
%.new : %.in
---END---makefile.out

If we had included anotherfile.mk at the top of makefile, we would instead have this.
---BEGIN---makefile.out
prefix%.new : %.in
---END---makefile.out

Sometimes, errors like this are hard to detect. I would like to be able to run my makefiles through some processor (make -someflag > makefile.out) and see what make thinks I'm telling it. here's more straightforward example.

---BEGIN---makefile
a=target
b=$(a)
c=$(b)
target=hi
d=$($(c))
---END---makefile

After running through the debugging feature I'm talking about, makefile.out would contain the following.

---BEGIN---makefile.out
a=target
b=target
c=target
target=hi
d=hi
---END---makefile.out

Does something like this already exist? If it doesn't could it be added to GNU make?

Ken Smith


_______________________________________________
Help-make mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-make







reply via email to

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