edk2: makefile: Fix makefile to build BaseTools
Add support to Build BaseTools required to build edk and build BaseTools
as a single job, current build system in the edk does not support
builing BaseTools are multiple jobs.
Change-Id: I3d5ec61917729bb8498327622f0cb9040cb20cc9
diff --git a/makefile b/makefile
index f514383..36ecb63 100644
--- a/makefile
+++ b/makefile
@@ -15,7 +15,8 @@
TARGET := DEBUG
BUILD_ROOT := $(ANDROID_PRODUCT_OUT)/$(TARGET)_$(TARGET_TOOLS)
LOAD_ADDRESS := 0X98100000
-
+EDK_TOOLS := $(BUILDDIR)/BaseTools
+EDK_TOOLS_BIN := $(EDK_TOOLS)/Source/C/bin
ABL_FV_IMG := $(BUILD_ROOT)/FV/abl.fv
ABL_FV_ELF := $(BOOTLOADER_OUT)/../../abl.elf
@@ -28,9 +29,13 @@
build -p $(WORKSPACE)/QcomModulePkg/QcomModulePkg.dsc -a AARCH64 -t $(TARGET_TOOLS) -b $(TARGET) -j build_modulepkg.log cleanall
rm -rf $(WORKSPACE)/QcomModulePkg/Bin64
-ABL_FV_IMG:
+EDK_TOOLS_BIN:
@. ./edksetup.sh BaseTools && \
- build -p $(WORKSPACE)/QcomModulePkg/QcomModulePkg.dsc -a AARCH64 -t $(TARGET_TOOLS) -b $(TARGET) -D ABL_OUT_DIR=$(ANDROID_PRODUCT_OUT) -j build_modulepkg.log $1 $2 $3 $4 $5 $6 $7 $8
+ $(MAKE) -C $(EDK_TOOLS) -j1
+
+ABL_FV_IMG: EDK_TOOLS_BIN
+ @. ./edksetup.sh BaseTools && \
+ build -p $(WORKSPACE)/QcomModulePkg/QcomModulePkg.dsc -a AARCH64 -t $(TARGET_TOOLS) -b $(TARGET) -D ABL_OUT_DIR=$(ANDROID_PRODUCT_OUT) -j build_modulepkg.log $*
cp $(BUILD_ROOT)/FV/FVMAIN_COMPACT.Fv $(ABL_FV_IMG)
ABL_FV_ELF: ABL_FV_IMG