CURDIR-relative paths in ports' Makefiles

Matthew Seaman matthew at FreeBSD.org
Tue Aug 27 14:03:23 UTC 2013


On 27/08/2013 13:04, Koslov Sergey wrote:
> Hello
> 
> I've noticed that many ports are using ${.CURDIR}/../../some/port
> construction in their Makefiles.
> 
> But if you copy on of these ports elsewhere it won't work as expected
> because of the relative path.
> Shouldn't they use ${PORTSDIR}/some/port instead?

The use of relative paths is taken straight from The Porter's Handbook.  eg.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-masterdir.html

So it's officially correct to do that.

While there is no direct proscription against saying
${PORTSDIR}/some/port in that circumstance that I can see in the
documentation, relative paths are generally only used in slave ports for
the ${MASTERDIR} setting or more generally for including other
Makefiles; whereas absolute paths are used for all sorts of FOO_DEPENDS
variables.  A quick (and by no means  definitive) grepping of the ports
tree I just did hasn't shown up any counter examples.

If you intend to copy a slave port to some other location in your
filesystem and have it refer to the original master port within the
default ports tree, then you're assumed to be capable of editing the
Makefile to resolve any such changes.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 268 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20130827/2f324853/attachment.sig>


More information about the freebsd-questions mailing list