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