comparison gsm-fw/cfgmagic/functions @ 143:afceeeb2cba1

Our nuc-fw is destined to become gsm-fw, so I went ahead and did the big hg mv
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 12 Nov 2013 05:35:48 +0000
parents nuc-fw/cfgmagic/functions@3641e44f044e
children 11b6ca57a079
comparison
equal deleted inserted replaced
142:15d5977390c2 143:afceeeb2cba1
1 target() {
2 if [ $# -lt 1 ]
3 then
4 echo "target setting: required argument missing" 1>&2
5 exit 1
6 fi
7 if [ -n "$TARGET" ]
8 then
9 echo "Error: target specified more than once" 1>&2
10 exit 1
11 fi
12 if [ ! -f "cfgmagic/target.$1" ]
13 then
14 echo "Error: target $1 not known" 1>&2
15 exit 1
16 fi
17 # looks good, proceed
18 TARGET="$1"
19 . "cfgmagic/target.$1"
20 . cfgmagic/post-target
21 }
22
23 feature() {
24 if [ $# -lt 1 ]
25 then
26 echo "feature setting: required argument missing" 1>&2
27 exit 1
28 fi
29 if [ -z "$TARGET" ]
30 then
31 echo "Please specify the target before any features" 1>&2
32 exit 1
33 fi
34 if [ ! -f "cfgmagic/feature.$1" ]
35 then
36 echo "Error: feature $1 not known" 1>&2
37 exit 1
38 fi
39 # looks good, proceed
40 . "cfgmagic/feature.$1"
41 }
42
43 export_to_c() {
44 if [ $# != 1 ]
45 then
46 echo "export_to_c: wrong number of arguments" 1>&2
47 exit 1
48 fi
49 case "$c_export_list" in
50 *" $1 "* | *" $1")
51 ;;
52 *)
53 c_export_list="$c_export_list $1"
54 ;;
55 esac
56 }
57
58 export_to_mk() {
59 if [ $# != 1 ]
60 then
61 echo "export_to_mk: wrong number of arguments" 1>&2
62 exit 1
63 fi
64 case "$mk_export_list" in
65 *" $1 "* | *" $1")
66 ;;
67 *)
68 mk_export_list="$mk_export_list $1"
69 ;;
70 esac
71 }
72
73 export_to_m4() {
74 if [ $# != 1 ]
75 then
76 echo "export_to_m4: wrong number of arguments" 1>&2
77 exit 1
78 fi
79 case "$m4_export_list" in
80 *" $1 "* | *" $1")
81 ;;
82 *)
83 m4_export_list="$m4_export_list $1"
84 ;;
85 esac
86 }