Scroll to navigation

zmk.Directories(5) File Formats Manual (prm) zmk.Directories(5)

NAME

Directoriesmodule providing names and rules for common directories

SYNOPSIS

include z.mk

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

DESCRIPTION

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.

TARGETS

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

VARIABLES

This module provides the following variables.

DESTDIR

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

Prefix of all the other directories.

The default value is /usr/local.

exec_prefix

Prefix of directories where executables are installed.

The default value is .

bindir

Directory with programs available to all users.

The default value is .

sbindir

Directory with programs available to system administrators.

The default value is .

libexecdir

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 .

datarootdir

Directory several classes of data files.

The default value is .

datadir

Directory with architecture independent data files.

The default value is .

sysconfdir

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 .

sharedstatedir

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

The default value is .

localstatedir

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

The default value is .

runstatedir

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

The default value is .

includedir

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

The default value is .

docdir

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.

infodir

Directory with documentation in the Info format.

The default value is .

libdir

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.

localedir

Directory with localization catalogs, including message translation tables.

The default value is .

mandir

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

The default value is .

man1dir .. man9dir

Directory with manual pages of a specific section.

The default value is .. .

EXAMPLES

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 $< $@

HISTORY

The Directories module first appeared in zmk 0.3

AUTHORS

Zygmunt Krynicki <me@zygoon.pl>

May 3, 2020 zmk 0.5.1