Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Mar 2017 06:46:59 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 217613] FreeBSD make -- local variable $(.PREFIX) does not strip preceding directory components
Message-ID:  <bug-217613-8-koWpCjQLSL@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-217613-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-217613-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217613

--- Comment #7 from Simon J. Gerraty <sjg@FreeBSD.org> ---
Sorry I should have been more explicit, I was refering to the dependency.
If we tweak that makefile so it is consumable by both bmake and gmake

% cat tmf

.SUFFIXES: .ext .c

VPATH =3D /tmp

/tmp/target.ext: target.c
        @echo '@=3D$@ *=3D$* >=3D$> ^=3D$^'

all: target.ext
%

we cannot have $*.c as source - gmake doesn't like it,
bmake behaves as documented:

% bmake -r   -f tmf
@=3D/tmp/target.ext *=3Dtarget >=3D/tmp/target.c ^=3D

gmake just trims suffix:

% make -r -f tmf=20
@=3D/tmp/target.ext *=3D/tmp/target >=3D ^=3Dtarget.c

which I think is expected, we can better see what bmake is doing if we put =
the
$*.c back as a dependency, but qualify it.
eg.

cat tmf

.SUFFIXES: .ext .c

VPATH =3D /tmp

/tmp/target.ext: ${.CURDIR}/$*.c
        @echo '@=3D$@ *=3D$* >=3D$> ^=3D$^'

all: target.ext
%
% bmake -r   -f tmf=20
bmake: don't know how to make /tmp//tmp/target.c. Stop

but if we lose the ${.CURDIR}/ qualification it works:

% bmake -r   -f tmf=20
@=3D/tmp/target.ext *=3Dtarget >=3D/tmp/target.c ^=3D
%

on the rhs of the dependency only the suffix is trimed, once we are into the
target context the directory is also.

Bug? hard to say, it has behaved this way for 20+ years

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217613-8-koWpCjQLSL>