1zmk.Directories(5) Programmer's Manual zmk.Directories(5)
2
4 Directories — module providing names and rules for common directories
5
7 include z.mk
8
9 $(eval $(call ZMK.Import,Directories))
10
12 The module Directories provides names and rules for commonly used direc‐
13 tories. Is is used indirectly by other targets, to know where to install
14 files of various types, but can be also imported and used directly for
15 custom rules.
16
17 All directories are derived from the value of prefix. The default value
18 is /usr/local, which is suitable for locally-built and installed software
19 packages. Linux distribution packages are compiled with prefix of /usr,
20 along with dedicated values of sysconfdir and other variables. This cus‐
21 tomization is usually handled by invoking the configure script with spe‐
22 cific command-line options.
23
25 This module provides targets that create all the directories mentioned
26 below, also taking into account the $(DESTDIR) variable.
27
29 This module provides the following variables.
30
31 DESTDIR
32 Temporary staging location used while building software packages. It is
33 prepended to all installation targets, to allow them to be redirected to
34 another directory, usually without root privileges.
35
36 prefix
37 Prefix of all the other directories.
38
39 The default value is /usr/local.
40
41 exec_prefix
42 Prefix of directories where executables are installed.
43
44 The default value is $(prefix).
45
46 bindir
47 Directory with programs available to all users.
48
49 The default value is $(exec_prefix)/bin.
50
51 sbindir
52 Directory with programs available to system administrators.
53
54 The default value is $(exec_prefix)/sbin.
55
56 libexecdir
57 Directory with programs used not directly invoked by the user.
58
59 The default value is $(exec_prefix)/libexec.
60
61 This directory differs between two major distribution lines, RedHat and
62 Debian and their respective derivatives. The former uses /usr/libexec
63 while the latter uses /usr/lib.
64
65 datarootdir
66 Directory several classes of data files.
67
68 The default value is $(prefix)/share.
69
70 datadir
71 Directory with architecture independent data files.
72
73 The default value is $(datarootdir).
74
75 sysconfdir
76 Directory with system configuration files.
77
78 The default value is $(prefix)/etc.
79
80 In distribution packaging this directory is typically overridden to be
81 detached from prefix and hold the literal value /etc.
82
83 sharedstatedir
84 Directory with system state shared among machines on the network. Virtu‐
85 ally extinct, do not use it.
86
87 The default value is $(prefix)/com.
88
89 localstatedir
90 Directory with persistent system state, private to the current machine.
91
92 The default value is $(prefix)/var.
93
94 runstatedir
95 Directory with ephemeral system state, private to the current machine.
96
97 The default value is $(prefix)/run.
98
99 includedir
100 Directory with C, C++ and Objective C header files.
101
102 The default value is $(prefix)/include.
103
104 docdir
105 Directory with documentation specific to the project.
106
107 The default value is $(prefix)/doc/$(Project.Name). Since the value de‐
108 pends on Project.Name, it is only defined when Project.Name is non-empty.
109
110 infodir
111 Directory with documentation in the Info format.
112
113 The default value is $(prefix)/doc/info.
114
115 libdir
116 Directory with static or dynamic libraries.
117
118 The default value is $(exec_prefix)/lib.
119
120 This directory differs between Linux distributions. Some distributions
121 differentiate between 32bit and 64bit libraries while others store li‐
122 braries in a directory named after the architecture triplet they are com‐
123 piled for. It is common for one system to use a mixture of directories
124 used at the same time, mainly to adhere to file system hierarchy stan‐
125 dards.
126
127 localedir
128 Directory with localization catalogs, including message translation ta‐
129 bles.
130
131 The default value is $(datarootdir)/locale.
132
133 mandir
134 Directory root for manual pages. Actual manual pages are stored in sub-
135 directories named after the manual section number.
136
137 The default value is $(datarootdir)/man.
138
139 man1dir .. man9dir
140 Directory with manual pages of a specific section.
141
142 The default value is $(mandir)/man1 .. $(mandir)/man9.
143
145 The following example illustrates a way to install the program foo to the
146 directory with programs available to all the users. The order-only pre‐
147 requisite ensures that the target directory is created.
148
149 include z.mk
150
151 $(eval $(call ZMK.Import,Directories))
152
153 $(DESTDIR)$(bindir)/foo: foo | $(DESTDIR)$(bindir)
154 install $< $@
155
157 The Directories module first appeared in zmk 0.3
158
160 Zygmunt Krynicki <me@zygoon.pl>
161
162zmk 0.5.1 May 3, 2020 zmk 0.5.1