5.14. Specifying the Working Directory

Each port is extracted into a working directory, which must be writable. The ports system defaults to having DISTFILES unpack in to a directory called ${DISTNAME}. In other words, if the Makefile has:

PORTNAME=	foo
DISTVERSION=	1.0

then the port's distribution files contain a top-level directory, foo-1.0, and the rest of the files are located under that directory.

A number of variables can be overridden if that is not the case.

5.14.1. WRKSRC

The variable lists the name of the directory that is created when the application's distfiles are extracted. If our previous example extracted into a directory called foo (and not foo-1.0) write:

WRKSRC=	${WRKDIR}/foo

or possibly

WRKSRC=	${WRKDIR}/${PORTNAME}

5.14.2. WRKSRC_SUBDIR

If the source files needed for the port are in a subdirectory of the extracted distribution file, set WRKSRC_SUBDIR to that directory.

WRKSRC_SUBDIR=	src

5.14.3. NO_WRKSUBDIR

If the port does not extract in to a subdirectory at all, then set NO_WRKSUBDIR to indicate that.

NO_WRKSUBDIR=	yes

Note:

Because WRKDIR is the only directory that is supposed to be writable during the build, and is used to store many files recording the status of the build, the port's extraction will be forced into a subdirectory.

All FreeBSD documents are available for download at https://download.freebsd.org/ftp/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.