]> Shamusworld >> Repos - rln/commitdiff
Fix makefile to work with cross-compile script.
authorShamus Hammons <jlhamm@acm.org>
Sat, 20 Dec 2014 22:59:12 +0000 (16:59 -0600)
committerShamus Hammons <jlhamm@acm.org>
Sat, 20 Dec 2014 22:59:12 +0000 (16:59 -0600)
makefile

index 4ff56c5cd586ec2b6f683dbf447294c7538693de..8fd3cc16b7af650227c573b87473d6310bcef81e 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,32 +1,27 @@
+#
 # Makefile for Reboot's Linker for Jaguar
-
+#
 RM =/bin/rm -f 
 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__
-
+#
+# Figure out which system we're compiling for, and set the appropriate
+# variables
+#
+SYSTYPE    := __GCCUNIX__
+
+ifneq "$(CROSS)" ""
+SYSTYPE    := WIN32
+else
+OSTYPE := $(shell uname -o)
+ifeq "$(findstring Msys,$(OSTYPE))" "Msys"
+SYSTYPE    := WIN32
+endif
 endif
 
-
-# Change this to -DWIN32 for Windows :-)
-#CFLAGS = -g -I. -D__GCCUNIX__
-#CFLAGS = -g -I. -DWIN32
-CFLAGS = -g -I. -D$(OSDEFINE) -O2
-
+CFLAGS = -g -I. -D$(SYSTYPE) -O2
 SRCS = rln.c 
-
 OBJS = rln.o
 
 .c.o: 
@@ -40,3 +35,4 @@ $(PROGNAME) : $(OBJS)
 
 clean: 
        $(RM) $(OBJS) $(PROGNAME) $(PROGNAME).exe *~ 
+