Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 1 | UEFI_TOP_DIR := . |
| 2 | |
| 3 | ifndef $(BOOTLOADER_OUT) |
| 4 | BOOTLOADER_OUT := . |
| 5 | endif |
| 6 | export $(BOOTLOADER_OUT) |
| 7 | |
| 8 | BUILDDIR=$(shell pwd) |
Jeevan Shriram | 4d4d5e6 | 2017-06-08 16:43:07 -0700 | [diff] [blame^] | 9 | |
| 10 | ifeq ($(ANDROID_BUILD_TOP),) |
| 11 | export CLANG35_AARCH64_PREFIX := $(CLANG_PREFIX) |
| 12 | else |
padarshr | 8518103 | 2016-07-09 02:32:43 +0530 | [diff] [blame] | 13 | export CLANG35_AARCH64_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION)/bin/aarch64-linux-android- |
Jeevan Shriram | 4d4d5e6 | 2017-06-08 16:43:07 -0700 | [diff] [blame^] | 14 | endif |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 15 | export CLANG35_BIN := $(CLANG_BIN) |
Jeevan Shriram | 4d4d5e6 | 2017-06-08 16:43:07 -0700 | [diff] [blame^] | 16 | export CLANG35_ARM_PREFIX := $(CLANG_BIN)/tools/bin |
| 17 | export CLANG_ARM_LINK_PATH := $(CLANG_LINK_PATH) |
| 18 | |
Channagoud Kadabi | 53362e0 | 2016-06-29 18:34:12 -0700 | [diff] [blame] | 19 | ANDROID_PRODUCT_OUT := $(BOOTLOADER_OUT)/Build |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 20 | |
Jeevan Shriram | 4d4d5e6 | 2017-06-08 16:43:07 -0700 | [diff] [blame^] | 21 | ifeq ($(TARGET_ARCHITECTURE),arm) |
| 22 | export ARCHITECTURE := ARM |
| 23 | else |
| 24 | export ARCHITECTURE := AARCH64 |
| 25 | endif |
| 26 | |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 27 | WORKSPACE=$(BUILDDIR) |
| 28 | TARGET_TOOLS := CLANG35 |
| 29 | TARGET := DEBUG |
| 30 | BUILD_ROOT := $(ANDROID_PRODUCT_OUT)/$(TARGET)_$(TARGET_TOOLS) |
Channagoud Kadabi | 6769899 | 2016-03-02 13:04:47 -0800 | [diff] [blame] | 31 | LOAD_ADDRESS := 0X9FA00000 |
Channagoud Kadabi | 1ed4a15 | 2016-02-05 15:15:41 -0800 | [diff] [blame] | 32 | EDK_TOOLS := $(BUILDDIR)/BaseTools |
| 33 | EDK_TOOLS_BIN := $(EDK_TOOLS)/Source/C/bin |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 34 | ABL_FV_IMG := $(BUILD_ROOT)/FV/abl.fv |
| 35 | ABL_FV_ELF := $(BOOTLOADER_OUT)/../../abl.elf |
lijuang | 4d342f6 | 2016-09-13 15:51:26 +0800 | [diff] [blame] | 36 | SHELL:=/bin/bash |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 37 | |
| 38 | .PHONY: all cleanall |
| 39 | |
| 40 | all: ABL_FV_ELF |
| 41 | |
| 42 | cleanall: |
| 43 | @. ./edksetup.sh BaseTools && \ |
Jeevan Shriram | 4d4d5e6 | 2017-06-08 16:43:07 -0700 | [diff] [blame^] | 44 | build -p $(WORKSPACE)/QcomModulePkg/QcomModulePkg.dsc -a $(ARCHITECTURE) -t $(TARGET_TOOLS) -b $(TARGET) -j build_modulepkg.log cleanall |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 45 | rm -rf $(WORKSPACE)/QcomModulePkg/Bin64 |
| 46 | |
Channagoud Kadabi | 1ed4a15 | 2016-02-05 15:15:41 -0800 | [diff] [blame] | 47 | EDK_TOOLS_BIN: |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 48 | @. ./edksetup.sh BaseTools && \ |
Channagoud Kadabi | 1ed4a15 | 2016-02-05 15:15:41 -0800 | [diff] [blame] | 49 | $(MAKE) -C $(EDK_TOOLS) -j1 |
| 50 | |
| 51 | ABL_FV_IMG: EDK_TOOLS_BIN |
| 52 | @. ./edksetup.sh BaseTools && \ |
Jeevan Shriram | 4d4d5e6 | 2017-06-08 16:43:07 -0700 | [diff] [blame^] | 53 | 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 Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 54 | cp $(BUILD_ROOT)/FV/FVMAIN_COMPACT.Fv $(ABL_FV_IMG) |
| 55 | |
| 56 | ABL_FV_ELF: ABL_FV_IMG |
| 57 | python $(WORKSPACE)/QcomModulePkg/Tools/image_header.py $(ABL_FV_IMG) $(ABL_FV_ELF) $(LOAD_ADDRESS) elf 64 |