Quantcast
Channel: Debugging – Michael Tsai
Viewing all articles
Browse latest Browse all 170

The One Line You Should Add to Every Makefile

$
0
0

John Graham-Cumming, who’s just written the GNU Make Book (Amazon):

It’s:

print-%: ; @echo $*=$($*)

It allows you to quickly get the value of any makefile variable. For example, suppose you want to know the value of a variable called SOURCE_FILES. You’d just type:

make print-SOURCE_FILES

This works with the 2006 version of GNU Make that comes with Xcode.


Viewing all articles
Browse latest Browse all 170

Trending Articles