[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make clarification
From: |
Paul Smith |
Subject: |
Re: make clarification |
Date: |
Tue, 17 May 2011 18:46:38 -0400 |
On Tue, 2011-05-17 at 14:40 -0700, rajesh upadhayaya wrote:
> I am trying to compile using a Gnu make under Linux. This make gives below
> error/message :
>
> 116:*** target pattern contails no '%'. Stop.
>
> Line 116 is
> $(PCCSRC): $$(@:%.c=%.pc) $(INCLUDES)
>
> In case I replace this by actual variable it works fine e.g.
> $(PCCSRC): $(PCSRC) $(INCLUDES)
>
> Other patterns like $(@:%.c=%.pc) are working fine. Problem is whereever $$
> is
> being used.
Using $$@ etc. in prerequisite lists is a special feature of Solaris
make; it's not a standard feature of make in general. Your makefile is
not portable to systems other than Solaris if it uses this feature.
> Am I missing some variable decalaration or its the problem with gcc or Linux?
In GNU make you can enable "secondary expansion" which is a similar
feature, by adding the pseudo-target ".SECONDEXPANSION:" to your
makefile (anywhere before you try to use this feature):
.SECONDEXPANSION:
Note you need a new-enough version of GNU make to support this; you
don't say what version you have.