1 ################################################################################
2 # Copyright (c) [2017-2019] [Radisys] #
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
5 # you may not use this file except in compliance with the License. #
6 # You may obtain a copy of the License at #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
10 # Unless required by applicable law or agreed to in writing, software #
11 # distributed under the License is distributed on an "AS IS" BASIS, #
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
13 # See the License for the specific language governing permissions and #
14 # limitations under the License. #
15 ################################################################################
19 function printUsageAndExit(){
20 echo "Usage: $0 -m (TDD | FDD) <dir_to_be_created>"
22 echo "Mandatory arguments"
23 echo "==================="
24 echo " -m, --mode (TDD | FDD) Mode has to be either TDD or FDD"
25 echo "Optional arguments"
26 echo "==================="
27 echo " <dir_to_be_created> Desitnation directory where compilation will be done"
28 echo " <PKG> or <EVAL> Package or EVAL yes"
39 while [ "$1" != "" ]; do
46 -h | --help ) printUsageAndExit
49 TARGET_DIRS_FOUND=`expr $TARGET_DIRS_FOUND + 1`
54 if [ "$MODE" != "FDD" ] && [ "$MODE" != "TDD" ]
56 echo "Invalid mode specified $MODE"
63 echo $PWD $SRC_PATH $BIN_PATH
65 #******************************************* Implemented Local Build Functionalities ******************************************
66 BLD_PATH=$SRC_PATH/../build/
67 BuildFileResult=$BLD_PATH/targetbuild.txt
68 rm -f $BuildFileResult
69 echo $MODE > $BuildFileResult
70 #*******************************************************************************************************************************
72 #Remvoing unwanted files from the package
73 find $SRC_PATH -name "*.tmp" -exec rm -f {} \;
74 find $SRC_PATH -name "*.keep" -exec rm -f {} \;
75 find $SRC_PATH -name "*.contrib" -exec rm -f {} \;
76 find $SRC_PATH -name "*.contrib.1" -exec rm -f {} \;
77 find $SRC_PATH -name "*.contrib.2" -exec rm -f {} \;