Subject: make(8) .PREFIX issue
To: None <>
From: Hauke Fath <>
List: current-users
Date: 10/21/2004 14:27:19

setting up a Makefile for creating /etc/mail/ databases, I have come
across a skew between make(8) documentation (NetBSD 2.0, both the man
page and the pmake tutorial) and real-world behaviour.

If we look at


# Test for .PREFIX

# make(8) says:
#       .PREFIX   The file prefix of the file, containing only the file
#                 portion, no suffix or preceding directory components;

foobar.c :
	@echo ${.PREFIX}

foobar.fuh :
	@echo ${.PREFIX}

all : foobar.c foobar.fuh


and call

[hf@heiligenberg] ~/maketest > make all
[hf@heiligenberg] ~/maketest >

we find that make(8) .PREFIX does not split off _any_ suffix but only
those that it has rules for. The documentation lists no such

A line like

foo.db : ${.PREFIX}
       dosomething < ${.PREFIX}

then gives you=20

make: Graph cycles through foo.db
`foo.db' not remade because of errors.

which is, um, "misleading". My understanding of Makefiles is brittle,
anyway.  Who is at fault here: make(8) or its man page?


/~\  The ASCII Ribbon Campaign                    Hauke Fath
\ /    No HTML/RTF in email	        Institut f=FCr Nachrichtentechnik
 X     No Word docs in email	                  TU Darmstadt
/ \  Respect for open standards              Ruf +49-6151-16-3281