--- /dev/null
+#
+# uboot/devices/cubieboard/Makefile
+#
+
+PWD = $(shell pwd)
+WORK = $(PWD)/work
+MKIMAGE = $(PWD)/../../work/mkimage
+ZIMAGE = $(PWD)/../../../kernel/cubieboard/work/zImage
+INITRDGZ = $(PWD)/../../../initrd/work/initrd.gz
+INITRAMFS = $(PWD)/../../../initramfs/work/initramfs
+
+RAMDISK_TYPE = uInitrd # select between uInitramfs or uInitrd
+
+CONSOLE = tty0 # tty0 / ttyS0,115200
+
+.PHONY: all clean distclean kernel ramdisk bootscr
+
+all: kernel ramdisk bootscr
+
+clean: kernel-clean ramdisk-clean bootscr-clean
+
+distclean: clean
+
+$(WORK):
+ install -d $(WORK)
+
+$(WORK)/uImage: $(WORK) $(MKIMAGE) $(ZIMAGE)
+ $(MKIMAGE) -A arm -O linux -a 0x40008000 -e 0x40008000 \
+ -T kernel -C none -n "Linux-3.0.76-cubieboard" \
+ -d $(ZIMAGE) $(WORK)/uImage
+
+kernel: $(WORK)/uImage
+
+kernel-clean:
+ rm -f $(WORK)/uImage
+
+$(WORK)/uInitrd: $(WORK) $(MKIMAGE) $(INITRDGZ)
+ $(MKIMAGE) -A arm -O linux -a 0 -e 0 \
+ -T ramdisk -C none -n "CRUX-ARM Initrd Image" \
+ -d $(INITRDGZ) $(WORK)/uInitrd
+
+uInitrd: $(WORK)/uInitrd
+
+uInitrd-clean:
+ rm -f $(WORK)/uInitrd
+
+$(WORK)/uInitramfs: $(WORK) $(MKIMAGE) $(INITRAMFS)
+ $(MKIMAGE) -A arm -O linux -a 0 -e 0 \
+ -T ramdisk -C none -n "CRUX-ARM Initramfs Image" \
+ -d $(INITRAMFS) $(WORK)/uInitramfs
+
+uInitramfs: $(WORK)/uInitramfs
+
+uInitramfs-clean:
+ rm -f $(WORK)/uInitramfs
+
+ramdisk: $(RAMDISK_TYPE)
+
+ramdisk-clean: uInitrd-clean uInitramfs-clean
+
+templates: $(PWD)/boot-mmc.script
+ sed "s|#CONSOLE#|$(CONSOLE)|" $(PWD)/boot-mmc.script > $(WORK)/boot-mmc.script
+
+$(WORK)/boot-mmc.scr: $(WORK) $(MKIMAGE)
+ $(MKIMAGE) -A arm -O linux -a 0 -e 0 \
+ -T script -C none -n "A10 Boot Script (mmc)" \
+ -d $(WORK)/boot-mmc.script \
+ $(WORK)/boot-mmc.scr
+
+bootscr: templates $(WORK)/boot-mmc.scr
+
+bootscr-clean:
+ rm -f $(WORK)/boot-*.scr*
+
+# End of file