| 1 | # |
| 2 | # uboot/Makefile |
| 3 | # |
| 4 | |
| 5 | PWD = $(shell pwd) |
| 6 | WORK = $(PWD)/work |
| 7 | |
| 8 | UBOOT_VERSION = 2011.09 |
| 9 | |
| 10 | .PHONY: all help mkimage clean dist-clean efikamx efikamx-clean efikamx-distclean |
| 11 | |
| 12 | all: help |
| 13 | |
| 14 | help: |
| 15 | @echo "Usage: make <target>" |
| 16 | @echo "Where targets available are:" |
| 17 | @echo " mkimage Build mkimage binary for your host" |
| 18 | @echo " <device> Where device specified should appear under" |
| 19 | @echo " devices's dir as for example efikamx, wm8505, ..." |
| 20 | @echo " clean Remove generated files" |
| 21 | @echo " distclean Remove generated files and temporary sources" |
| 22 | |
| 23 | clean: mkimage-clean efikamx-clean |
| 24 | |
| 25 | distclean: mkimage-distclean efikamx-distclean |
| 26 | |
| 27 | |
| 28 | $(WORK)/u-boot-$(UBOOT_VERSION).tar.bz2: |
| 29 | wget -P $(WORK) ftp://ftp.denx.de/pub/u-boot/u-boot-$(UBOOT_VERSION).tar.bz2 |
| 30 | |
| 31 | $(WORK)/u-boot-$(UBOOT_VERSION): $(WORK)/u-boot-$(UBOOT_VERSION).tar.bz2 |
| 32 | tar -C $(WORK) -xjf $(WORK)/u-boot-$(UBOOT_VERSION).tar.bz2 |
| 33 | cd $(WORK)/u-boot-$(UBOOT_VERSION) && \ |
| 34 | patch -p1 -i $(WORK)/u-boot-$(UBOOT_VERSION).tools1.patch && \ |
| 35 | patch -p1 -i $(WORK)/u-boot-$(UBOOT_VERSION).tools2.patch && \ |
| 36 | patch -p1 -i $(WORK)/u-boot-$(UBOOT_VERSION).tools3.patch |
| 37 | touch $(WORK)/u-boot-$(UBOOT_VERSION) |
| 38 | |
| 39 | $(WORK)/mkimage: $(WORK)/u-boot-$(UBOOT_VERSION) |
| 40 | cd $(WORK)/u-boot-$(UBOOT_VERSION) && \ |
| 41 | make tools && \ |
| 42 | install -m 0755 $(WORK)/u-boot-$(UBOOT_VERSION)/tools/mkimage $(WORK)/mkimage |
| 43 | |
| 44 | mkimage: $(WORK)/mkimage |
| 45 | |
| 46 | mkimage-clean: |
| 47 | rm -f $(WORK)/mkimage mkimage |
| 48 | |
| 49 | mkimage-distclean: mkimage-clean |
| 50 | rm -rf $(WORK)/u-boot-$(UBOOT_VERSION) $(WORK)/u-boot-$(UBOOT_VERSION).tar.bz2 |
| 51 | |
| 52 | efikamx: mkimage |
| 53 | make -C devices/efikamx |
| 54 | |
| 55 | efikamx-clean: |
| 56 | make -C devices/efikamx clean |
| 57 | |
| 58 | efikamx-distclean: |
| 59 | make -C devices/efikamx distclean |
| 60 | |
| 61 | # End of file |