<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 06:22:24 +0000</lastBuildDate>
    <item>
      <title>(Makefile) Search For or Replace Spaces - michaelaskew</title>
      <link>https://snipplr.com/view/26103/search-for-or-replace-spaces</link>
      <description>&lt;p&gt;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:&#13;
&#13;
    NOTHING:=&#13;
    SPACE:=$(NOTHING) $(NOTHING)&#13;
    NAME_WITH_UNDERSCORES:=$(subst $(SPACE),_,$(NAME))&#13;
    print : ; @echo $(NAME_WITH_UNDERSCORES)&#13;
&#13;
The command&#13;
&#13;
    gmake NAME="Professor Hubert Farnsworth"&#13;
&#13;
would print&#13;
&#13;
    Professor_Hubert_Farnsworth&lt;/p&gt;</description>
      <pubDate>Thu, 07 Jan 2010 20:21:16 UTC</pubDate>
      <guid>https://snipplr.com/view/26103/search-for-or-replace-spaces</guid>
    </item>
    <item>
      <title>(Makefile) Rule to Dump Any Makefile Variable - michaelaskew</title>
      <link>https://snipplr.com/view/26102/rule-to-dump-any-makefile-variable</link>
      <description>&lt;p&gt;This rule lets you print the contents of any variable for debugging purposes. Usage:&#13;
&#13;
    &gt; gmake echo_SOURCES&#13;
    SOURCES = main.c foo.c&lt;/p&gt;</description>
      <pubDate>Thu, 07 Jan 2010 20:03:56 UTC</pubDate>
      <guid>https://snipplr.com/view/26102/rule-to-dump-any-makefile-variable</guid>
    </item>
  </channel>
</rss>
