1zmk.OS(5) Programmer's Manual zmk.OS(5)
2
4 OS — module providing operating system information
5
7 include z.mk
8
9 $(eval $(call ZMK.Import,OS))
10
12 The module OS provides information about the operating system executing
13 zmk. It can be used to provide tailored behavior and account for differ‐
14 ences between UNIX flavours.
15
17 This module does not provide any targets.
18
20 This module provides the following variables.
21
22 OS.Kernel
23 Identifier of the operating system kernel.
24
25 Known values are listed in the following table.
26 ┌─────────────┬───────────────────────────────────────┐
27 │ Value │ Description │
28 ├─────────────┼───────────────────────────────────────┤
29 │ Darwin │ The MacOS kernel │
30 │ FreeBSD │ The FreeBSD kernel │
31 │GNU/kFreeBSD │ The FreeBSD kernel with GNU userspace │
32 │ GNU │ The Hurd kernel │
33 │ Linux │ All Linux kernel │
34 │ NetBSD │ The NetBSD kernel │
35 │ OpenBSD │ The OpenBSD kernel │
36 │ SunOS │ The Solaris kernel │
37 │ Windows_NT │ The Windows kernel │
38 │ Haiku │ The Haiku kernel │
39 └─────────────┴───────────────────────────────────────┘
40 OS.ImageFormat
41 Identifier or the application image format used.
42 ┌───────┬───────────────────────────────────────────────┐
43 │Value │ Description │
44 ├───────┼───────────────────────────────────────────────┤
45 │ ELF │ Used by most UNIX-like systems, except Darwin │
46 │Mach-O │ Used by MacOS │
47 │ PE │ Used by Windows │
48 │ MZ │ Used by DOS │
49 └───────┴───────────────────────────────────────────────┘
50 Due to cross-compiling it is more useful to look at Toolchain.ImageFormat
51 instead.
52
54 Windows is detected by the presence and specific value of the OS environ‐
55 ment variable. All other kernels are identified by invoking uname -s.
56
58 The OS module first appeared in zmk 0.1
59
61 Zygmunt Krynicki <me@zygoon.pl>
62
63zmk 0.5.1 May 3, 2020 zmk 0.5.1