Source Package Format 2.0

Chapter 7 - Build System

7.1 Build Makefile

A file named build directs the process of building and installing data files to be provided by binary packages. It must be a makefile, and it must be executable by all users.

The first line of this file must name a make(1) interpreter in a magic number sample as follows:

#! /usr/bin/make -f

Any number of spaces and/or tabs may be used after the #! magic number and before the -f argument.

The following targets are required:

The required targets and their dependencies must not require interactive user input.

Additional targets may exist in the build makefile.

Certain environment variables (see § 7.3) shall be set when the build makefile is executed.

7.2 Build Work Area

When building packages, a new directory named tmp shall be created in the source package directory. In this directory, the package source code shall be copied or unpacked into a directory called src shall be created.

After all expected binary packages have been built, the work area (tmp and its children) shall be removed.

7.3 Environment Variables

Certain environment variables shall be set to provide to the configuration script and build makefile information about the package and the environments in and for which binary packages are to be built.

The terms "build system" and "host system" below are used according to the convention set by GNU Autoconf. The build system is the type of system on which a package is built. The host system is the type of system on which a binary package is expected to be natively installed and used.

7.3.1 Package Variables

The following environment variables shall be set to describe the source package:

7.3.2 Build and Host System Variables

The following environment variables shall be set to describe the build system:

The following environment variables shall be set to describe the host system:

7.3.3 Toolchain Variables

The following environment variables shall be set to describe the toolchain:

Note that this list of environment variables assumes the use of GNU Binutils, GCC, and the ELF binary format. Support for other toolchains may be specified in a future version of this source package format.