chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] make madness.


From: Perry E. Metzger
Subject: Re: [Chicken-users] make madness.
Date: 13 Aug 2002 23:01:42 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"Perry E. Metzger" <address@hidden> writes:
> Okay, I was slightly off. from what I can tell, the $< construct isn't
> nearly as portable as one would think. It is for use only inside of
> rules constructs (i.e. .c.o: or what have you) and not for use inside
> of any Makefile construct. gmake's use of $< outside of a suffix rule
> is non-portable. Sigh.

I just checked Solaris. Looks like you really can't use $< that
way. The rest of this message is a direct quote from 
http://docs.sun.com/?p=/doc/802-5880/6i9k05dho&a=view

----------------------------------------------------------------------
Dynamic Macros

Although the dynamic macros $< and $* were documented as being
assigned only for implicit rules and the .DEFAULT target, in some
cases they actually were assigned for explicit target entries. The
 assignment action is now documented properly.

The actual value assigned to each of these macros is derived by the
same procedure used within implicit rules (this rule has not
changed). You can receive unexpected results when you use them in
explicit target entries.

Even if you supply explicit dependencies, make does not use them to
derive values for these macros. Instead, it searches for an
appropriate implicit rule and dependency file. For instance, if you
have the explicit target entry:

test: test.f 
                @echo $< 

and the files: test.c and test.f, you might expect that $< would be
assigned the value test.f. This is not the case. It is assigned
test.c, because .c is ahead of .f in the suffixes list: 

$ make test 
test.c 
----------------------------------------------------------------------




reply via email to

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