As the GenBin tool is necessary for SCT build, it is appropriate to
support it's build in the SCT build procedure.

Cc: Supreeth Venkatesh <supreeth.venkat...@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Lokesh B V <lokesh...@arm.com>
---
 .gitignore               |  1 +
 uefi-sct/SctPkg/build.sh | 33 ++++++++++++++++++++-------------
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/.gitignore b/.gitignore
index 821ed66..3b8d818 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 Build/
 tags/
+*.[od]
diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh
index 73581c9..92e52c6 100755
--- a/uefi-sct/SctPkg/build.sh
+++ b/uefi-sct/SctPkg/build.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 #  Copyright 2006 - 2015 Unified EFI, Inc.<BR>
-#  Copyright (c) 2011 - 2015, ARM Ltd. All rights reserved.<BR>
+#  Copyright (c) 2011 - 2018, ARM Ltd. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -228,21 +228,28 @@ else
   echo using prebuilt tools
 fi
 
-# Copy GenBin file to Base tools directory
+if  [[ ! -e $EDK_TOOLS_PATH/Source/C/bin/GenBin ]]
+then
+  # build the GenBin if it doesn't yet exist
+  echo Building GenBin
+  make -C $EDK_TOOLS_PATH/../SctPkg/Tools/Source/GenBin
+  status=$?
+  if test $status -ne 0
+  then
+  echo Error while building GenBin
+    exit -1
+  fi
+else
+  echo using prebuilt GenBin
+fi
+
+# Copy GenBin file to Base tools bin directory
 DEST_DIR=`GetEdkToolsPathBinDirectory`
 # Ensure the directory exist
 mkdir -p $DEST_DIR
-case `uname -m` in 
-       x86_64)
-               cp SctPkg/Tools/Bin/GenBin_lin_64 $DEST_DIR/GenBin
-               ;;
-       x86_32)
-               cp SctPkg/Tools/Bin/GenBin_lin_32 $DEST_DIR/GenBin
-               ;;
-       *)
-               cp SctPkg/Tools/Bin/GenBin_lin_32 $DEST_DIR/GenBin
-               ;;
-esac
+cp $EDK_TOOLS_PATH/Source/C/bin/GenBin $DEST_DIR/GenBin
+# Clean the intermediate binary file
+rm -f $EDK_TOOLS_PATH/Source/C/bin/GenBin
 
 #
 # Build the SCT package
-- 
2.7.4

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to