ASM=asm68360
ASMFLG= -bl -g
cc=c68360

#OPTS= -L -pack 1 -b5 -D e2s -err+ err -d -do

OPTS= -L -d -os -pack 1 -err+ err -i -do
AOPTS= -s -d -g -P -err+ err

LST=lst\ 
OLS=ols\ 


all: delerr bootchg.bin
	if exist err type err

clean :
	del *.ols
	del *.lst
	del *.map
	del *.hex
	del *.bin
	del *.abs
	del err

delerr:
	if exist err del err

bootchg.bin: $(OLS)pmain.ol $(OLS)bootchg.ol $(OLS)flutil.ol $(OLS)buserr.ol
	llink -i olslist -o $(OLS)bootchg.abs -c loc.cmd -v -err+ err 
	form $(OLS)bootchg.abs -x -o bootchg.hex -f xm  -err+ err
	gsmap $(OLS)bootchg.abs -n -o bootchg.map
	hexbin2 bootchg.hex bootchg.bin m 2000 ffffffff 0

$(OLS)pmain.ol:pmain.68k ..\include\boot.h ..\srcmain\a360boot.inc
	$(ASM) pmain.68k -o $(OLS)pmain.ol $(ASMFLG) -err+ err

$(OLS)flutil.ol:flutil.68k ..\include\boot.h flutil.h
	$(ASM) flutil.68k -o $(OLS)flutil.ol $(ASMFLG) -err+ err

$(OLS)bootchg.ol:bootchg.c ..\include\boot.h bootchg.h flutil.h
	$(cc) bootchg.c $(OPTS) -p -o $(OLS)bootchg.ol -l $(LST)bootchg.lst

$(OLS)buserr.ol:buserr.c ..\include\boot.h buserr.h
	$(cc) buserr.c $(OPTS) -p -o $(OLS)buserr.ol -l $(LST)buserr.lst
