Browse Source

Moved clean building into a separate script.

David Piuva 5 years ago
parent
commit
dfdf91948d
2 changed files with 14 additions and 5 deletions
  1. 5 5
      Source/tools/build.sh
  2. 9 0
      Source/tools/clean.sh

+ 5 - 5
Source/tools/build.sh

@@ -17,14 +17,14 @@ TEMP_SUB=$(echo $TEMP_SUB | tr -d " =-")
 TEMP_DIR=${TEMP_ROOT}/${TEMP_SUB}
 echo "Building version ${TEMP_SUB}"
 
-# Create a temporary folder
-mkdir -p ${TEMP_DIR}
-# Remove objects, but keep libraries
-rm -f ${TEMP_DIR}/*.o
 
-# Allow calling the build script
+# Allow calling other scripts
+chmod +x ${ROOT_PATH}/tools/clean.sh
 chmod +x ${ROOT_PATH}/tools/buildLibrary.sh
 
+# Make a clean folder
+${ROOT_PATH}/tools/clean.sh ${TEMP_DIR}
+
 echo "Compiling renderer framework."
 ${ROOT_PATH}/tools/buildLibrary.sh g++ ${ROOT_PATH}/DFPSR ${TEMP_DIR} "dfpsr" ${CPP_VERSION} ${O_LEVEL} ${MODE} LAZY
 if [ $? -ne 0 ]

+ 9 - 0
Source/tools/clean.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Load arguments into named variables in order
+TEMP_DIR=$1 # Which folder to create or clear
+
+# Create a temporary folder
+mkdir -p ${TEMP_DIR}
+# Remove objects, but keep libraries
+rm -f ${TEMP_DIR}/*.o