Discussion:
bsd make and .IMPSRC - incomplete documentation?
(too old to reply)
Aleksey Cheusov
2008-01-20 11:43:56 UTC
Permalink
Hi. May be I missed something important but the following Makefile
doesn't work as it is documented.

man make says

.IMPSRC The name/path of the source from which the target
is to be transformed (the ``implied'' source);
also known as `<'.

IMPSRC is expanded to the empty string. What's wrong?


~> cat Makefile
file.ext : file.src
cp ${.IMPSRC} ${.TARGET}
~> touch file.src
~> make file.ext
cp file.ext
usage: cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target
cp [-R [-H | -L | -P]] [-f | -i] [-pv] src1 ... srcN directory
*** Error code 1

Stop.
make: stopped in /home/cheusov
~>
--
Best regards, Aleksey Cheusov.
Masao Uebayashi
2008-01-20 14:15:29 UTC
Permalink
.IMPSRC is expanded to the empty string. What's wrong?
As far as I understand by experience (!), ${.IMPSRC} works only when
suffix rule is applied. Bad make manual!

Masao
David Laight
2008-01-20 14:34:24 UTC
Permalink
Post by Masao Uebayashi
.IMPSRC is expanded to the empty string. What's wrong?
As far as I understand by experience (!), ${.IMPSRC} works only when
suffix rule is applied. Bad make manual!
I believe that is the historic behaviour for $<

David
--
David Laight: ***@l8s.co.uk
Aleksey Cheusov
2008-01-20 15:38:42 UTC
Permalink
Post by David Laight
Post by Masao Uebayashi
.IMPSRC is expanded to the empty string. What's wrong?
As far as I understand by experience (!), ${.IMPSRC} works only when
suffix rule is applied. Bad make manual!
I believe that is the historic behaviour for $<
Ok. I'd like to see this better documented and sent PR about this.
--
Best regards, Aleksey Cheusov.
Loading...