]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Scripts/Makefile
da949dc1ed5673dca190717ea646ee3127b9bce7
[mirror_edk2.git] / ArmPlatformPkg / Scripts / Makefile
1 #/* @file
2 # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
3 #
4 # SPDX-License-Identifier: BSD-2-Clause-Patent
5 #
6 #*/
7
8 # Define the following variable to specify an alternative toolchain to the one located in your PATH:
9 # - RVCT_TOOLS_PATH: for RVCT and RVCTLINUX toolchains
10
11 EDK2_TOOLCHAIN ?= RVCTLINUX
12 EDK2_ARCH ?= ARM
13 EDK2_BUILD ?= DEBUG
14
15 ifeq ($(EDK2_DSC),"")
16 $(error The Makfile macro 'EDK2_DSC' must be defined with an EDK2 DSC file.)
17 endif
18 ifeq ("$(EDK2_DSC)","ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc")
19 BUILD_FIP=1
20 BUILD_PATH=$(WORKSPACE)/Build/ArmVExpress-FVP-AArch64
21 UEFI_BIN=FVP_AARCH64_EFI.fd
22 endif
23
24 ifeq ("$(OS)","Windows_NT")
25 export WORKSPACE?=$(PWD)
26 export EDK_TOOLS_PATH ?= $(WORKSPACE)\BaseTools
27 endif
28
29 SHELL := /bin/bash
30 SILENT ?= @
31 ECHO ?= echo
32 MAKE ?= make -i -k
33 RM ?= rm -f
34
35 .PHONY: all clean
36
37 EDK2_CONF = Conf/BuildEnv.sh Conf/build_rule.txt Conf/target.txt Conf/tools_def.txt
38
39 #
40 # FIP Support
41 #
42 ifeq ($(BUILD_FIP),"1")
43 ifeq ($(FIP_BIN),"")
44 $(info Define location of the FIP to automatically update the package after building UEFI.)
45 endif
46 endif
47
48 all: $(EDK2_CONF)
49 ifeq ("$(OS)","Windows_NT")
50 build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
51 else
52 . ./edksetup.sh; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
53 endif
54 ifeq ("$(BUILD_FIP)","1")
55 ifneq ($(FIP_BIN),"")
56 $(SILENT)which fip_create ; \
57 if [ $$? -ne 0 ]; then \
58 $(ECHO) "Warning: 'fip_create' tool is not in the PATH. The UEFI binary will not be added in the Firmware Image Package (FIP)."; \
59 else \
60 fip_create --bl33 $(BUILD_PATH)/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/$(UEFI_BIN) --dump $(FIP_BIN); \
61 fi
62 endif
63 endif
64
65 $(EDK2_CONF):
66 ifeq ("$(OS)","Windows_NT")
67 copy $(EDK_TOOLS_PATH)\Conf\build_rule.template Conf\build_rule.txt
68 copy $(EDK_TOOLS_PATH)\Conf\FrameworkDatabase.template Conf\FrameworkDatabase.txt
69 copy $(EDK_TOOLS_PATH)\Conf\target.template Conf\target.txt
70 copy $(EDK_TOOLS_PATH)\Conf\tools_def.template Conf\tools_def.txt
71 else
72 . ./edksetup.sh; $(MAKE) -C BaseTools
73 endif
74
75 clean:
76 ifeq ("$(OS)","Windows_NT")
77 build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall
78 else
79 . ./edksetup.sh; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall; \
80 rm -Rf $(EDK2_CONF) Conf/.cache
81 endif