Add auto detection of MAC OS X
authorBill Lash <william.lash@gmail.com>
Sat, 22 Jun 2019 20:59:11 +0000 (15:59 -0500)
committerBill Lash <william.lash@gmail.com>
Sat, 22 Jun 2019 20:59:11 +0000 (15:59 -0500)
Makefile

index 8de6d46c08be1a60bc1e8c5d6f87287a90b1b77b..436a1b7cd03bc1c6b8260fe850a6048ebe6cadd0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,8 +8,13 @@ WCC=wcc
 # Enable compiler warnings. This is an absolute minimum.
 CFLAGS += -Wall -std=c99 #-Wextra
 
-# If compiling on Apple's MacOS, uncomment this:
-# MACOS = yes
+# Determine if we are compiling on MAC OS X
+ifneq ($(OS),Windows_NT)
+    UNAME_S := $(shell uname -s)
+    ifeq ($(UNAME_S),Darwin)
+       MACOS = yes
+    endif
+endif
 
 # strdup, strndup
 CFLAGS += -D_POSIX_C_SOURCE=200809L