MONITOR=../monitor/monitor.bin
FILES=	../flashw/flashw.bin ../bptest/bptest.bin ../s2dump/s2dump.bin \
	../sdcore/sdcore.bin ../opcore/opcore.bin ../l2conv/l2conv.bin \
	../bitdsu/bitdsu.bin ../n1l2cs/n1l2cs.bin ../ndebug/ndebug.bin \
	../dsucfg/dsucfg.bin ../uconf/uconf.bin ../helpfiles/mon.hlp \
	../helpfiles/bitdsu.hlp ../helpfiles/n1l2cs.hlp

all:	U5.bin U6.bin

ffs.bin:	${FILES}
	../tools/mkrt11ffs 0x20000 ${FILES} > $@
	../tools/ffspadsegs $@ 0x20000 7

fullimage.bin:	${MONITOR} ffs.bin
	cp ${MONITOR} $@
	../tools/ffpad $@ 0x20000
	cat ffs.bin >> $@
#	../tools/ffpad $@ 0x100000

U5.bin U6.bin:	fullimage.bin
	../tools/splitbytes fullimage.bin U5.bin U6.bin

clean:
	rm -f *.bin *.out errs core

size:
	@../tools/blockcount ${FILES}
