FreeCalypso > hg > fc-magnetite
annotate configure.sh @ 295:1aa8cab15e14
components/frame_na7_db_{fl,ir} created as an experiment
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 21 Oct 2017 02:50:37 +0000 |
parents | 21d128939204 |
children | 6d1eac845d3e |
rev | line source |
---|---|
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #!/bin/sh |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 set -e |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 if [ ! -f configure.sh ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 echo "This script needs to be run from the top of the source tree" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 if [ ! -f helpers/makeline ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 echo "Please run make in the helpers directory first" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 # start looking at our invokation line |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 |
243
619febca2803
configure.sh: the correct form of equality test operator in [ is '='
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
19 if [ "$1" = --clean ] |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 clean_flag=1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 shift |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 else |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 clean_flag=0 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 if [ $# -lt 2 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 echo "usage: $0 [--clean] target config [vars]" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 TARGET="$1" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 CONFIG="$2" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 if [ ! -f "targets/$TARGET.conf" -o ! -f "targets/$TARGET.h" ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 echo "Error: target $TARGET not known" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 if [ ! -f "configs/$CONFIG" ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 echo "Error: configuration $CONFIG not known" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 |
291
21d128939204
implemented build option to disable sleep
Mychaela Falconia <falcon@freecalypso.org>
parents:
259
diff
changeset
|
48 DISABLE_SLEEP=0 |
21d128939204
implemented build option to disable sleep
Mychaela Falconia <falcon@freecalypso.org>
parents:
259
diff
changeset
|
49 |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 . "targets/$TARGET.conf" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 BUILD_DIR="build-$TARGET-$CONFIG" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 USE_STR2IND=0 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 # allow the user to override these defaults |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 shift |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 shift |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 while [ $# != 0 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 do |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 eval "$1" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 shift |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 done |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 echo "Building configuration $CONFIG for target $TARGET in $BUILD_DIR" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 if [ "$clean_flag" = 1 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 rm -rf $BUILD_DIR |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 mkdir -p $BUILD_DIR |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 : > $BUILD_DIR/lcfgen |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 # shell functions to be used in the configuration recipe |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 build_lib() { |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 if [ $# -lt 1 -o $# -gt 2 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 echo "Error: build_lib takes 1 or 2 arguments" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 scripts/mk-component.sh "$1" "$2" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 SUBDIR="$SUBDIR $1" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 current_lib=$1/$1.lib |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 LIBS="$LIBS $current_lib" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 } |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 |
65
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
89 blob_lib_std() { |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
90 if [ $# != 1 ] |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
91 then |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
92 echo "Error: blob_lib_std takes 1 argument" 1>&2 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
93 exit 1 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
94 fi |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
95 current_lib="../blobs/libs/$1.lib" |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
96 LIBS="$LIBS $current_lib" |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
97 } |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
98 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
99 blob_lib_gpf() { |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 if [ $# != 1 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 then |
65
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
102 echo "Error: blob_lib_gpf takes 1 argument" 1>&2 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
103 exit 1 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
104 fi |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
105 current_lib="../blobs/gpflibs/$1.lib" |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
106 LIBS="$LIBS $current_lib" |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
107 } |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
108 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
109 blob_lib_os() { |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
110 if [ $# != 1 ] |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
111 then |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
112 echo "Error: blob_lib_os takes 1 argument" 1>&2 |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 fi |
65
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
115 current_lib="../blobs/oslibs/$1.lib" |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
116 LIBS="$LIBS $current_lib" |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
117 } |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
118 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
119 blob_lib_custom() { |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
120 if [ $# != 2 ] |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
121 then |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
122 echo "Error: blob_lib_custom takes 2 arguments" 1>&2 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
123 exit 1 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
124 fi |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
125 if [ -z "$1" ] |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
126 then |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
127 echo "Error: this config is not supported on this target" 1>&2 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
128 exit 1 |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
129 fi |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
130 cp $1 $BUILD_DIR/$2.lib |
bb53b2e2d548
revamped the handling of blob libs
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
131 current_lib=$2.lib |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 LIBS="$LIBS $current_lib" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 } |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 lib_link_magic() { |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 if [ $# != 1 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 echo "Error: lib_link_magic takes 1 argument" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 if [ -z "$current_lib" ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 echo "Error: lib_link_magic called before build_lib or blob_lib" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 SPECIAL_LINK_LIBS="$SPECIAL_LINK_LIBS $current_lib" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 echo "$1" >> $BUILD_DIR/lcfgen |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 } |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 # invoke the configuration recipe |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 export BUILD_DIR TARGET USE_STR2IND |
291
21d128939204
implemented build option to disable sleep
Mychaela Falconia <falcon@freecalypso.org>
parents:
259
diff
changeset
|
153 export DISABLE_SLEEP |
101
5c13f9325e2d
preparations for rebuilding main.lib from partial source
Mychaela Falconia <falcon@freecalypso.org>
parents:
90
diff
changeset
|
154 export INIT_blob |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 SUBDIR= |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 LIBS= |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 SPECIAL_LINK_LIBS= |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 current_lib= |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 . "configs/$CONFIG" |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 # str2ind magic |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 if [ -z "$str2ind_blobs_used" ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 echo "Error: configs/$CONFIG must set str2ind_blobs_used" 1>&2 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 exit 1 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 if [ "$str2ind_blobs_used" = 1 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 cp blobs/str2ind.tab $BUILD_DIR |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 if [ "$str2ind_blobs_used" = 0 -a "$USE_STR2IND" = 0 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 echo 'char *str2ind_version = "&0";' > $BUILD_DIR/str2ind.c |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 # generate the top level Makefile! |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 |
249
17f3647752ba
configure.sh: emit the config name into the generated Makefile
Mychaela Falconia <falcon@freecalypso.org>
parents:
243
diff
changeset
|
183 helpers/makeline def CONFIG_NAME $CONFIG > $BUILD_DIR/Makefile |
17f3647752ba
configure.sh: emit the config name into the generated Makefile
Mychaela Falconia <falcon@freecalypso.org>
parents:
243
diff
changeset
|
184 echo >> $BUILD_DIR/Makefile |
17f3647752ba
configure.sh: emit the config name into the generated Makefile
Mychaela Falconia <falcon@freecalypso.org>
parents:
243
diff
changeset
|
185 helpers/makeline def SUBDIR $SUBDIR >> $BUILD_DIR/Makefile |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 echo >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 helpers/makeline def LIBS $LIBS >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 echo >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 helpers/makeline def SPECIAL_LINK_LIBS $SPECIAL_LINK_LIBS >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 echo >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 helpers/makeline def LINK_SCRIPT_SRC ../$LINK_SCRIPT_SRC >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 echo >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 |
90
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
194 if [ -n "$RAM_LINK_SCRIPT_SRC" ] |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
195 then |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
196 helpers/makeline def RAM_LINK_SCRIPT_SRC ../$RAM_LINK_SCRIPT_SRC \ |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
197 >> $BUILD_DIR/Makefile |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
198 echo >> $BUILD_DIR/Makefile |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
199 fi |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
200 |
258
13bcc2ed7e44
configure.sh & targets/*.conf: emit FLASH_BASE_ADDR & FLASH_SECTOR_SIZE
Mychaela Falconia <falcon@freecalypso.org>
parents:
249
diff
changeset
|
201 helpers/makeline def FLASH_BASE_ADDR $FLASH_BASE_ADDR >> $BUILD_DIR/Makefile |
13bcc2ed7e44
configure.sh & targets/*.conf: emit FLASH_BASE_ADDR & FLASH_SECTOR_SIZE
Mychaela Falconia <falcon@freecalypso.org>
parents:
249
diff
changeset
|
202 helpers/makeline def FLASH_SECTOR_SIZE $FLASH_SECTOR_SIZE >> $BUILD_DIR/Makefile |
13bcc2ed7e44
configure.sh & targets/*.conf: emit FLASH_BASE_ADDR & FLASH_SECTOR_SIZE
Mychaela Falconia <falcon@freecalypso.org>
parents:
249
diff
changeset
|
203 echo >> $BUILD_DIR/Makefile |
13bcc2ed7e44
configure.sh & targets/*.conf: emit FLASH_BASE_ADDR & FLASH_SECTOR_SIZE
Mychaela Falconia <falcon@freecalypso.org>
parents:
249
diff
changeset
|
204 |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 cat makefile-frags/first-part >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 if [ "$USE_STR2IND" = 1 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 cat makefile-frags/str2ind-tab-depend >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 if [ "$str2ind_blobs_used" = 1 -o "$USE_STR2IND" = 1 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 cat makefile-frags/str2ind-c-gen >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 cat makefile-frags/link-steps >> $BUILD_DIR/Makefile |
88
46d9d68a3911
top Makefile: support building flash images for the C139
Mychaela Falconia <falcon@freecalypso.org>
parents:
65
diff
changeset
|
218 if [ "$TARGET" != c139 ] |
46d9d68a3911
top Makefile: support building flash images for the C139
Mychaela Falconia <falcon@freecalypso.org>
parents:
65
diff
changeset
|
219 then |
46d9d68a3911
top Makefile: support building flash images for the C139
Mychaela Falconia <falcon@freecalypso.org>
parents:
65
diff
changeset
|
220 cat makefile-frags/m0-to-bin-std >> $BUILD_DIR/Makefile |
46d9d68a3911
top Makefile: support building flash images for the C139
Mychaela Falconia <falcon@freecalypso.org>
parents:
65
diff
changeset
|
221 else |
46d9d68a3911
top Makefile: support building flash images for the C139
Mychaela Falconia <falcon@freecalypso.org>
parents:
65
diff
changeset
|
222 cat makefile-frags/m0-to-bin-c139 >> $BUILD_DIR/Makefile |
46d9d68a3911
top Makefile: support building flash images for the C139
Mychaela Falconia <falcon@freecalypso.org>
parents:
65
diff
changeset
|
223 fi |
259
2bb8b1c11afc
build system: produce flash-script for flashing with fc-loadtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
258
diff
changeset
|
224 cat makefile-frags/flash-script-gen >> $BUILD_DIR/Makefile |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 |
90
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
226 if [ -n "$RAM_LINK_SCRIPT_SRC" ] |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
227 then |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
228 cat makefile-frags/ram-link-steps >> $BUILD_DIR/Makefile |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
229 fi |
7bd197063b9e
building RAM fw images for the Pirelli: initial concept
Mychaela Falconia <falcon@freecalypso.org>
parents:
88
diff
changeset
|
230 |
62
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 cat makefile-frags/clean-always >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 if [ "$str2ind_blobs_used" = 0 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 echo ' rm -f str2ind.tab str2ind.log' >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 if [ "$str2ind_blobs_used" = 1 -o "$USE_STR2IND" = 1 ] |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 then |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 echo ' rm -f str2ind.c' >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 fi |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 echo >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 echo 'FRC:' >> $BUILD_DIR/Makefile |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 # All done! |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 |
9c16635ee5d2
configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 echo "Run make in $BUILD_DIR to compile the firmware" |