At Friday 02 July 2010, Lyre  wrote:
>  In Makefile.am, I wrote an custom rule which append the program's
>  path to the startup script. it looks like:
> 
>     echo $(datadir)/myprogram/program-name $OPTIONS >> /bin/program-name
> 
> I want to get :
> 
>     /usr/share/myprogram/program-name $OPTIONS
> 
> however, waht I accully get is :
> 
>     /usr/share/myprogram/program-name PTIONS
That's because make interprets the `$O' in `$OPTION' as a make macro
expansion, and since you didn't define `O' anywere, it comes out empty.
To obtain a literal `$', use:

  echo $(datadir)/myprogram/program-name $$OPTIONS >> /bin/program-name

But note that, this way, the shell will see the `$OPTIONS' token, and will
expand it as a shell variable expansion; if you don't want this, use:

  echo '$(datadir)/myprogram/program-name $$OPTIONS' >> /bin/program-name

instead.

BTW, your question was really about make, not automake; if you are using
GNU make, then you can refer to its reference manual:
  <http://www.gnu.org/software/make/manual/make.html>
or you can find more information about the standardized make behaviour here:
  <http://www.opengroup.org/onlinepubs/009695399/utilities/make.html>

HTH,
  Stefano

Reply via email to