[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can I have a variable and target the same name
From: |
Greg Chicares |
Subject: |
Re: Can I have a variable and target the same name |
Date: |
Wed, 22 Mar 2006 14:50:52 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
On 2006-3-22 14:25 UTC, PATTON, BILLY (SBCSI) wrote:
> Can I have a variable and a target be the same name
>
> clean+ldw+ldwrbc+library := ${PRD_TREE}/ldw/ldwrbc/lib/libldwrbc.a
>
> clean+ldw+ldwrbc+library :
> <tab>$(RM) $(clean+ldw+ldwrbc+library)
Well, the first makefile below does work the way I think you expect
with 3.79.1 and make-3.81beta4. But don't you find it confusing?
foo := bar
.PHONY: foo
foo:
@echo $(foo)
[output]
Making target foo
bar
Instead, why not write the following?
foo := bar
.PHONY: $(foo)
$(foo):
@echo Making target $@
@echo $(foo)
[output]
Making target bar
bar