[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automatic variables and implicit rules
From: |
Jess Telford |
Subject: |
Re: Automatic variables and implicit rules |
Date: |
Sun, 21 Dec 2008 20:41:56 +1100 |
Thanks Sam.
Using the defer assignment, I was able to get it to work exactly as I
wanted with;
CFLAGS = -g -Wall -O2 -Wa,address@hidden
However, when I added your further enhancement of dropping the suffix,
I was getting a null string again.
Turns out that you forgot the ":" in the middle there. It worked fine
with the following;
CFLAGS = -g -Wall -O2 -Wa,-ahl=$(@:.o=.s)
Thank you again for your help.
Cheers,
Jess - http://jt0.org
2008/12/21 Sam Ravnborg <address@hidden>:
>>
>> 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
>