BOARDDIR=~/src/beagle
BUILDFILE=$(BOARDDIR)/src/hardware/startup/boards/omap3530/beagle.build
IFSDIR=$(BOARDDIR)/images
IFS=$(IFSDIR)/ifs-omap3530-beagle.bin
QNXDIR=~/src/qnx
GDB_KDEBUG=$(BOARDDIR)/install/armle-v7/boot/sys/gdb_kdebug

beagle-nand.img: $(IFS) nand_ecc
	./mknand.sh $@ $(IFS)
	./nand_ecc $@ 0x0 0xe80000

$(IMAGE): $(BUILDFILE)
	$(MAKE) --directory $(BOARDDIR)

nand_ecc: nand_ecc.c
	gcc -o $@ nand_ecc.c

# The following rules are used to rebuild the IFS after a change to gdb_kdebug.
# Similar rules can be written to rebuild the IFS upon a change to procnto.
#
#$(BUILDFILE): $(GDB_KDEBUG)
#	touch $(BUILDFILE)

#$(GDB_KDEBUG): $(QNXDIR)/stage/armle-v7/boot/sys/gdb_kdebug
#	cp $(QNXDIR)/stage/armle-v7/boot/sys/gdb_kdebug $(GDB_KDEBUG)
