]> Shamusworld >> Repos - rln/blobdiff - makefile
Fix for bug #191, thanks to jagmod for the report.
[rln] / makefile
index d49541a062f269417a2e07ac90b2f9baaa38d34f..0c14fe63e5c9a5cbaa04aae4b7f22bae45f81476 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,22 +1,38 @@
-rm=/bin/rm -f 
-CC= cc 
-PROGNAME= rln 
-LIBS= 
+#
+# Makefile for Renamed 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
+#
+SYSTYPE    := __GCCUNIX__
 
-CFLAGS= -g -I. -D__GCCUNIX__
-
-SRCS = rln.c 
+ifneq "$(CROSS)" ""
+SYSTYPE    := WIN32
+else
+OSTYPE := $(shell uname -o)
+ifeq "$(findstring Msys,$(OSTYPE))" "Msys"
+SYSTYPE    := WIN32
+endif
+endif
 
+CFLAGS = -g -I. -D$(SYSTYPE) -O2 -Wno-format
+SRCS = rln.c
 OBJS = rln.o
 
-.c.o: 
-       $(rm) $@ 
-       $(CC) $(CFLAGS) -c $*.c 
+.c.o:
+       $(RM) $@
+       $(CROSS)$(CC) $(CFLAGS) -c $*.c
+
+all: $(PROGNAME)
 
-all: $(PROGNAME) 
+$(PROGNAME) : $(OBJS)
+       $(CROSS)$(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS)
 
-$(PROGNAME) : $(OBJS) 
-       $(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS) 
+clean:
+       $(RM) $(OBJS) $(PROGNAME) $(PROGNAME).exe *~
 
-clean: 
-       $(rm) $(OBJS) $(PROGNAME) core *~