Chapter 14. Order of Variables in Port Makefiles

Table of Contents
14.1. PORTNAME Block
14.2. PATCHFILES Block
14.3. MAINTAINER Block
14.4. LICENSE Block
14.5. Generic BROKEN/IGNORE/DEPRECATED Messages
14.6. The Dependencies Block
14.7. USES and USE_x
14.8. Standard bsd.port.mk Variables
14.9. Options and Helpers
14.10. The Rest of the Variables
14.11. The Targets

The first sections of the Makefile must always come in the same order. This standard makes it so everyone can easily read any port without having to search for variables in a random order.

The first line of a Makefile is always a comment containing the Subversion version control ID, followed by an empty line. In new ports, it looks like this:

# $FreeBSD$
 

In existing ports, Subversion has expanded it to look like this:

# $FreeBSD: head/ports-mgmt/pkg/Makefile 437007 2017-03-26 21:25:47Z bapt $
 

Note:

The sections and variables described here are mandatory in a ordinary port. In a slave port, many sections variables and can be skipped.

Important:

Each following block must be separated from the previous block by a single blank line.

In the following blocks, only set the variables that are required by the port. Define these variables in the order they are shown here.

14.1. PORTNAME Block

This block is the most important. It defines the port name, version, distribution file location, and category. The variables must be in this order:

Important:

Only one of PORTVERSION and DISTVERSION can be used.

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>.