| 1 | # |
| 2 | # bootloader/devices/cubieboard/Makefile |
| 3 | # |
| 4 | |
| 5 | PWD = $(shell pwd) |
| 6 | WORK = $(PWD)/work |
| 7 | MKIMAGE = $(PWD)/../../work/mkimage |
| 8 | ZIMAGE = $(PWD)/../../../kernel/cubieboard/work/zImage |
| 9 | INITRDGZ = $(PWD)/../../../initrd/work/initrd.gz |
| 10 | INITRAMFS = $(PWD)/../../../initramfs/work/initramfs |
| 11 | |
| 12 | KERNEL_VERSION_STRING = $(shell readlink $(ZIMAGE) | sed s/zImage-//) |
| 13 | |
| 14 | RAMDISK_TYPE = uInitrd |
| 15 | #RAMDISK_TYPE = uInitramfs |
| 16 | |
| 17 | CONSOLE_DEVICE = tty0 |
| 18 | #CONSOLE_DEVICE = ttymxc0,115200 |
| 19 | |
| 20 | .PHONY: all clean distclean kernel ramdisk bootscr |
| 21 | |
| 22 | all: kernel ramdisk bootscr |
| 23 | |
| 24 | clean: kernel-clean ramdisk-clean bootscr-clean |
| 25 | |
| 26 | distclean: clean |
| 27 | |
| 28 | $(WORK): |
| 29 | install -d $(WORK) |
| 30 | |
| 31 | $(WORK)/uImage: $(WORK) $(MKIMAGE) $(ZIMAGE) |
| 32 | $(MKIMAGE) -A arm -O linux -a 0x40008000 -e 0x40008000 \ |
| 33 | -T kernel -C none -n "Linux-$(KERNEL_VERSION_STRING)" \ |
| 34 | -d $(ZIMAGE) $(WORK)/uImage |
| 35 | |
| 36 | kernel: $(WORK)/uImage |
| 37 | |
| 38 | kernel-clean: |
| 39 | rm -f $(WORK)/uImage |
| 40 | |
| 41 | $(WORK)/uInitrd: $(WORK) $(MKIMAGE) $(INITRDGZ) |
| 42 | $(MKIMAGE) -A arm -O linux -a 0 -e 0 \ |
| 43 | -T ramdisk -C none -n "CRUX-ARM Initrd Image" \ |
| 44 | -d $(INITRDGZ) $(WORK)/uInitrd |
| 45 | |
| 46 | uInitrd: $(WORK)/uInitrd |
| 47 | |
| 48 | uInitrd-clean: |
| 49 | rm -f $(WORK)/uInitrd |
| 50 | |
| 51 | $(WORK)/uInitramfs: $(WORK) $(MKIMAGE) $(INITRAMFS) |
| 52 | $(MKIMAGE) -A arm -O linux -a 0 -e 0 \ |
| 53 | -T ramdisk -C none -n "CRUX-ARM Initramfs Image" \ |
| 54 | -d $(INITRAMFS) $(WORK)/uInitramfs |
| 55 | |
| 56 | uInitramfs: $(WORK)/uInitramfs |
| 57 | |
| 58 | uInitramfs-clean: |
| 59 | rm -f $(WORK)/uInitramfs |
| 60 | |
| 61 | ramdisk: $(RAMDISK_TYPE) |
| 62 | |
| 63 | ramdisk-clean: uInitrd-clean uInitramfs-clean |
| 64 | |
| 65 | $(WORK)/%.script: %.script.in |
| 66 | sed -e "s|@@RAMDISK_TYPE@@|$(RAMDISK_TYPE)|" -e "s|@@CONSOLE_DEVICE@@|$(CONSOLE_DEVICE)|" $< > $@ |
| 67 | |
| 68 | $(WORK)/boot-mmc.scr: $(WORK)/boot-mmc.script $(MKIMAGE) |
| 69 | $(MKIMAGE) -A arm -O linux -a 0 -e 0 \ |
| 70 | -T script -C none -n "Cubieboard Boot Script (mmc)" \ |
| 71 | -d $(WORK)/boot-mmc.script \ |
| 72 | $(WORK)/boot-mmc.scr |
| 73 | |
| 74 | bootscr: $(WORK)/boot-mmc.scr |
| 75 | |
| 76 | bootscr-clean: |
| 77 | rm -f $(WORK)/boot-*.scr* |
| 78 | |
| 79 | # End of file |