blob: 3ecc46e1c8e41be828476473518b7385d4980ba7 [file] [log] [blame]
Vishal Bhoj9a67d912016-06-09 10:02:07 +01001AARCH64_TOOLCHAIN=GCC49
2EDK2_DIR=$(ANDROID_BUILD_TOP)/device/linaro/bootloader/edk2
3UEFI_TOOLS_DIR=$(ANDROID_BUILD_TOP)/device/linaro/hikey/uefi-tools
4ATF_DIR=$(ANDROID_BUILD_TOP)/device/linaro/bootloader/arm-trusted-firmware
5PRODUCT_OUT?=out/target/product/hikey
6DIST_DIR?=$(ANDROID_BUILD_TOP)/out/dist
7
8all: $(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)/
John Stultzb5d73392016-08-05 14:05:15 -070030
31clean:
32 rm -rf $(DIST_DIR)/fip.bin $(DIST_DIR)/l-loader.bin
33