zmk.OS - Man Page

module providing operating system information

Synopsis

include z.mk

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

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.

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.

ValueDescription
==
DarwinThe MacOS kernel
FreeBSDThe FreeBSD kernel
GNU/kFreeBSDThe FreeBSD kernel with GNU userspace
GNUThe Hurd kernel
LinuxAll Linux kernel
NetBSDThe NetBSD kernel
OpenBSDThe OpenBSD kernel
SunOSThe Solaris kernel
Windows_NTThe Windows kernel
HaikuThe Haiku kernel

OS.ImageFormat

Identifier or the application image format used.

ValueDescription
==
ELFUsed by most UNIX-like systems, except Darwin
Mach-OUsed by MacOS
PEUsed by Windows
MZUsed by DOS

Due to cross-compiling it is more useful to look at Toolchain.ImageFormat instead.

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.

History

The OS module first appeared in zmk 0.1

Authors

Zygmunt Krynicki <me@zygoon.pl>

Info

May 3, 2020