Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Switch on operating system to choose different things

Once in a while you need to define variables different based on the OS that’s running make. One can use uname -s and switch on the output to differeniate e.g. Linux and Darwin (macOS).

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
	DYLIB_SUFFIX = .so
endif
ifeq ($(UNAME_S),Darwin)
	DYLIB_SUFFIX = .dylib
endif
Last change: , commit: 7a0eef2