Subject: Re: make(1) feature request: $<
To: None <mason@primenet.com.au>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: current-users
Date: 01/02/1999 14:20:42
mason@primenet.com.au (Geoff Wing) typed:
> Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de> typed:
> :It seems our make doesn't support $< as synonym for ${.ALLSRC}.
> :There is a number of (free) software out there that utilizes this feature,
> :which is provided by GNU make. Having this also in our make(1) would help
> :a bit. Thanks!
>
> Huh? Sure it supports $< but it's not a synonym for ${.ALLSRC} and it's
> not supposed to be. RTFM make(1):
>
> Local variables
> [....]
> .ALLSRC The list of all sources for this target; also known as
> `>'.
> [....]
> .IMPSRC The name/path of the source from which the target is to
> be transformed (the ``implied'' source); also known as
> `<'.
>
> Can you give an example of it failing to work?
I think in GNU make, $< is indeed a synonym for ${.ALLSRC}. When I
made the math/R package, I had to make a lot of identical changes to
makefiles that looked like (pseudo-diff format):
all: $(LIB)
@$(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)/libs
- @cp $< $(top_builddir)/library/$(pkg)/libs
+ @cp $(LIB) $(top_builddir)/library/$(pkg)/libs
The original makefiles worked with GNU make, but not with our make(1).
I checked the behaviour of make(1) on a HP-UX system, and their
semantics matched ours. GNU make seems to be the incompatible one
here. I ended up sending the R authors the above "fixes" to their
makefiles so as not to depend on GNU make.
--
Johnny C. Lam
Department of Statistics lamj@stat.cmu.edu
Carnegie Mellon University http://www.stat.cmu.edu/~lamj/
@>---`---,----