12.17 Avoid use of the .error construct

The correct way for a Makefile to signal that the port can not be installed due to some external factor (for instance, the user has specified an illegal combination of build options) is to set a nonblank value to IGNORE. This value will be formatted and shown to the user by make install.

It is a common mistake to use .error for this purpose. The problem with this is that many automated tools that work with the ports tree will fail in this situation. The most common occurrence of this is seen when trying to build /usr/ports/INDEX (see Section 9.1). However, even more trivial commands such as make -V maintainer also fail in this scenario. This is not acceptable.

Example 12-1. How to avoid using .error

Assume that someone has the line

in make.conf. The first of the next two Makefile snippets will cause make index to fail, while the second one will not:

.error "POINTYHAT is not supported"
IGNORE=POINTYHAT is not supported
For questions about the FreeBSD ports system, e-mail <ports@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.