<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/favorites/michaelaskew</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sun, 19 May 2013 18:05:00 GMT</pubDate>
<item>
<title>(Makefile) Search For or Replace Spaces - michaelaskew</title>
<link>http://snipplr.com/view/26103/search-for-or-replace-spaces/</link>
<description><![CDATA[ <p>Make (and GMake) ignore spaces in many constructs, making it difficult to use a single space as a search string or a replacement string, for example. This trick works around the problem by assigning the space to a variable named SPACE and using that instead. So given this makefile:

    NOTHING:=
    SPACE:=$(NOTHING) $(NOTHING)
    NAME_WITH_UNDERSCORES:=$(subst $(SPACE),_,$(NAME))
    print : ; @echo $(NAME_WITH_UNDERSCORES)

The command

    gmake NAME="Professor Hubert Farnsworth"

would print

    Professor_Hubert_Farnsworth</p> ]]></description>
<pubDate>Thu, 07 Jan 2010 20:21:16 GMT</pubDate>
<guid>http://snipplr.com/view/26103/search-for-or-replace-spaces/</guid>
</item>
<item>
<title>(Makefile) Rule to Dump Any Makefile Variable - michaelaskew</title>
<link>http://snipplr.com/view/26102/rule-to-dump-any-makefile-variable/</link>
<description><![CDATA[ <p>This rule lets you print the contents of any variable for debugging purposes. Usage:

    > gmake echo_SOURCES
    SOURCES = main.c foo.c</p> ]]></description>
<pubDate>Thu, 07 Jan 2010 20:03:56 GMT</pubDate>
<guid>http://snipplr.com/view/26102/rule-to-dump-any-makefile-variable/</guid>
</item>
</channel>
</rss>