www.digitalmars.com         C & C++   DMDScript  

c++.command-line - Can't use macro in makefile

reply John <John_member pathlink.com> writes:
For example, I have this in my makefile:
CPP = dmc

and I want to use it as:
${CPP} abcde.cpp

The compiler print this out at console:
Error on line 3: '}' is not a valid filename char

I'm using normal make shipped with dmc 8.36, not smake.
Sep 29 2003
next sibling parent "Walter" <walter digitalmars.com> writes:
"John" <John_member pathlink.com> wrote in message
news:bl9dmd$2t09$1 digitaldaemon.com...
 For example, I have this in my makefile:
 CPP = dmc

 and I want to use it as:
 ${CPP} abcde.cpp

 The compiler print this out at console:
 Error on line 3: '}' is not a valid filename char

 I'm using normal make shipped with dmc 8.36, not smake.

Use (), not {}, to expand macros.
Sep 29 2003
prev sibling parent "Matthew Wilson" <matthew stlsoft.org> writes:
In my limited experience, only Borland's make (and maybe Microsoft's nmake)
use curly braces. The portable way to do it is to use round braces

"John" <John_member pathlink.com> wrote in message
news:bl9dmd$2t09$1 digitaldaemon.com...
 For example, I have this in my makefile:
 CPP = dmc

 and I want to use it as:
 ${CPP} abcde.cpp

 The compiler print this out at console:
 Error on line 3: '}' is not a valid filename char

 I'm using normal make shipped with dmc 8.36, not smake.

Sep 29 2003