#
-# uboot/devices/cubieboard/Makefile
+# bootloader/devices/cubieboard/Makefile
#
PWD = $(shell pwd)
INITRDGZ = $(PWD)/../../../initrd/work/initrd.gz
INITRAMFS = $(PWD)/../../../initramfs/work/initramfs
-RAMDISK_TYPE = uInitrd # select between uInitramfs or uInitrd
+RAMDISK_TYPE = uInitrd
+#RAMDISK_TYPE = uInitramfs
-CONSOLE = tty0 # tty0 / ttyS0,115200
+CONSOLE_DEVICE = tty0
+#CONSOLE_DEVICE = ttymxc0,115200
.PHONY: all clean distclean kernel ramdisk bootscr
ramdisk-clean: uInitrd-clean uInitramfs-clean
-templates: $(PWD)/boot-mmc.script
- sed "s|#CONSOLE#|$(CONSOLE)|" $(PWD)/boot-mmc.script > $(WORK)/boot-mmc.script
+$(WORK)/%.script: %.script.in
+ sed -e "s|@@RAMDISK_TYPE@@|$(RAMDISK_TYPE)|" -e "s|@@CONSOLE_DEVICE@@|$(CONSOLE_DEVICE)|" $< > $@
-$(WORK)/boot-mmc.scr: $(WORK) $(MKIMAGE)
+$(WORK)/boot-mmc.scr: $(WORK)/boot-mmc.script $(MKIMAGE)
$(MKIMAGE) -A arm -O linux -a 0 -e 0 \
- -T script -C none -n "A10 Boot Script (mmc)" \
+ -T script -C none -n "Cubieboard Boot Script (mmc)" \
-d $(WORK)/boot-mmc.script \
$(WORK)/boot-mmc.scr
-bootscr: templates $(WORK)/boot-mmc.scr
+bootscr: $(WORK)/boot-mmc.scr
bootscr-clean:
rm -f $(WORK)/boot-*.scr*