5.12. Specifying the working directory
前一頁 | 章 5. 設定 Makefile | 下一頁

## 5.12. Specifying the working directory

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

PORTNAME= foo PORTVERSION= 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.

There are a number of variables you can override if that is not the case.

### 5.12.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`) you would write:

WRKSRC= ${WRKDIR}/foo

or possibly

WRKSRC= ${WRKDIR}/${PORTNAME}

### 5.12.2. `NO_WRKSUBDIR`

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

NO_WRKSUBDIR= yes

前一頁 | 上一層 | 下一頁
5.11. Makefile Options | 起始頁 | 5.13. `CONFLICTS`

本文及其他文件，可由此下載： ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。

若有 FreeBSD 方面疑問，請先閱讀 FreeBSD 相關文件，如不能解決的話，再洽詢 <questions@FreeBSD.org>。
關於本文件的問題，請洽詢 <doc@FreeBSD.org>。