###############################################################################
# Makefile for a GP32 application.
###############################################################################

# Change the line below to the name of your program
PROGRAM =    slubFW

# The folder where you extracted gp32libs.tar.bz2
GPSDK_HOME = /opt/gp32gcc/sdk

# Don't change this unless you changed the compiler location when you
# installed it.
GCC_HOME =   /opt/gp32gcc
#GCC_HOME =   /mnt/stock/gp32/pc/linux/gp32_gcc

# Author name for the program
AUTHOR =	"Slubman DevSoft"

# Icon for the program in the Free-Launcher
ICON=       slubman.bmp

all:
	make -C main firmware

distrib:	all
	make -C launcher distrib
	make -C explorer distrib
	make -C main distrib
	make -C plugins distrib
	makezip.sh
	cp -f [!distrib]*/*.zip  ./distrib/
	cp -f plugins/*/*.zip ./distrib/
	chmod a+r distrib/*.zip
	@(cp -f distrib/*.zip /mnt/removable/data/ 2>/dev/null && echo "copied on /mnt/removable/data") || echo "/mnt/removable not mounted"

test : all
	$(GPSDK_HOME)/bin/geepee32 /IIC=common/iic.bin /SMC=common/test.smc /RUN

testno : all
	$(GPSDK_HOME)/bin/geepee32  /IIC=common/iic.bin /RUN

testu : all
	$(GPSDK_HOME)/bin/geepee32 /IIC=common/iic.bin /SMC=common/testu.smc /RUN

flash : all
	-gplink rm /fw.bin
	gplink put fw.bin /
	gplink run fwflash.gxb
