1 AARCH64_TOOLCHAIN=GCC49 2 EDK2_DIR=$(ANDROID_BUILD_TOP)/device/linaro/bootloader/edk2 3 UEFI_TOOLS_DIR=$(ANDROID_BUILD_TOP)/device/linaro/hikey/uefi-tools 4 ATF_DIR=$(ANDROID_BUILD_TOP)/device/linaro/bootloader/arm-trusted-firmware 5 PRODUCT_OUT?=out/target/product/hikey 6 DIST_DIR?=$(ANDROID_BUILD_TOP)/out/dist 7 8 all: $(DIST_DIR)/fip.bin $(DIST_DIR)/l-loader.bin 9 10 $(DIST_DIR)/fip.bin: 11 cd $(EDK2_DIR) && \ 12 rm -rf Conf/tools_def.txt Conf/BuildEnv.sh Conf/build_rule.txt Conf/target.txt Conf/tools_def.txt && \ 13 export CROSS_COMPILE_32=arm-linux-androideabi- && \ 14 export CROSS_COMPILE_64=aarch64-linux-android- && \ 15 rm -rf OpenPlatformPkg && \ 16 ln -sf $(EDK2_DIR)/../OpenPlatformPkg OpenPlatformPkg && \ 17 rm -rf $(EDK2_DIR)/Build/ && \ 18 mkdir -p $(EDK2_DIR)/Build/ && \ 19 mkdir -p $(DIST_DIR) && \ 20 mkdir -p $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi && \ 21 ln -sf $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi $(EDK2_DIR)/Build/HiKey && \ 22 $(UEFI_TOOLS_DIR)/uefi-build.sh -b RELEASE -D EDK2_OUT_DIR=$(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi -a $(ATF_DIR) hikey && \ 23 cp $(EDK2_DIR)/Build/HiKey/RELEASE_GCC49/FV/fip.bin $(DIST_DIR)/ 24 25 $(DIST_DIR)/l-loader.bin: $(DIST_DIR)/fip.bin 26 cd $(ANDROID_BUILD_TOP)/device/linaro/hikey/l-loader && \ 27 ln -sf $(EDK2_DIR)/Build/HiKey/RELEASE_GCC49/FV//bl1.bin && \ 28 make CROSS_COMPILE=arm-linux-androideabi- l-loader.bin && \ 29 mv l-loader.bin $(DIST_DIR)/ 30