[U-Boot] [PATCH v4 9/9] hikey: Add hikey-u-boot.mak

Peter Griffin peter.griffin at linaro.org
Thu Jul 30 19:55:25 CEST 2015


Signed-off-by: Peter Griffin <peter.griffin at linaro.org>
---
 hikey-u-boot.mak | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 hikey-u-boot.mak

diff --git a/hikey-u-boot.mak b/hikey-u-boot.mak
new file mode 100644
index 0000000..f4cd547
--- /dev/null
+++ b/hikey-u-boot.mak
@@ -0,0 +1,33 @@
+CROSS_COMPILE	:= aarch64-linux-gnu-
+build_dir       := $(CURDIR)/build-hikey
+output_dir	:= $(HOME)/aarch64
+
+.PHONY: have-crosscompiler
+have-crosscompiler:
+	@echo -n "Check that $(CROSS_COMPILE)gcc is available..."
+	@which $(CROSS_COMPILE)gcc > /dev/null ; \
+	if [ ! $$? -eq 0 ] ; then \
+	   echo "ERROR: cross-compiler $(CROSS_COMPILE)gcc not in PATH=$$PATH!" ; \
+	   echo "ABORTING." ; \
+	   exit 1 ; \
+	else \
+	   echo "OK" ;\
+	fi
+
+build: have-crosscompiler FORCE
+	rm -rf $(build_dir)
+	@mkdir -p $(build_dir)
+	$(MAKE) O=$(build_dir) CROSS_COMPILE=$(CROSS_COMPILE) distclean
+	$(MAKE) O=$(build_dir) CROSS_COMPILE=$(CROSS_COMPILE) hikey_config
+	$(MAKE) O=$(build_dir) CROSS_COMPILE=$(CROSS_COMPILE)
+	cp $(build_dir)/u-boot.bin $(output_dir)/u-boot-hikey.bin
+	cp $(build_dir)/u-boot.bin /tftpboot/u-boot-hikey.bin
+
+menuconfig:
+	$(MAKE) O=$(build_dir) CROSS_COMPILE=$(CROSS_COMPILE) menuconfig
+
+clean:
+	$(MAKE) O=$(build_dir) clean
+	rm -rf $(build_dir)
+
+FORCE:
-- 
1.9.1



More information about the U-Boot mailing list