[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: |
PATTON, BILLY \(SBCSI\) |
Subject: |
RE: Can I have a variable and target the same name |
Date: |
Wed, 22 Mar 2006 08:52:29 -0600 |
Greg,
Thank you for your response. I now have it working.
> -----Original Message-----
> From: Greg Chicares [mailto:address@hidden
> Sent: Wednesday, March 22, 2006 8:51 AM
> To: PATTON, BILLY (SBCSI)
> Cc: address@hidden
> Subject: Re: Can I have a variable and target the same name
>
>
> 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
>