From: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
To: <ard.biesheuvel@linaro.org>, <leif.lindholm@linaro.org>,
<michael.d.kinney@intel.com>, <edk2-devel@lists.01.org>
Subject: [PATCH edk2-platforms] [PATCH v3 9/9] Build : Add build script and environment script
Date: Mon, 27 Nov 2017 16:21:57 +0530 [thread overview]
Message-ID: <1511779917-9255-10-git-send-email-meenakshi.aggarwal@nxp.com> (raw)
In-Reply-To: <1511779917-9255-1-git-send-email-meenakshi.aggarwal@nxp.com>
Build script and Environment setup script.
Readme to explain how to run build script
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
---
Platform/NXP/Env.cshrc | 77 ++++++++++++++++++++++++++++++++++++
Platform/NXP/Readme.md | 15 +++++++
Platform/NXP/build.sh | 103 +++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 195 insertions(+)
create mode 100755 Platform/NXP/Env.cshrc
create mode 100644 Platform/NXP/Readme.md
create mode 100755 Platform/NXP/build.sh
diff --git a/Platform/NXP/Env.cshrc b/Platform/NXP/Env.cshrc
new file mode 100755
index 0000000..31abb04
--- /dev/null
+++ b/Platform/NXP/Env.cshrc
@@ -0,0 +1,77 @@
+# @file.
+#
+# Copyright 2017 NXP
+#
+# This program and the accompanying materials are licensed and made available under
+# the terms and conditions of the BSD License which accompanies this distribution.
+# The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+#
+
+unset GCC_UTILITY GCC_VERSION MajorVersion MinorVersion
+
+if [ X"$CROSS_COMPILE_64" != X"" ]; then
+ ARM64_PREFIX="$CROSS_COMPILE_64"
+elif [ X"$CROSS_COMPILE" != X"" ]; then
+ ARM64_PREFIX="$CROSS_COMPILE"
+else
+ ARM64_PREFIX="aarch64-linux-gnu-"
+fi
+
+GCC_UTILITY="${ARM64_PREFIX}gcc"
+CheckGcc=`which $GCC_UTILITY >/dev/null 2>&1`
+if [ "$?" -eq 0 ];then
+ GCC_VERSION=`$GCC_UTILITY -v 2>&1 | tail -n 1 | awk '{print $3}'`
+ MajorVersion=`echo $GCC_VERSION | cut -d . -f 1`
+ MinorVersion=`echo $GCC_VERSION | cut -d . -f 2`
+ GCC_ARCH_PREFIX=
+ NOTSUPPORTED=0
+
+ case $MajorVersion in
+ 4)
+ case $MinorVersion in
+ 9)
+ GCC_ARCH_PREFIX="GCC49_AARCH64_PREFIX"
+ ;;
+ *)
+ NOTSUPPORTED=1
+ ;;
+ esac
+ ;;
+ 5)
+ case $MinorVersion in
+ 4)
+ GCC_ARCH_PREFIX="GCC5_AARCH64_PREFIX"
+ ;;
+ *)
+ GCC_ARCH_PREFIX="GCC5_AARCH64_PREFIX"
+ echo "Warning: ${GCC_UTILITY} version ($MajorVersion.$MinorVersion) has not been tested, please use at own risk."
+ ;;
+ esac
+ ;;
+ *)
+ NOTSUPPORTED=1
+ ;;
+ esac
+
+ [ "$NOTSUPPORTED" -eq 1 ] && {
+ echo "Error: ${GCC_UTILITY} version ($MajorVersion.$MinorVersion) not supported ."
+ unset GCC_UTILITY GCC_VERSION MajorVersion MinorVersion
+ }
+
+ [ -n "$GCC_ARCH_PREFIX" ] && {
+ export GCC_ARCH_PREFIX="$GCC_ARCH_PREFIX"
+ export "$GCC_ARCH_PREFIX=$ARM64_PREFIX"
+ }
+
+ unset ARCH
+else
+ echo "Error: ${GCC_UTILITY} not found. Please check PATH variable."
+ unset GCC_UTILITY GCC_VERSION MajorVersion MinorVersion
+fi
+
+export PACKAGES_PATH=$PWD/../../../edk2-platforms
diff --git a/Platform/NXP/Readme.md b/Platform/NXP/Readme.md
new file mode 100644
index 0000000..a11b90c
--- /dev/null
+++ b/Platform/NXP/Readme.md
@@ -0,0 +1,15 @@
+Support for all NXP boards is available in this directory.
+
+# How to build
+
+build script source environment file Env.cshrc
+
+user need to run only build command.
+
+1. Build desired board
+ ./build.sh <board-name> <build-candidate> <clean> (optional)
+
+ board-name : LS1043 / LS1046 / LS2088
+ build-candidate : DEBUG / RELEASE
+
+Currently, support for LS1043 is provided.
diff --git a/Platform/NXP/build.sh b/Platform/NXP/build.sh
new file mode 100755
index 0000000..e465ebf
--- /dev/null
+++ b/Platform/NXP/build.sh
@@ -0,0 +1,103 @@
+#!/bin/bash
+
+# UEFI build script for NXP LS SoCs
+#
+# Copyright 2017 NXP
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+
+# source environment file
+source Env.cshrc
+
+# Global Defaults
+ARCH=AARCH64
+TARGET_TOOLS=`echo $GCC_ARCH_PREFIX | cut -d _ -f 1`
+BASE_DIR=../../..
+
+[ -z "$TARGET_TOOLS" ] && {
+ echo "TARGET_TOOLS not found. Please run \"source Env.cshrc\" ."
+ exit 1
+}
+
+print_usage_banner()
+{
+ echo ""
+ echo "This shell script expects:"
+ echo " Arg 1 (mandatory): Board Type (can be LS1043 / LS1046 / LS2088)."
+ echo " Arg 2 (mandatory): Build candidate (can be RELEASE or DEBUG). By
+ default we build the RELEASE candidate."
+ echo " Arg 3 (optional): clean - To do a 'make clean' operation."
+}
+
+# Check for total num of input arguments
+if [[ "$#" -gt 3 ]]; then
+ echo "Illegal number of parameters"
+ print_usage_banner
+ exit
+fi
+
+# Check for third parameter to be clean only
+if [[ "$3" && $3 != "clean" ]]; then
+ echo "Error ! Either clean or emplty"
+ print_usage_banner
+ exit
+fi
+
+# Check for input arguments
+if [[ $1 == "" || $2 == "" ]]; then
+ echo "Error !"
+ print_usage_banner
+ exit
+fi
+
+# Check for input arguments
+if [[ $1 != "LS1043" && $1 != "LS1046" && $1 != "LS2088" ]]; then
+ echo "Error ! Incorrect Board Type specified."
+ print_usage_banner
+ exit
+fi
+
+# Check for input arguments
+if [[ $2 != "RELEASE" ]]; then
+ if [[ $2 != "DEBUG" ]]; then
+ echo "Error ! Incorrect build target specified."
+ print_usage_banner
+ exit
+ fi
+fi
+
+PKG="aRdbPkg"
+
+echo ".........................................."
+echo "Welcome to $1$PKG UEFI Build environment"
+echo ".........................................."
+
+if [[ $3 == "clean" ]]; then
+ echo "Cleaning up the build directory '$BASE_DIR/Build/$1$PKG/'.."
+ rm -rf $BASE_DIR/Build/$1$PKG/*
+ exit
+fi
+
+# Clean-up
+set -e
+shopt -s nocasematch
+
+#
+# Setup workspace now
+#
+echo Initializing workspace
+cd $BASE_DIR
+
+# Use the BaseTools in edk2
+export EDK_TOOLS_PATH=`pwd`/BaseTools
+source edksetup.sh BaseTools
+
+
+build -p "$WORKSPACE/edk2-platforms/Platform/NXP/$1$PKG/$1$PKG.dsc" -a $ARCH -t $TARGET_TOOLS -b $2
--
1.9.1
next prev parent reply other threads:[~2017-11-27 5:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 10:51 [PATCH edk2-platforms] [PATCH v3 0/9] Platform/NXP Meenakshi Aggarwal
2017-11-27 10:51 ` [PATCH edk2-platforms] [PATCH v3 1/9] Platform/NXP: Add support for Big Endian Mmio APIs Meenakshi Aggarwal
2017-11-27 10:51 ` [PATCH edk2-platforms] [PATCH v3 2/9] Platform/NXP : Add support for Watchdog driver Meenakshi Aggarwal
2017-12-04 14:35 ` Leif Lindholm
2017-12-04 15:23 ` Gao, Liming
2017-12-05 5:07 ` Udit Kumar
2017-12-05 11:06 ` Leif Lindholm
2017-12-07 3:35 ` Meenakshi Aggarwal
2017-12-07 7:11 ` Gao, Liming
2017-12-07 11:03 ` Leif Lindholm
2017-12-07 14:54 ` Gao, Liming
2017-12-07 15:34 ` Leif Lindholm
2017-12-08 4:41 ` Udit Kumar
2017-12-10 13:30 ` Gao, Liming
2017-12-14 3:37 ` Meenakshi Aggarwal
2017-12-07 11:15 ` Udit Kumar
2017-12-07 14:51 ` Gao, Liming
2017-11-27 10:51 ` [PATCH edk2-platforms] [PATCH v3 3/9] SocLib : Add support for initialization of peripherals Meenakshi Aggarwal
2017-11-27 10:51 ` [PATCH edk2-platforms] [PATCH v3 4/9] Platform/NXP : Add support for DUART library Meenakshi Aggarwal
2017-11-27 10:51 ` [PATCH edk2-platforms] [PATCH v3 5/9] Platform/NXP: Add support for I2c driver Meenakshi Aggarwal
2017-11-27 10:51 ` [PATCH edk2-platforms] [PATCH v3 6/9] Silicon/Maxim : Add support for DS1307 RTC library Meenakshi Aggarwal
2017-11-27 10:51 ` [PATCH edk2-platforms] [PATCH v3 7/9] Platform/NXP: Add support for ArmPlatformLib Meenakshi Aggarwal
2017-11-27 10:51 ` [PATCH edk2-platforms] [PATCH v3 8/9] Compilation : Add the fdf, dsc and dec files Meenakshi Aggarwal
2017-11-27 10:51 ` Meenakshi Aggarwal [this message]
2017-11-27 12:05 ` [PATCH edk2-platforms] [PATCH v3 0/9] Platform/NXP Leif Lindholm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1511779917-9255-10-git-send-email-meenakshi.aggarwal@nxp.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox