Do not write anything after the .include
<bsd.port.mk> line. It usually can be
avoided by including bsd.port.pre.mk
somewhere in the middle of your Makefile
and bsd.port.post.mk at the end.
Include either the
bsd.port.pre.mk/bsd.port.post.mk
pair or bsd.port.mk only; do not mix
these two usages.
bsd.port.pre.mk only defines a few
variables, which can be used in tests in the
Makefile,
bsd.port.post.mk defines the rest.
Here are some important variables defined in
bsd.port.pre.mk (this is not the complete
list, please read bsd.port.mk for the
complete list).
| Variable | Description |
|---|---|
ARCH | The architecture as returned by uname
-m (e.g., i386) |
OPSYS | The operating system type, as returned by
uname -s (e.g.,
FreeBSD) |
OSREL | The release version of the operating system
(e.g., 2.1.5 or
2.2.7) |
OSVERSION | The numeric version of the operating system; the
same as __FreeBSD_version. |
LOCALBASE | The base of the “local” tree (e.g.,
/usr/local) |
PREFIX | Where the port installs itself (see more on
PREFIX). |
If you have to define the variables
USE_IMAKE or
MASTERDIR, do so before including
bsd.port.pre.mk.
Here are some examples of things you can write after
bsd.port.pre.mk:
You did remember to use tab instead of spaces after
BROKEN= and
:-).
This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.