• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1AARCH64_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
8ifdef DEBUG
9	TARGET = DEBUG
10else
11	TARGET = RELEASE
12endif
13
14all: $(DIST_DIR)/fip.bin $(DIST_DIR)/l-loader.bin
15
16$(DIST_DIR)/fip.bin:
17	cd $(EDK2_DIR) && \
18	rm -rf Conf/tools_def.txt Conf/BuildEnv.sh  Conf/build_rule.txt Conf/target.txt  Conf/tools_def.txt && \
19	export CROSS_COMPILE_32=arm-linux-androideabi- && \
20	export CROSS_COMPILE_64=aarch64-linux-android- && \
21	rm -rf OpenPlatformPkg && \
22	ln -sf  $(EDK2_DIR)/../OpenPlatformPkg OpenPlatformPkg && \
23	rm -rf $(EDK2_DIR)/Build/  && \
24	mkdir -p $(EDK2_DIR)/Build/ && \
25	mkdir -p $(DIST_DIR) && \
26	mkdir -p $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi && \
27	ln -sf $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi $(EDK2_DIR)/Build/HiKey && \
28	$(UEFI_TOOLS_DIR)/uefi-build.sh -b $(TARGET) -D EDK2_OUT_DIR=$(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi -a $(ATF_DIR) hikey && \
29	cp $(EDK2_DIR)/Build/HiKey/$(TARGET)_GCC49/FV/fip.bin $(DIST_DIR)/
30
31$(DIST_DIR)/l-loader.bin: $(DIST_DIR)/fip.bin
32	cd $(ANDROID_BUILD_TOP)/device/linaro/hikey/l-loader && \
33	ln -sf $(EDK2_DIR)/Build/HiKey/$(TARGET)_GCC49/FV//bl1.bin && \
34	make CROSS_COMPILE=arm-linux-androideabi- hikey && \
35	mv l-loader.bin $(DIST_DIR)/
36
37clean:
38	rm -rf $(DIST_DIR)/fip.bin $(DIST_DIR)/l-loader.bin $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi $(EDK2_DIR)/Build/HiKey
39	cd $(EDK2_DIR)/BaseTools && make clean
40