1zmk.OS(5)                     Programmer's Manual                    zmk.OS(5)
2

NAME

4     OS — module providing operating system information
5

SYNOPSIS

7     include z.mk
8
9     $(eval $(call ZMK.Import,OS))
10

DESCRIPTION

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

TARGETS

17     This module does not provide any targets.
18

VARIABLES

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     ┌─────────────┬───────────────────────────────────────┐
27Value     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     ┌───────┬───────────────────────────────────────────────┐
43Value  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

IMPLEMENTATION NOTES

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

HISTORY

58     The OS module first appeared in zmk 0.1
59

AUTHORS

61     Zygmunt Krynicki <me@zygoon.pl>
62
63zmk 0.5.1                         May 3, 2020                        zmk 0.5.1
Impressum