From d5cdb4dcf0bfce40de4102670487d1ea2b03b85d Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 30 Sep 2008 16:29:30 +0000 Subject: [PATCH] Some modifications to the makefile to enable cross compiling a windows binary from linux. Also added a way to create a .zip ready for upload on the website. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@184 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d4f871ab..1292b1fc 100644 --- a/Makefile +++ b/Makefile @@ -4,17 +4,26 @@ DELCOMMAND = del BIN = grafx2.exe COPT = -Wall -O -g -ggdb -Dmain=SDL_main LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi +CC = gcc else # Linux specific DELCOMMAND = rm -rf +ifdef WIN32CROSS +#cross compile a Win32 executable +CC = i586-mingw32msvc-gcc +BIN = grafx2.exe +COPT = -Wall -O -g -ggdb -Dmain=SDL_main +LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi +else BIN = grafx2 COPT = -Wall -c -g LOPT = -lSDL -o $(BIN) +CC = gcc +endif endif .PHONY : all debug release clean depend zip -CC = gcc OBJ = main.o init.o graph.o sdlscreen.o divers.o special.o boutons.o palette.o aide.o operatio.o pages.o loadsave.o readline.o moteur.o files.o op_c.o linux.o op_asm.o readini.o saveini.o shade.o clavier.o io.o OBJDIR = obj/ @@ -31,6 +40,10 @@ zip : tar cvzf gfx2-src.tgz *.c *.h Makefile Makefile.dep gfx2.dat gfx2.ini gfx2.cfg doc/gpl-2.0.txt \ cfg_new/*.c cfg_new/*.h cfg_new/Makefile cfg_new/8pxfont.png +# A release zip archive +ziprelease: + zip grafx2-beta-svn`svnversion`.zip $(BIN) gfx2.ini gfx2.dat gfx2.cfg gfx2.ico + $(BIN) : $(OBJ) $(CC) $(OBJ) -o $(BIN) $(LOPT)