diff --git a/cross-compile b/cross-compile new file mode 100755 index 0000000..34b19cb --- /dev/null +++ b/cross-compile @@ -0,0 +1,12 @@ +#!/bin/bash +# +# Short script to do cross compilation with MXE on Linux +# +# by James Hammons +# (C) 2012 Underground Software +# +echo "Cross compiling for Win32..." +export PATH=/opt/mxe/usr/bin:$PATH +make CROSS=i686-pc-mingw32- +rel=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1 | tr -d -` +mv rln rln.exe && upx -9v rln.exe && zip -9v rln-$rel.zip rln.exe diff --git a/makefile b/makefile index 4e01425..4ff56c5 100644 --- a/makefile +++ b/makefile @@ -31,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 *~