axiom-developer
[Top][All Lists]
Advanced

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

About shell commands in Makefile (was Re: [Axiom-developer] First (quic


From: David MENTRE
Subject: About shell commands in Makefile (was Re: [Axiom-developer] First (quick & dirty) port of Axiom to gcl-2.5.2 and powerpc architecture)
Date: 04 May 2003 10:43:07 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hello tim,

root <address@hidden> writes:

> (B) SHELL COMMANDS IN MAKEFILES
> 
> You should be able to override the SPD variable on the make line with
> 
> make SPD=/home/david/pub
[...] 
> The primary failure is that I don't understand a way to get make to
> execute shell commands. I tried ($shell basename $AXIOM) but that
> also fails. 

You should use the "VAR := $(shell command)" syntax, like in the following
example:

VAR := $(shell pwd)

default:
        @echo $(VAR)


By the way, it is better to use the ":=" assignement in make rather than
"=" assignement. ":=" is evaluated only one, while with the other
assignement, "=", the variable is recursively expanded which can create
slow makefile and unpredicatable results with shell expansion. Look at
make documentation for more precise info (The Two Flavors of Variable
chapter).

> Note that the AXIOM variable is used at runtime to find the libraries
> so we can't just truncate it to "linux" or "power-pc". We could, of
> course, define two variables rather than one.

Maybe we should stick to the GNU way of naming systems like
'powerpc-linux' or 'i386-bsd'?

Best regards,
d.
-- 
 address@hidden




reply via email to

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