Vishal Bhoj | 82c8071 | 2015-12-15 21:13:33 +0530 | [diff] [blame^] | 1 | #/* @file
|
| 2 | # Copyright (c) 2011-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 |
|
| 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 |
|
| 27 | ifeq ("$(OS)","Windows_NT")
|
| 28 | export WORKSPACE?=$(PWD)
|
| 29 | export EDK_TOOLS_PATH ?= $(WORKSPACE)\BaseTools
|
| 30 | endif
|
| 31 |
|
| 32 | SHELL := /bin/bash
|
| 33 | SILENT ?= @
|
| 34 | ECHO ?= echo
|
| 35 | MAKE ?= make -i -k
|
| 36 | RM ?= rm -f
|
| 37 |
|
| 38 | .PHONY: all clean
|
| 39 |
|
| 40 | EDK2_CONF = Conf/BuildEnv.sh Conf/build_rule.txt Conf/target.txt Conf/tools_def.txt
|
| 41 |
|
| 42 | all: $(EDK2_CONF)
|
| 43 | ifeq ("$(OS)","Windows_NT")
|
| 44 | build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
|
| 45 | else
|
| 46 | . ./edksetup.sh; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
|
| 47 | endif
|
| 48 |
|
| 49 | $(EDK2_CONF):
|
| 50 | ifeq ("$(OS)","Windows_NT")
|
| 51 | copy $(EDK_TOOLS_PATH)\Conf\build_rule.template Conf\build_rule.txt
|
| 52 | copy $(EDK_TOOLS_PATH)\Conf\FrameworkDatabase.template Conf\FrameworkDatabase.txt
|
| 53 | copy $(EDK_TOOLS_PATH)\Conf\target.template Conf\target.txt
|
| 54 | copy $(EDK_TOOLS_PATH)\Conf\tools_def.template Conf\tools_def.txt
|
| 55 | else
|
| 56 | . ./edksetup.sh; $(MAKE) -C BaseTools
|
| 57 | endif
|
| 58 |
|
| 59 | clean:
|
| 60 | ifeq ("$(OS)","Windows_NT")
|
| 61 | build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall
|
| 62 | else
|
| 63 | . ./edksetup.sh; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall; \
|
| 64 | rm -Rf $(EDK2_CONF) Conf/.cache
|
| 65 | endif
|