MAKE=make
ISCC = wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/ISCC.exe

all: config.make src/windows
	$(MAKE) -C src/zlib all
	$(MAKE) -C src all
	$(MAKE) -C themes all

src/windows:
	tar xzvf windows-sdl2.tar.gz

config.make:
	echo "# you can define own flags here" > config.make

clean:
	$(RM) -rf bin
	$(RM) -rf src/windows
	$(MAKE) -C src/sdl-instead clean

docs:
#	$(MAKE) pdf -C doc/
#	man doc/instead.6 > doc/instead.txt
#	$(MAKE) wiki -C doc/ 

install: all
	cp src/sdl-instead.exe bin
	$(MAKE) DESTDIR=../bin/ -C themes install
	$(MAKE) DESTDIR=../bin/ -C games install
	$(MAKE) DESTDIR=../bin/ -C stead install
	$(MAKE) DESTDIR=../bin/ -C icon install
	$(MAKE) DESTDIR=../bin/ -C lang install
	$(MAKE) DESTDIR=../bin/ -C doc install

setup:  install docs
	cp setup.iss bin
	cd bin; $(ISCC) setup.iss
