DOKK / manpages / debian 12 / zmk-doc / zmk.Directories.5.en
zmk.Directories(5) File Formats Manual (prm) zmk.Directories(5)

Directoriesmodule providing names and rules for common directories

include z.mk

$(eval $(call ZMK.Import,Directories))

The module Directories provides names and rules for commonly used directories. Is is used indirectly by other targets, to know where to install files of various types, but can be also imported and used directly for custom rules.

All directories are derived from the value of prefix. The default value is /usr/local, which is suitable for locally-built and installed software packages. Linux distribution packages are compiled with prefix of , along with dedicated values of sysconfdir and other variables. This customization is usually handled by invoking the script with specific command-line options.

This module provides targets that create all the directories mentioned below, also taking into account the $(DESTDIR) variable.

This module provides the following variables.

Temporary staging location used while building software packages. It is prepended to all installation targets, to allow them to be redirected to another directory, usually without root privileges.

Prefix of all the other directories.

The default value is /usr/local.

Prefix of directories where executables are installed.

The default value is .

Directory with programs available to all users.

The default value is .

Directory with programs available to system administrators.

The default value is .

Directory with programs used not directly invoked by the user.

The default value is .

This directory differs between two major distribution lines, RedHat and Debian and their respective derivatives. The former uses while the latter uses .

Directory several classes of data files.

The default value is .

Directory with architecture independent data files.

The default value is .

Directory with system configuration files.

The default value is .

In distribution packaging this directory is typically overridden to be detached from prefix and hold the literal value .

Directory with system state shared among machines on the network. Virtually extinct, do not use it.

The default value is .

Directory with persistent system state, private to the current machine.

The default value is .

Directory with ephemeral system state, private to the current machine.

The default value is .

Directory with C, C++ and Objective C header files.

The default value is .

Directory with documentation specific to the project.

The default value is . Since the value depends on Project.Name, it is only defined when Project.Name is non-empty.

Directory with documentation in the Info format.

The default value is .

Directory with static or dynamic libraries.

The default value is .

This directory differs between Linux distributions. Some distributions differentiate between 32bit and 64bit libraries while others store libraries in a directory named after the architecture triplet they are compiled for. It is common for one system to use a mixture of directories used at the same time, mainly to adhere to file system hierarchy standards.

Directory with localization catalogs, including message translation tables.

The default value is .

Directory root for manual pages. Actual manual pages are stored in sub-directories named after the manual section number.

The default value is .

Directory with manual pages of a specific section.

The default value is .. .

The following example illustrates a way to install the program to the directory with programs available to all the users. The prerequisite ensures that the target directory is created.

include z.mk

$(eval $(call ZMK.Import,Directories))

$(DESTDIR)$(bindir)/foo: foo | $(DESTDIR)$(bindir)
	install $< $@

The Directories module first appeared in zmk 0.3

Zygmunt Krynicki <me@zygoon.pl>

May 3, 2020 zmk 0.5.1