blob: 00274ca813549a9309fb7908a990a736ed0369ea [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001#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
17usage ()
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
25if [ "$#" -ne 3 ]; then
26 usage
27 exit 0
28fi
29
30if [ "$2" != "ON" ] && [ "$2" != "OFF" ]; then
31 usage
32 exit
33fi
34
35DCTDIR=$1
36STATE=$2
37CFGFILE=$3
38
39if [ -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
52else
53 echo "File $3 doesn't exist. Please provide valid make file\n"
54fi