annotate configure.sh @ 62:9c16635ee5d2

configure.sh: putting it all together
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 01 Oct 2016 02:48:53 +0000
parents
children bb53b2e2d548
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 if [ "$1" == --clean ]
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
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 . "targets/$TARGET.conf"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 BUILD_DIR="build-$TARGET-$CONFIG"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 USE_STR2IND=0
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 # allow the user to override these defaults
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 shift
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 shift
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 while [ $# != 0 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 do
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 eval "$1"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 shift
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 done
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 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
64
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 if [ "$clean_flag" = 1 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 rm -rf $BUILD_DIR
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 mkdir -p $BUILD_DIR
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 : > $BUILD_DIR/lcfgen
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 # shell functions to be used in the configuration recipe
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 build_lib() {
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 if [ $# -lt 1 -o $# -gt 2 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 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
79 exit 1
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 scripts/mk-component.sh "$1" "$2"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 SUBDIR="$SUBDIR $1"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 current_lib=$1/$1.lib
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 LIBS="$LIBS $current_lib"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 }
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 blob_lib() {
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 if [ $# != 1 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 echo "Error: blob_lib takes 1 argument" 1>&2
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 exit 1
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 current_lib="../$1"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 LIBS="$LIBS $current_lib"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 }
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 lib_link_magic() {
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 if [ $# != 1 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 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
101 exit 1
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 if [ -z "$current_lib" ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 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
106 exit 1
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 SPECIAL_LINK_LIBS="$SPECIAL_LINK_LIBS $current_lib"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 echo "$1" >> $BUILD_DIR/lcfgen
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 }
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 # invoke the configuration recipe
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 export BUILD_DIR TARGET USE_STR2IND
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 SUBDIR=
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 LIBS=
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 SPECIAL_LINK_LIBS=
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 current_lib=
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 . "configs/$CONFIG"
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 # str2ind magic
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 if [ -z "$str2ind_blobs_used" ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 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
128 exit 1
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 if [ "$str2ind_blobs_used" = 1 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 cp blobs/str2ind.tab $BUILD_DIR
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 if [ "$str2ind_blobs_used" = 0 -a "$USE_STR2IND" = 0 ]
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 'char *str2ind_version = "&0";' > $BUILD_DIR/str2ind.c
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 # generate the top level Makefile!
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 helpers/makeline def SUBDIR $SUBDIR > $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 echo >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 helpers/makeline def LIBS $LIBS >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 echo >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 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
148 echo >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 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
150 echo >> $BUILD_DIR/Makefile
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 cat makefile-frags/first-part >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 if [ "$USE_STR2IND" = 1 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 cat makefile-frags/str2ind-tab-depend >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 if [ "$str2ind_blobs_used" = 1 -o "$USE_STR2IND" = 1 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 cat makefile-frags/str2ind-c-gen >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 cat makefile-frags/link-steps >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 cat makefile-frags/clean-always >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 if [ "$str2ind_blobs_used" = 0 ]
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 then
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 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
170 fi
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 if [ "$str2ind_blobs_used" = 1 -o "$USE_STR2IND" = 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 echo ' rm -f str2ind.c' >> $BUILD_DIR/Makefile
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 echo >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 echo 'FRC:' >> $BUILD_DIR/Makefile
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 # All done!
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179
9c16635ee5d2 configure.sh: putting it all together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 echo "Run make in $BUILD_DIR to compile the firmware"