OS — module providing operating system information
Contents
Description
The module OS provides information about the operating system executing zmk. It can be used to provide
tailored behavior and account for differences between UNIX flavours.
History
The OS module first appeared in zmk 0.1
Implementation Notes
Windows is detected by the presence and specific value of the OS environment variable. All other kernels
are identified by invoking uname-s.
Name
OS — module providing operating system information
Synopsis
include z.mk
$(eval $(call ZMK.Import,OS))
Targets
This module does not provide any targets.
Variables
This module provides the following variables.
OS.Kernel
Identifier of the operating system kernel.
Known values are listed in the following table.
┌──────────────┬───────────────────────────────────────┐
│ Value │ Description │
├──────────────┼───────────────────────────────────────┤
│ Darwin │ The MacOS kernel │
│ FreeBSD │ The FreeBSD kernel │
│ GNU/kFreeBSD │ The FreeBSD kernel with GNU userspace │
│ GNU │ The Hurd kernel │
│ Linux │ All Linux kernel │
│ NetBSD │ The NetBSD kernel │
│ OpenBSD │ The OpenBSD kernel │
│ SunOS │ The Solaris kernel │
│ Windows_NT │ The Windows kernel │
│ Haiku │ The Haiku kernel │
└──────────────┴───────────────────────────────────────┘
OS.ImageFormat
Identifier or the application image format used.
┌────────┬───────────────────────────────────────────────┐
│ Value │ Description │
├────────┼───────────────────────────────────────────────┤
│ ELF │ Used by most UNIX-like systems, except Darwin │
│ Mach-O │ Used by MacOS │
│ PE │ Used by Windows │
│ MZ │ Used by DOS │
└────────┴───────────────────────────────────────────────┘
Due to cross-compiling it is more useful to look at Toolchain.ImageFormat instead.
