summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 8f9dfdb..140f80c 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -2096,14 +2096,20 @@ function cmrebase() {
}
function mka() {
- case `uname -s` in
- Darwin)
- make -j `sysctl hw.ncpu|cut -d" " -f2` "$@"
- ;;
- *)
- mk_timer schedtool -B -n 1 -e ionice -n 1 make -j$(cat /proc/cpuinfo | grep "^processor" | wc -l) "$@"
- ;;
- esac
+ local T=$(gettop)
+ if [ "$T" ]; then
+ case `uname -s` in
+ Darwin)
+ make -C $T -j `sysctl hw.ncpu|cut -d" " -f2` "$@"
+ ;;
+ *)
+ mk_timer schedtool -B -n 1 -e ionice -n 1 make -C $T -j$(cat /proc/cpuinfo | grep "^processor" | wc -l) "$@"
+ ;;
+ esac
+
+ else
+ echo "Couldn't locate the top of the tree. Try setting TOP."
+ fi
}
function cmka() {