DEPTH = ../..

include $(DEPTH)/Makefile.version
include $(DEPTH)/Makefile.os
include $(DEPTH)/Makefile.install.directories

.PHONY: all
all :

ifeq ($(SHELLTYPE), sh)
# create a setup file (using InnoSetup)
.PHONY: setup
setup : FreeDoko.iss FreeDoko.install.ico
	-$(RM) FreeDoko_$(VERSION)
	-rm "/home/Systeme/wine/InnoSetup/dosdevices/f:"
	ln -s /tmp/FreeDoko.release/FreeDoko_$(VERSION) "/home/Systeme/wine/InnoSetup/dosdevices/f:"
	-rm "/home/Systeme/wine/InnoSetup/dosdevices/i:"
	ln -s "`pwd`" "/home/Systeme/wine/InnoSetup/dosdevices/i:"
	WINEPREFIX="/home/Systeme/wine/InnoSetup/" \
		   WINEARCH=win64 \
		   wine 'C:\Program Files (x86)\Inno Setup 6\Compil32.exe' 'I:\FreeDoko.iss'

FreeDoko.iss : $(DEPTH)/Makefile.version
	sed -i '/^#define MyAppVersion/c\#define MyAppVersion "'$(VERSION)'"' FreeDoko.iss

FreeDoko.install.ico : ../../data/icon.install.png
	convert $< $@
endif

.PHONY: clean
clean :
	$(RM) FreeDoko_$(VERSION)
	$(RM) FreeDoko_*.Setup.exe
