summaryrefslogtreecommitdiff
blob: 946255bc5cb0a2987f3e3a0d491944a91fe7244f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
--- /opt/androvm-4.1.1/build/envsetup.sh	2013-08-29 03:44:27.000000000 +0200
+++ build/envsetup.sh	2013-08-29 11:50:37.654461507 +0200
@@ -12,10 +12,10 @@
 
 Look at the source to view more functions. The complete list is:
 EOF
-    T=$(gettop)
+    TOP=$(gettop)
     local A
     A=""
-    for i in `cat $T/build/envsetup.sh | sed -n "/^function /s/function \([a-z_]*\).*/\1/p" | sort`; do
+    for i in `cat $TOP/build/envsetup.sh | sed -n "/^function /s/function \([a-z_]*\).*/\1/p" | sort`; do
       A="$A $i"
     done
     echo $A
@@ -24,32 +24,32 @@
 # Get the value of a build variable as an absolute path.
 function get_abs_build_var()
 {
-    T=$(gettop)
-    if [ ! "$T" ]; then
+    TOP=$(gettop)
+    if [ ! "$TOP" ]; then
         echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
         return
     fi
-    (cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
-      make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1)
+    (cd $TOP; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
+      make --no-print-directory -C "$TOP" -f build/core/config.mk dumpvar-abs-$1)
 }
 
 # Get the exact value of a build variable.
 function get_build_var()
 {
-    T=$(gettop)
-    if [ ! "$T" ]; then
+    TOP=$(gettop)
+    if [ ! "$TOP" ]; then
         echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
         return
     fi
     CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
-      make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-$1
+      make --no-print-directory -C "$TOP" -f build/core/config.mk dumpvar-$1
 }
 
 # check to see if the supplied product is one we can build
 function check_product()
 {
-    T=$(gettop)
-    if [ ! "$T" ]; then
+    TOP=$(gettop)
+    if [ ! "$TOP" ]; then
         echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
         return
     fi
@@ -79,8 +79,8 @@
 
 function setpaths()
 {
-    T=$(gettop)
-    if [ ! "$T" ]; then
+    TOP=$(gettop)
+    if [ ! "$TOP" ]; then
         echo "Couldn't locate the top of the tree.  Try setting TOP."
         return
     fi
@@ -147,8 +147,8 @@
     fi
 
     export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
-    export ANDROID_QTOOLS=$T/development/emulator/qtools
-    export ANDROID_DEV_SCRIPTS=$T/development/scripts
+    export ANDROID_QTOOLS=$TOP/development/emulator/qtools
+    export ANDROID_DEV_SCRIPTS=$TOP/development/scripts
     export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ARM_EABI_TOOLCHAIN$CODE_REVIEWS:$ANDROID_DEV_SCRIPTS
     export PATH=$PATH$ANDROID_BUILD_PATHS
 
@@ -169,17 +169,17 @@
 
     # needed for processing samples collected by perf counters
     unset OPROFILE_EVENTS_DIR
-    export OPROFILE_EVENTS_DIR=$T/external/oprofile/events
+    export OPROFILE_EVENTS_DIR=$TOP/external/oprofile/events
 
     # needed for building linux on MacOS
     # TODO: fix the path
-    #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include
+    #export HOST_EXTRACFLAGS="-I "$TOP/system/kernel_headers/host_include
 }
 
 function printconfig()
 {
-    T=$(gettop)
-    if [ ! "$T" ]; then
+    TOP=$(gettop)
+    if [ ! "$TOP" ]; then
         echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
         return
     fi
@@ -566,14 +566,14 @@
             # a command that prints something as a side-effect
             # (like pushd)
             local HERE=$PWD
-            T=
+            TOP=
             while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
                 cd .. > /dev/null
-                T=`PWD= /bin/pwd`
+                TOP=`PWD= /bin/pwd`
             done
             cd $HERE > /dev/null
-            if [ -f "$T/$TOPFILE" ]; then
-                echo $T
+            if [ -f "$TOP/$TOPFILE" ]; then
+                echo $TOP
             fi
         fi
     fi
@@ -581,9 +581,9 @@
 
 function m()
 {
-    T=$(gettop)
-    if [ "$T" ]; then
-        make -C $T $@
+    TOP=$(gettop)
+    if [ "$TOP" ]; then
+        make -C $TOP $@
     else
         echo "Couldn't locate the top of the tree.  Try setting TOP."
     fi
@@ -596,11 +596,11 @@
     # a command that prints something as a side-effect
     # (like pushd)
     local HERE=$PWD
-    T=
+    TOP=
     while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
-        T=$PWD
-        if [ -f "$T/Android.mk" ]; then
-            echo $T/Android.mk
+        TOP=$PWD
+        if [ -f "$TOP/Android.mk" ]; then
+            echo $TOP/Android.mk
             cd $HERE > /dev/null
             return
         fi
@@ -617,24 +617,24 @@
         make $@
     else
         # Find the closest Android.mk file.
-        T=$(gettop)
+        TOP=$(gettop)
         local M=$(findmakefile)
         # Remove the path to top as the makefilepath needs to be relative
-        local M=`echo $M|sed 's:'$T'/::'`
-        if [ ! "$T" ]; then
+        local M=`echo $M|sed 's:'$TOP'/::'`
+        if [ ! "$TOP" ]; then
             echo "Couldn't locate the top of the tree.  Try setting TOP."
         elif [ ! "$M" ]; then
             echo "Couldn't locate a makefile from the current directory."
         else
-            ONE_SHOT_MAKEFILE=$M make -C $T all_modules $@
+            ONE_SHOT_MAKEFILE=$M make -C $TOP all_modules $@
         fi
     fi
 }
 
 function mmm()
 {
-    T=$(gettop)
-    if [ "$T" ]; then
+    TOP=$(gettop)
+    if [ "$TOP" ]; then
         local MAKEFILE=
         local MODULES=
         local ARGS=
@@ -648,7 +648,7 @@
             fi
             DIR=`echo $DIR | sed -e 's/:.*//' -e 's:/$::'`
             if [ -f $DIR/Android.mk ]; then
-                TO_CHOP=`(cd -P -- $T && pwd -P) | wc -c | tr -d ' '`
+                TO_CHOP=`(cd -P -- $TOP && pwd -P) | wc -c | tr -d ' '`
                 TO_CHOP=`expr $TO_CHOP + 1`
                 START=`PWD= /bin/pwd`
                 MFILE=`echo $START | cut -c${TO_CHOP}-`
@@ -673,7 +673,7 @@
                 fi
             fi
         done
-        ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS $MODULES $ARGS
+        ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $TOP $DASH_ARGS $MODULES $ARGS
     else
         echo "Couldn't locate the top of the tree.  Try setting TOP."
     fi
@@ -681,8 +681,8 @@
 
 function croot()
 {
-    T=$(gettop)
-    if [ "$T" ]; then
+    TOP=$(gettop)
+    if [ "$TOP" ]; then
         cd $(gettop)
     else
         echo "Couldn't locate the top of the tree.  Try setting TOP."
@@ -696,11 +696,11 @@
     # a command that prints something as a side-effect
     # (like pushd)
     local HERE=$PWD
-    T=
+    TOP=
     while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
-        T=$PWD
-        if [ -f "$T/Android.mk" ]; then
-            cd $T
+        TOP=$PWD
+        if [ -f "$TOP/Android.mk" ]; then
+            cd $TOP
             return
         fi
         cd .. > /dev/null
@@ -854,13 +854,13 @@
 
 function tracedmdump()
 {
-    T=$(gettop)
-    if [ ! "$T" ]; then
+    TOP=$(gettop)
+    if [ ! "$TOP" ]; then
         echo "Couldn't locate the top of the tree.  Try setting TOP."
         return
     fi
     local prebuiltdir=$(getprebuilt)
-    local KERNEL=$T/prebuilt/android-arm/kernel/vmlinux-qemu
+    local KERNEL=$TOP/prebuilt/android-arm/kernel/vmlinux-qemu
 
     local TRACE=$1
     if [ ! "$TRACE" ] ; then
@@ -1007,13 +1007,13 @@
         echo "Couldn't locate output files.  Try running 'lunch' first." >&2
         return
     fi
-    T=$(gettop)
-    if [ ! "$T" ]; then
+    TOP=$(gettop)
+    if [ ! "$TOP" ]; then
         echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
         return
     fi
 
-    (cd "$T" && mmm tests/SmokeTest) &&
+    (cd "$TOP" && mmm tests/SmokeTest) &&
       adb uninstall com.android.smoketest > /dev/null &&
       adb uninstall com.android.smoketest.tests > /dev/null &&
       adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTestApp.apk &&
@@ -1024,12 +1024,12 @@
 # simple shortcut to the runtest command
 function runtest()
 {
-    T=$(gettop)
-    if [ ! "$T" ]; then
+    TOP=$(gettop)
+    if [ ! "$TOP" ]; then
         echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
         return
     fi
-    ("$T"/development/testrunner/runtest.py $@)
+    ("$TOP"/development/testrunner/runtest.py $@)
 }
 
 function godir () {
@@ -1037,15 +1037,15 @@
         echo "Usage: godir <regex>"
         return
     fi
-    T=$(gettop)
-    if [[ ! -f $T/filelist ]]; then
+    TOP=$(gettop)
+    if [[ ! -f $TOP/filelist ]]; then
         echo -n "Creating index..."
-        (cd $T; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > filelist)
+        (cd $TOP; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > filelist)
         echo " Done"
         echo ""
     fi
     local lines
-    lines=($(\grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq))
+    lines=($(\grep "$1" $TOP/filelist | sed -e 's/\/[^/]*$//' | sort | uniq))
     if [[ ${#lines[@]} = 0 ]]; then
         echo "Not found"
         return
@@ -1073,7 +1073,7 @@
     else
         pathname=${lines[0]}
     fi
-    cd $T/$pathname
+    cd $TOP/$pathname
 }
 
 # Force JAVA_HOME to point to java 1.6 if it isn't already set