summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-12-25 07:47:25 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2010-12-25 07:47:25 (GMT)
commit73864f9bf5ed4a2cbb6f8f66a6ead0e438d7fc45 (patch)
tree38065cf2f197559fdb9c80b49b9509a66b52a218
parent77aa703a56db7fb52241e1e697b581cff38125cf (diff)
downloadgrv-73864f9bf5ed4a2cbb6f8f66a6ead0e438d7fc45.zip
grv-73864f9bf5ed4a2cbb6f8f66a6ead0e438d7fc45.tar.gz
grv-73864f9bf5ed4a2cbb6f8f66a6ead0e438d7fc45.tar.bz2
grv-73864f9bf5ed4a2cbb6f8f66a6ead0e438d7fc45.tar.xz
Makefile: allow building Win32 on a Linux host
-rw-r--r--Makefile16
-rw-r--r--Makefile.w326
2 files changed, 16 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 881e9c5..e24de2f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
-CC = gcc -W -Wall -D_REENTRANT
+CC = gcc
+CWARN = -W -Wall
+REQFLAGS = -D_REENTRANT
OPTFLAGS = -O2 -g
INCLUDE = -I/usr/include/SDL
-CFLAGS = $(OPTFLAGS) $(INCLUDE)
+CFLAGS = $(CWARN) $(REQFLAGS) $(OPTFLAGS) $(INCLUDE)
LDFLAGS =
LIBS = -lSDL -lpthread -lm
@@ -37,5 +39,11 @@ grvfont.c: grvfont.psf psftoc.pl
$(PERL) psftoc.pl < $< > $@ || rm -f $@
clean:
- rm -f *.o *.i *.s $(ALL)
-
+ rm -f *.o *.i *.s *.exe $(ALL)
+
+#
+# To do a Win32 build on a Fedora Linux host
+#
+win32:
+ make -f Makefile.w32 CC=i686-pc-mingw32-gcc \
+ SDL=/usr/i686-pc-mingw32/sys-root/mingw
diff --git a/Makefile.w32 b/Makefile.w32
index b3f23de..ff5451e 100644
--- a/Makefile.w32
+++ b/Makefile.w32
@@ -12,10 +12,12 @@
# perspective seen
SDL = /mingw/SDL-1.2.5/i386-mingw32msvc
-CC = gcc -W -Wall
+CC = gcc
+CWARN = -W -Wall
+REQFLAGS = -D_REENTRANT
OPTFLAGS = -O2 -g
INCLUDE = -I$(SDL)/include/SDL
-CFLAGS = $(OPTFLAGS) $(INCLUDE)
+CFLAGS = $(CWARN) $(REQFLAGS) $(OPTFLAGS) $(INCLUDE)
# -mwindows makes this a GUI application; -mconsole would make it a
# console application. Both are also possible, useful to get a console
# window for debugging output.