Thread overview
Can't use macro in makefile
Sep 29, 2003
John
Sep 29, 2003
Walter
Sep 29, 2003
Matthew Wilson
September 29, 2003
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.


September 29, 2003
"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.


September 29, 2003
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.
>
>