]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Scripts/Makefile
ArmPlatformPkg/Scripts/Makefile: Added support to automatically update the FIP
[mirror_edk2.git] / ArmPlatformPkg / Scripts / Makefile
1 #/* @file
2 # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
3 #
4 # This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
8 #
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 #
12 #*/
13
14 # Define the following variables to specify an alternative toolchain to the one located in your PATH:
15 # - RVCT_TOOLS_PATH: for RVCT and RVCTLINUX toolchains
16 # - ARMGCC_TOOLS_PATH: for ARMGCC toolchain
17 # - ARMLINUXGCC_TOOLS_PATH: for ARMLINUXGCC
18
19 EDK2_TOOLCHAIN ?= RVCTLINUX
20 EDK2_ARCH ?= ARM
21 EDK2_BUILD ?= DEBUG
22
23 ifeq ($(EDK2_DSC),"")
24 $(error The Makfile macro 'EDK2_DSC' must be defined with an EDK2 DSC file.)
25 endif
26 ifeq ("$(EDK2_DSC)","ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc")
27 BUILD_FIP=1
28 BUILD_PATH=$(WORKSPACE)/Build/ArmVExpress-FVP-AArch64
29 UEFI_BIN=FVP_AARCH64_EFI.fd
30 endif
31
32 ifeq ("$(OS)","Windows_NT")
33 export WORKSPACE?=$(PWD)
34 export EDK_TOOLS_PATH ?= $(WORKSPACE)\BaseTools
35 endif
36
37 SHELL := /bin/bash
38 SILENT ?= @
39 ECHO ?= echo
40 MAKE ?= make -i -k
41 RM ?= rm -f
42
43 .PHONY: all clean
44
45 EDK2_CONF = Conf/BuildEnv.sh Conf/build_rule.txt Conf/target.txt Conf/tools_def.txt
46
47 #
48 # FIP Support
49 #
50 ifeq ($(BUILD_FIP),"1")
51 ifeq ($(FIP_BIN),"")
52 $(info Define location of the FIP to automatically update the package after building UEFI.)
53 endif
54 endif
55
56 all: $(EDK2_CONF)
57 ifeq ("$(OS)","Windows_NT")
58 build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
59 else
60 . ./edksetup.sh; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
61 endif
62 ifeq ("$(BUILD_FIP)","1")
63 ifneq ($(FIP_BIN),"")
64 $(SILENT)which fip_create ; \
65 if [ $$? -ne 0 ]; then \
66 $(ECHO) "Warning: 'fip_create' tool is not in the PATH. The UEFI binary will not be added in the Firmware Image Package (FIP)."; \
67 else \
68 fip_create --bl33 $(BUILD_PATH)/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/$(UEFI_BIN) --dump $(FIP_BIN); \
69 fi
70 endif
71 endif
72
73 $(EDK2_CONF):
74 ifeq ("$(OS)","Windows_NT")
75 copy $(EDK_TOOLS_PATH)\Conf\build_rule.template Conf\build_rule.txt
76 copy $(EDK_TOOLS_PATH)\Conf\FrameworkDatabase.template Conf\FrameworkDatabase.txt
77 copy $(EDK_TOOLS_PATH)\Conf\target.template Conf\target.txt
78 copy $(EDK_TOOLS_PATH)\Conf\tools_def.template Conf\tools_def.txt
79 else
80 . ./edksetup.sh; $(MAKE) -C BaseTools
81 endif
82
83 clean:
84 ifeq ("$(OS)","Windows_NT")
85 build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall
86 else
87 . ./edksetup.sh; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall; \
88 rm -Rf $(EDK2_CONF) Conf/.cache
89 endif