]> Shamusworld >> Repos - rln/commitdiff
Added cross-compilation script
authorShamus Hammons <jlhamm@acm.org>
Mon, 12 May 2014 14:55:37 +0000 (09:55 -0500)
committerShamus Hammons <jlhamm@acm.org>
Mon, 12 May 2014 14:55:37 +0000 (09:55 -0500)
cross-compile [new file with mode: 0755]
makefile

diff --git a/cross-compile b/cross-compile
new file mode 100755 (executable)
index 0000000..34b19cb
--- /dev/null
@@ -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
index 4e01425eee880e37d725232aef0a89902b30afad..4ff56c5cd586ec2b6f683dbf447294c7538693de 100644 (file)
--- 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 *~