################################################################################ # Copyright (c) [2017-2019] [Radisys] # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # # You may obtain a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an "AS IS" BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ #! /bin/sh function printUsageAndExit(){ echo "Usage: $0 -m (TDD | FDD) " echo "" echo "Mandatory arguments" echo "===================" echo " -m, --mode (TDD | FDD) Mode has to be either TDD or FDD" echo "Optional arguments" echo "===================" echo " Desitnation directory where compilation will be done" echo " or Package or EVAL yes" echo "" exit 1; } DIR=$PWD/../.. MODE= TARGET_DIRS_FOUND=0 PKG="NO" OLD_MODE="TDD" while [ "$1" != "" ]; do case $1 in -m | --mode ) shift MODE=$1 ;; -PKG ) PKG="YES" ;; -h | --help ) printUsageAndExit ;; * ) DIR=$1 TARGET_DIRS_FOUND=`expr $TARGET_DIRS_FOUND + 1` esac shift done if [ "$MODE" != "FDD" ] && [ "$MODE" != "TDD" ] then echo "Invalid mode specified $MODE" printUsageAndExit fi SRC_PATH=$DIR/src BIN_PATH=$DIR/bin echo $PWD $SRC_PATH $BIN_PATH #******************************************* Implemented Local Build Functionalities ****************************************** BLD_PATH=$SRC_PATH/../build/ BuildFileResult=$BLD_PATH/targetbuild.txt rm -f $BuildFileResult echo $MODE > $BuildFileResult #******************************************************************************************************************************* #Remvoing unwanted files from the package find $SRC_PATH -name "*.tmp" -exec rm -f {} \; find $SRC_PATH -name "*.keep" -exec rm -f {} \; find $SRC_PATH -name "*.contrib" -exec rm -f {} \; find $SRC_PATH -name "*.contrib.1" -exec rm -f {} \; find $SRC_PATH -name "*.contrib.2" -exec rm -f {} \;