]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Scripts/Makefile
ArmPlatformPkg/Scripts/Makefile: Added support to automatically update the FIP
[mirror_edk2.git] / ArmPlatformPkg / Scripts / Makefile
index f933755b5193a071251280f9828a98ef1e3ff0fe..8f23f7bd36809523425b0f1089829a1db9076899 100644 (file)
@@ -1,5 +1,5 @@
 #/* @file\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #  \r
 #  This program and the accompanying materials                          \r
 #  are licensed and made available under the terms and conditions of the BSD License         \r
@@ -23,6 +23,11 @@ EDK2_BUILD ?= DEBUG
 ifeq ($(EDK2_DSC),"")\r
   $(error The Makfile macro 'EDK2_DSC' must be defined with an EDK2 DSC file.)\r
 endif\r
+ifeq ("$(EDK2_DSC)","ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc")\r
+  BUILD_FIP=1\r
+  BUILD_PATH=$(WORKSPACE)/Build/ArmVExpress-FVP-AArch64\r
+  UEFI_BIN=FVP_AARCH64_EFI.fd\r
+endif\r
 \r
 ifeq ("$(OS)","Windows_NT")\r
 export WORKSPACE?=$(PWD)\r
@@ -39,12 +44,31 @@ RM ?= rm -f
 \r
 EDK2_CONF = Conf/BuildEnv.sh Conf/build_rule.txt Conf/target.txt Conf/tools_def.txt\r
 \r
+#\r
+# FIP Support\r
+#\r
+ifeq ($(BUILD_FIP),"1")\r
+  ifeq ($(FIP_BIN),"")\r
+    $(info Define location of the FIP to automatically update the package after building UEFI.)\r
+  endif\r
+endif\r
+\r
 all: $(EDK2_CONF)\r
 ifeq ("$(OS)","Windows_NT")\r
        build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)\r
 else\r
        . ./edksetup.sh; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)\r
 endif\r
+ifeq ("$(BUILD_FIP)","1")\r
+ifneq ($(FIP_BIN),"")\r
+       $(SILENT)which fip_create ; \\r
+       if [ $$? -ne 0 ]; then \\r
+         $(ECHO) "Warning: 'fip_create' tool is not in the PATH. The UEFI binary will not be added in the Firmware Image Package (FIP)."; \\r
+       else \\r
+         fip_create --bl33 $(BUILD_PATH)/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/$(UEFI_BIN) --dump $(FIP_BIN); \\r
+       fi\r
+endif\r
+endif\r
 \r
 $(EDK2_CONF):\r
 ifeq ("$(OS)","Windows_NT")\r