[Bug 217613] FreeBSD make -- local variable $(.PREFIX) does not strip preceding directory components

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Mar 10 06:31:04 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217613

--- Comment #6 from Simon J. Gerraty <sjg at FreeBSD.org> ---
The handling of .PREFIX et al, is rather contorted.
Despite what the man page says, the trimming of dirs etc does not apply to
those explicitly specified.

For example :

% cat tmf
.SUFFIXES: .ext .c

.PATH: /tmp

target.ext: $*.c
        @echo '@=$@ *=$* >=$>'
        @echo '.TARGET=${.TARGET} .PREFIX=${.PREFIX} .ALLSRC=${.ALLSRC}'

all: target.ext
%
% mkdir obj
% touch target.ext
% touch target.c
% bmake -r -f tmf
@=/tmp/target.ext *=target >=/tmp/target.c
.TARGET=/tmp/target.ext .PREFIX=target .ALLSRC=/tmp/target.c
%

both target.c and target.ext were found via .PATH
and we can see that .PREFIX (*) was set to the basename without extension as
documented.  But if you make that an explicit /tmp/target.ext:
It does not.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list