Prepending a backslash simply prints the backslash on my machine (bash
   3.2.48, make 3.81, I'm on an old machine).  It seems to make no
   difference to make whether I use single or double quotes.  This works
   for me:

   dumpvars: foo.o bar.o foobar
       @echo '$$(RM) is :' $(RM)
       @echo "$$^ is :" $^

   (Just doubling the $ sign).

   Richard
   Sent: Tuesday, April 18, 2017 at 4:21 PM
   From: "John Calcote" <john.calc...@gmail.com>
   To: "Richard Cavell" <richardcav...@mail.com>
   Cc: "Make List" <help-make@gnu.org>
   Subject: Re: Limiting expansion of make variables
   Actually, use \$$. Double the dollar sign to escape it for make.
   Prepend the slash (or put it in single quotes) to keep the shell from
   expanding it.

   On Apr 18, 2017 10:16 AM, "John Calcote" <[1]john.calc...@gmail.com>
   wrote:

   Use \$.


   On Apr 18, 2017 10:14 AM, "Richard Cavell" <[2]richardcav...@mail.com>
   wrote:

        Hello all.  For debugging purposes, I am trying to put this into
     my
        makefile:
        .PHONY: dumpvars
        dumpvars: source.c source.h
        @echo "$(RM) is " $(RM)
        @echo "$? expands to : " $?
        and so on.  But obviously, Make is expanding all instances of the
        variables' names.  How do I prevent this?
        TIA,
        Richard
     _______________________________________________
     Help-make mailing list
     [3]Help-make@gnu.org
     [4]https://lists.gnu.org/mailman/listinfo/help-make

References

   1. mailto:john.calc...@gmail.com
   2. mailto:richardcav...@mail.com
   3. mailto:Help-make@gnu.org
   4. https://lists.gnu.org/mailman/listinfo/help-make
_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to