]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmJunoPkg/Makefile
ArmPlatformPkg/ArmJunoPkg: Added Juno development board support
[mirror_edk2.git] / ArmPlatformPkg / ArmJunoPkg / Makefile
CommitLineData
9f38945f
OM
1#
2# Copyright (c) 2013-2014, 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# Define the following variables to specify an alternative toolchain to the one located in your PATH:
14# - RVCT_TOOLS_PATH: for RVCT and RVCTLINUX toolchains
15# - ARMGCC_TOOLS_PATH: for ARMGCC toolchain
16# - ARMLINUXGCC_TOOLS_PATH: for ARMLINUXGCC
17
18EDK2_TOOLCHAIN ?= GCC49
19GCC49_AARCH64_PREFIX ?= aarch64-none-elf-
20EDK2_ARCH ?= AARCH64
21EDK2_BUILD ?= DEBUG
22EDK2_DSC = ArmPlatformPkg/ArmJunoPkg/ArmJuno.dsc
23DEST_BIN_ROOT ?=
24
25ifeq ($(EDK2_DSC),"")
26 $(error The Makefile macro 'EDK2_DSC' must be defined with an EDK2 DSC file.)
27endif
28
29ifeq ("$(OS)","Windows_NT")
30export WORKSPACE?=$(PWD)
31export EDK_TOOLS_PATH ?= $(WORKSPACE)\BaseTools
32else
33export WORKSPACE?=$(PWD)
34endif
35
36# Define the destination of the Firmware Image Package (FIP) if not defined
37ifndef JUNO_FIP
38 ifdef DEST_BIN_ROOT
39 JUNO_FIP=$(DEST_BIN_ROOT)/fip.bin
40 else
41 JUNO_FIP=fip.bin
42 endif
43endif
44
45SHELL := /bin/bash
46SILENT ?= @
47ECHO ?= echo
48MAKE ?= make -i -k
49RM ?= rm -f
50CP ?= cp
51
52.PHONY: all clean
53
54EDK2_CONF = Conf/BuildEnv.sh Conf/build_rule.txt Conf/target.txt Conf/tools_def.txt
55
56all: $(EDK2_CONF)
57ifeq ("$(OS)","Windows_NT")
58 build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
59else
60 . ./edksetup.sh; GCC49_AARCH64_PREFIX=$(GCC49_AARCH64_PREFIX) build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
61endif
62ifeq ("$(OS)","Windows_NT")
63 $(SILENT)$(ECHO) "Warning: The UEFI Firmware must be added to the Firmware Image Package (FIP)."
64else
65 $(SILENT)which fip_create ; \
66 if [ $$? -ne 0 ]; then \
67 $(ECHO) "Warning: 'fip_create' tool is not in the PATH. The UEFI binary will not be added in the Firmware Image Package (FIP)."; \
68 else \
69 fip_create --bl33 $(WORKSPACE)/Build/ArmJuno/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/BL33_AP_UEFI.fd --dump $(JUNO_FIP); \
70 fi
71endif
72
73$(EDK2_CONF):
74ifeq ("$(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
79else
80 . ./edksetup.sh; $(MAKE) -C BaseTools
81endif
82
83clean:
84ifeq ("$(OS)","Windows_NT")
85 build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall
86else
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
89endif