Subject: make(8) .PREFIX issue
To: None <current-users@netbsd.org>
From: Hauke Fath <hf@tangro.de>
List: current-users
Date: 10/21/2004 14:27:19
Hi,

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

</snip>

# Test for .PREFIX

# make(8) says:
#=20
#       .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

</snip>

and call

[hf@heiligenberg] ~/maketest > make all
foobar
foobar.fuh
[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
restriction.

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?

    hauke

--=20
/~\  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