blob: a52485543f94dc4636a03344a4539bdf776129c3 [file] [log] [blame]
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -08001UEFI_TOP_DIR := .
2
3ifndef $(BOOTLOADER_OUT)
4 BOOTLOADER_OUT := .
5endif
6export $(BOOTLOADER_OUT)
7
8BUILDDIR=$(shell pwd)
Jeevan Shriram4d4d5e62017-06-08 16:43:07 -07009
10ifeq ($(ANDROID_BUILD_TOP),)
11export CLANG35_AARCH64_PREFIX := $(CLANG_PREFIX)
12else
padarshr85181032016-07-09 02:32:43 +053013export CLANG35_AARCH64_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION)/bin/aarch64-linux-android-
Jeevan Shriram4d4d5e62017-06-08 16:43:07 -070014endif
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080015export CLANG35_BIN := $(CLANG_BIN)
Jeevan Shriram4d4d5e62017-06-08 16:43:07 -070016export CLANG35_ARM_PREFIX := $(CLANG_BIN)/tools/bin
17export CLANG_ARM_LINK_PATH := $(CLANG_LINK_PATH)
18
Channagoud Kadabi53362e02016-06-29 18:34:12 -070019ANDROID_PRODUCT_OUT := $(BOOTLOADER_OUT)/Build
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080020
Jeevan Shriram4d4d5e62017-06-08 16:43:07 -070021ifeq ($(TARGET_ARCHITECTURE),arm)
22export ARCHITECTURE := ARM
23else
24export ARCHITECTURE := AARCH64
25endif
26
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080027WORKSPACE=$(BUILDDIR)
28TARGET_TOOLS := CLANG35
29TARGET := DEBUG
30BUILD_ROOT := $(ANDROID_PRODUCT_OUT)/$(TARGET)_$(TARGET_TOOLS)
Channagoud Kadabi67698992016-03-02 13:04:47 -080031LOAD_ADDRESS := 0X9FA00000
Channagoud Kadabi1ed4a152016-02-05 15:15:41 -080032EDK_TOOLS := $(BUILDDIR)/BaseTools
33EDK_TOOLS_BIN := $(EDK_TOOLS)/Source/C/bin
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080034ABL_FV_IMG := $(BUILD_ROOT)/FV/abl.fv
35ABL_FV_ELF := $(BOOTLOADER_OUT)/../../abl.elf
lijuang4d342f62016-09-13 15:51:26 +080036SHELL:=/bin/bash
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080037
38.PHONY: all cleanall
39
40all: ABL_FV_ELF
41
42cleanall:
43 @. ./edksetup.sh BaseTools && \
Jeevan Shriram4d4d5e62017-06-08 16:43:07 -070044 build -p $(WORKSPACE)/QcomModulePkg/QcomModulePkg.dsc -a $(ARCHITECTURE) -t $(TARGET_TOOLS) -b $(TARGET) -j build_modulepkg.log cleanall
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080045 rm -rf $(WORKSPACE)/QcomModulePkg/Bin64
46
Channagoud Kadabi1ed4a152016-02-05 15:15:41 -080047EDK_TOOLS_BIN:
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080048 @. ./edksetup.sh BaseTools && \
Channagoud Kadabi1ed4a152016-02-05 15:15:41 -080049 $(MAKE) -C $(EDK_TOOLS) -j1
50
51ABL_FV_IMG: EDK_TOOLS_BIN
52 @. ./edksetup.sh BaseTools && \
Jeevan Shriram4d4d5e62017-06-08 16:43:07 -070053 build -p $(WORKSPACE)/QcomModulePkg/QcomModulePkg.dsc -a $(ARCHITECTURE) -t $(TARGET_TOOLS) -b $(TARGET) -D ABL_OUT_DIR=$(ANDROID_PRODUCT_OUT) -D VERIFIED_BOOT=$(VERIFIED_BOOT) -D VERIFIED_BOOT_2=$(VERIFIED_BOOT_2) -D USER_BUILD_VARIANT=$(USER_BUILD_VARIANT) -j build_modulepkg.log $*
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080054 cp $(BUILD_ROOT)/FV/FVMAIN_COMPACT.Fv $(ABL_FV_IMG)
55
56ABL_FV_ELF: ABL_FV_IMG
57 python $(WORKSPACE)/QcomModulePkg/Tools/image_header.py $(ABL_FV_IMG) $(ABL_FV_ELF) $(LOAD_ADDRESS) elf 64