Subject: Re: make(8) .PREFIX issue
To: Christos Zoulas <christos@zoulas.com>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
List: current-users
Date: 10/21/2004 21:04:46
At 17:00 Uhr +0000 21.10.2004, Christos Zoulas wrote:
>So $*, or ${.PREFIX} in BSD make will strip directory names and suffix
>components taking the longest suffix from the list of known suffixes.

Yes, I've learned that in the meantime.

>Yes, the man page should be clearer on that,

...insert a section about what make(8) sees as a suffix, maybe, and refer
to that?

>but the TOG man page is not much better.
>
>I suspect that what you want is:
>
>foobar.fuh:
>	@echo ${.TARGET:R}

In the end, I went with


MAKEMAP =       /usr/sbin/makemap
MMOPTS =        -v hash
DBS =           mailertable.db access.db

# Else, gives a "make: Graph cycles through mailertable.db"
.SUFFIXES       : .db

${DBS}          : ${.PREFIX}
        ${MAKEMAP} ${MMOPTS} ${.PREFIX} < ${.PREFIX}


which does the trick nicely. I'll think about the doc PR.

	hauke

--
/~\  The ASCII Ribbon Campaign
\ /    No HTML/RTF in email
 X     No Word docs in email
/ \  Respect for open standards