]> Shamusworld >> Repos - rln/blobdiff - makefile
Fixed makefile to do automagic platform detection.
[rln] / makefile
index e9e579778902db06817235f94ad18c3e0aae0f13..e784557287dae6fbee56df1d9bc33828ccde7ddb 100644 (file)
--- a/makefile
+++ b/makefile
@@ -5,9 +5,25 @@ CC = gcc
 PROGNAME = rln 
 LIBS = 
 
+# Figure out which system we're compiling for, and set the appropriate variables
+
+OSTYPE := $(shell uname -a)
+
+ifeq "$(findstring Msys,$(OSTYPE))" "Msys"                     # Win32
+
+OSDEFINE   := WIN32
+
+else                                                                                   # ???
+
+OSDEFINE   := __GCCUNIX__
+
+endif
+
+
 # Change this to -DWIN32 for Windows :-)
-CFLAGS = -g -I. -D__GCCUNIX__
+#CFLAGS = -g -I. -D__GCCUNIX__
 #CFLAGS = -g -I. -DWIN32
+CFLAGS = -g -I. -D$(OSDEFINE)
 
 SRCS = rln.c