about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDannyArends2018-02-28 15:46:43 +0100
committerDannyArends2018-02-28 15:46:43 +0100
commitf44ff52a81650cf5f2a6b1e11f0194e468756672 (patch)
tree0fe6776cb9997d5234bb311a904e6f70d25dbc23
parent1b4bdcfabe6d618548114fecba93c8188fb4a7dc (diff)
downloadpangemma-f44ff52a81650cf5f2a6b1e11f0194e468756672.tar.gz
OS detection, and version script generator selection via VGEN
-rw-r--r--Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f8bacbf..23b834f 100644
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,19 @@
 GEMMA_VERSION = $(shell cat ./VERSION)
 
 # Set this variable to either LNX or MAC
-SYS                    = LNX # LNX|MAC (Linux is the default)
+ifeq ($(OS),Windows_NT)
+  SYS = WIN
+  VGEN = scripts/gen_version_info.cmd
+else
+  UNAME_S := $(shell uname -s)
+  ifeq ($(UNAME_S),Darwin)
+    SYS = MAC
+  else
+    SYS = LNX # default to linux
+  endif
+  VGEN = scripts/gen_version_info.sh
+endif
+
 # Leave blank after "=" to disable; put "= 1" to enable
 DIST_NAME              = gemma-$(GEMMA_VERSION)
 DEBUG                  = 1                # DEBUG mode, set DEBUG=0 for a release
@@ -149,7 +161,7 @@ OBJS = $(SOURCES:.cpp=.o)
 all: $(OUTPUT)
 
 ./src/version.h:
-	./scripts/gen_version_info.sh > src/version.h
+	$(VGEN) > src/version.h
 
 $(OUTPUT): $(OBJS)
 	$(CPP) $(CPPFLAGS) $(OBJS) $(LIBS) -o $(OUTPUT)