help-make
[Top][All Lists]
Advanced

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

Re: Automatic variables and implicit rules


From: Sam Ravnborg
Subject: Re: Automatic variables and implicit rules
Date: Sun, 21 Dec 2008 08:48:48 +0100
User-agent: Mutt/1.4.2.1i

> 
> So, my modified CFLAGS looks like this;
> CFLAGS                :=      -g -Wall -O2 -Wa,-ahl=file.s

In make there are two different kind of assignments.
The one you used above ":=" where CFLAGS is assigned the
the exact value you specify on the time of assignment.

> The best option I can see for this is using the automatic variable 
> address@hidden
> Making CFLAGS look like;
> CFLAGS                :=      -g -Wall -O2 -Wa,address@hidden

And what you want to do here is to tell make to defer the assignmnet
of CFLAGS unitl you use the variable because only at that
time you know the value of address@hidden
To do so use "=" as assignment operator like this:

CFLAGS                =      -g -Wall -O2 -Wa,address@hidden

As an further enhancement you can drop the original
suffix like this:
CFLAGS = -g -Wall -O2 -Wa,-ahl=$(@.o=.s)

        Sam




reply via email to

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