Brian Waters | 13d9601 | 2017-12-08 16:53:31 -0600 | [diff] [blame] | 1 | #Copyright (c) 2017 Sprint |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | #!/bin/sh |
| 16 | |
| 17 | usage () |
| 18 | { |
| 19 | echo "Turns on/off dictionary build in cmake for the specified" |
| 20 | echo "specific (no 'dict_' in front) and all items it depends upon" |
| 21 | echo "as defined in its associated .did file." |
| 22 | echo "Usage: $0 <dictionary name> <ON|OFF> <make file>" |
| 23 | } |
| 24 | |
| 25 | if [ "$#" -ne 3 ]; then |
| 26 | usage |
| 27 | exit 0 |
| 28 | fi |
| 29 | |
| 30 | if [ "$2" != "ON" ] && [ "$2" != "OFF" ]; then |
| 31 | usage |
| 32 | exit |
| 33 | fi |
| 34 | |
| 35 | DCTDIR=$1 |
| 36 | STATE=$2 |
| 37 | CFGFILE=$3 |
| 38 | |
| 39 | if [ -e $3 ]; then |
| 40 | if [ -d "dict_${DCTDIR}" ]; then |
| 41 | if [ -e "dict_${DCTDIR}/${DCTDIR}.did" ]; then |
| 42 | while read p; do |
| 43 | echo "Turning $p $2" |
| 44 | ./fddict_make.sh $p $2 $3 |
| 45 | done <dict_${DCTDIR}/${DCTDIR}.did |
| 46 | else |
| 47 | echo "dict_${DCTDIR}.did was not present - skipping" |
| 48 | fi |
| 49 | else |
| 50 | echo "Directory dict_${DCTDIR} doesn't exist\n" |
| 51 | fi |
| 52 | else |
| 53 | echo "File $3 doesn't exist. Please provide valid make file\n" |
| 54 | fi |