Permalink
Browse files

Added makefile for compiling Windows binary from Linux.

  • Loading branch information...
1 parent 8cbb588 commit f2b26759c8c591acad00a90fbc055701917c0895 @DusteDdk committed Jun 8, 2012
Showing with 65 additions and 6 deletions.
  1. +2 −0 .gitignore
  2. +55 −0 Makefile.win
  3. +8 −6 platform/pc.h
View
@@ -6,3 +6,5 @@ wizznic.depend
wizznic.layout
wizznic.layout
wizznic-wiz
+wizznic.layout.cbTemp
+wizznic.exe
View
@@ -0,0 +1,55 @@
+# Makefile to compile Wizznic.exe from windows.
+# Required libs that are not included in a standard Debian mingw32:
+# SDL-devel-1.2.15-mingw32
+# SDL_image-1.2.12
+# SDL_mixer-1.2.12
+# glew-1.7.0-win32
+
+CC = i586-mingw32msvc-gcc
+LD = $(CC)
+STRIP = i586-mingw32msvc-strip
+
+NAME=wizznic.exe
+TARGET= $(NAME)
+
+DEFS = -DDATADIR="\"./\"" -DWIN32 -DWIN32_CROSS
+
+INCS = -I.
+
+LDFLAGS=$(CFLAGS)
+LIBS = -lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_mixer -lm
+
+#Are we compiling with gl?
+ifneq ($(WITH_OPENGL),false)
+ LIBS += -lopengl32
+ DEFS += -DWITH_OPENGL
+endif
+
+OBJS = dumplevelimages.o board.o cursor.o draw.o input.o main.o menu.o sprite.o\
+text.o ticks.o sound.o game.o player.o list.o levels.o pixel.o stars.o\
+levelselector.o leveleditor.o particle.o pack.o settings.o stats.o strings.o\
+mbrowse.o teleport.o credits.o waveimg.o userfiles.o swscale.o platform/pc.o pointer.o
+
+MYCC = $(CC) $(CFLAGS) $(INCS) $(DEFS)
+
+########################################################################
+
+sdl: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(LD) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
+ $(STRIP) $@
+
+.c.o:
+ $(MYCC) -c $< -o $@
+
+install:
+ install -d -D -m 755 "$(DESTDIR)$(BINDIR)"
+ install -D -m 755 "$(TARGET)" "$(DESTDIR)$(BINDIR)"
+ install -d -D -m 755 "$(DESTDIR)$(DATADIR)"
+ cp -R data "$(DESTDIR)$(DATADIR)"
+ cp -R packs "$(DESTDIR)$(DATADIR)"
+ chmod -R 755 "$(DESTIR)$(DATADIR)"
+
+clean:
+ rm -f *.o $(NAME) platform/*.o
View
@@ -18,18 +18,20 @@
* along with Foobar. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
-#define SCREENW 320
+#define SCREENW 320
#define SCREENH 240
//For Uploading stats
#define PLATFORM_SUPPORTS_STATSUPLOAD
#if defined(WIN32)
#if defined(WITH_OPENGL)
- #define GLEW_STATIC
- #define WINDOWS_LEAN_AND_MEAN
- #define NOMINMAX
- #include <windows.h>
+ #define GLEW_STATIC
+ #define WINDOWS_LEAN_AND_MEAN
+ #define NOMINMAX
+ #ifndef WIN32_CROSS
+ #include <windows.h> //Seems like windows.h is not needed for mingw32-cross compiling.
+ #endif
#include <GL/glew.h>
#endif
@@ -42,7 +44,7 @@
#ifndef WIN32
#if defined(WITH_OPENGL)
- #include <GL/gl.h>
+ #include <GL/gl.h>
#include <GL/glu.h>
#endif
#endif

0 comments on commit f2b2675

Please sign in to comment.