Skip to content

Instantly share code, notes, and snippets.

@RomuloOliveira
Last active June 12, 2017 14:55
Show Gist options
  • Save RomuloOliveira/a88ea62a686665c00312 to your computer and use it in GitHub Desktop.
Save RomuloOliveira/a88ea62a686665c00312 to your computer and use it in GitHub Desktop.
Conditional OS executable - Makefile
UNAME_S := $(shell uname -s)
# Note that this ifeq-endif are space-indented for better readability
ifeq ($(UNAME_S), Linux)
EXECUTABLE ?= linux_executable
endif
ifeq ($(UNAME_S), Darwin)
EXECUTABLE ?= osx_executable
endif
# noop fallback
EXECUTABLE ?= :
test:
EXECUTABLE "args"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment