# .SILENT:
INCLUDESDL=/usr/local/i386-mingw32msvc/include/SDL/
LIBS=-L/usr/local/lib -lmingw32 -lSDLmain -lSDL -mwindows -mno-cygwin -liberty -lwsock32
CFLAGS=-I$(INCLUDESDL) -Dmain=SDL_main -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin
MINGWCOMP=/usr/local/i386-mingw32msvc/bin/gcc


OBJS=bomb.o configuration.o debug.o gfx.o main.o field.o font.o game.o gamesrv.o menu.o netmenu.o network.o packets.o pkgcache.o player.o sysfunc.o udp.o chat.o multiwait.o keybinput.o single.o mapmenu.o


all: config bomberclone.exe

config:
	echo "#define VERSION \"`grep project.version ../bomberclone.prj |cut -c 17-`\"" >../config.h
	
rebuild: clean all

bomberclone.exe: $(OBJS)
	$(MINGWCOMP) -o $@ $^ $(LIBS)

%.o: %.c
	$(MINGWCOMP) $(CFLAGS) -c -o $@ $^ $(DFLAGS)

clean:
	del *.o
	del bomberclone.exe

cleanall: clean
	del *.*~

source: cleanall
