[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: passing define values from Makefile to gcc?

From: Paul Smith
Subject: Re: Q: passing define values from Makefile to gcc?
Date: Thu, 16 Oct 2003 08:25:18 -0400

> I currently have the problem that I want to pass a define from the =
> Makefile to=20 gcc with a value which contains a space.

> gcc -D'mv=my value'

> But everytime gcc only tries to treat "value" as a file and of course
> = does not=20 find it ...

> How do I have to protect the expression to get it passed to gcc ?

This is really a shell question, not a make question.  You need to quote
the value so that the shell treats it as one argument.

The above command _WILL_ treat the value as one argument, so if your
quoting is as you describe above that should work from the shell's
perspective.  Note, though, that if you're trying to set a C macro to
expand to a string you need to quote the value to the compiler as well
as to the shell; something like:

    -D'mv="my value"'

If you can't figure it out please provide real live examples of what
you're trying to do.

 Paul D. Smith <address@hidden>   HASMAT: HA Software Mthds & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
   These are my opinions---Nortel Networks takes no responsibility for them.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]