CURDIR-relative paths in ports' Makefiles

2013-08-27 Thread Koslov Sergey

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?

Thanks for the replies.

Kozlov Sergey
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: CURDIR-relative paths in ports' Makefiles

2013-08-27 Thread Matthew Seaman
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




signature.asc
Description: OpenPGP digital signature