help-make
[Top][All Lists]
Advanced

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

method of embedding debug statements in your rules


From: gk
Subject: method of embedding debug statements in your rules
Date: Wed, 22 Jan 2003 18:53:38 -0800

Just wanted to pass along this simple method of embedding debug statements in your rules. The problem is that you don't want non-zero status causing make to exit, such as would happen when $(debug) is false, with:
test:
        @$(debug) && echo hi

# Makefile
.PHONY: test
ifeq ($(debug),true)
nodebug:=false
else
nodebug:=true
endif

test:
        @$(nodebug) || echo hi
#eof

address@hidden junk]$ debug=true;make
hi
address@hidden junk]$ debug=false;make
address@hidden junk]$

- Greg Keraunen
http://www.xmake.org
http://www.xmlmake.com





reply via email to

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