X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=makefile;h=4ff56c5cd586ec2b6f683dbf447294c7538693de;hb=a1f6a3912c5907ca0b7d7d1404adc575c84da57f;hp=e9e579778902db06817235f94ad18c3e0aae0f13;hpb=ff28769b66909bc028d0b99ee8918305bc649348;p=rln diff --git a/makefile b/makefile index e9e5797..4ff56c5 100644 --- 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) -O2 SRCS = rln.c @@ -15,12 +31,12 @@ OBJS = rln.o .c.o: $(RM) $@ - $(CC) $(CFLAGS) -c $*.c + $(CROSS)$(CC) $(CFLAGS) -c $*.c all: $(PROGNAME) $(PROGNAME) : $(OBJS) - $(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS) + $(CROSS)$(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS) clean: - $(RM) $(OBJS) $(PROGNAME) *~ + $(RM) $(OBJS) $(PROGNAME) $(PROGNAME).exe *~