blob: 7b341c9d1b4429fd4f3b8e845969cad2f5f6349d [file] [log] [blame]
xplodwild3e9d0bb2013-08-24 17:40:37 +01001function __print_omni_functions_help() {
2cat <<EOF
3Additional OmniROM functions:
4- breakfast: Setup the build environment, but only list
5 devices we support.
6- brunch: Sets up build environment using breakfast(),
7 and then comiles using mka() against bacon target.
8- mka: Builds using SCHED_BATCH on all processors.
9EOF
10}
11
12function brunch()
13{
14 breakfast $*
15 if [ $? -eq 0 ]; then
16 time mka bacon
17 else
18 echo "No such item in brunch menu. Try 'breakfast'"
19 return 1
20 fi
21 return $?
22}
23
24function breakfast()
25{
26 target=$1
27 CUSTOM_DEVICES_ONLY="true"
28 unset LUNCH_MENU_CHOICES
29 add_lunch_combo full-eng
30 for f in `/bin/ls device/*/*/vendorsetup.sh 2> /dev/null`
31 do
32 echo "including $f"
33 . $f
34 done
35 unset f
36
37 if [ $# -eq 0 ]; then
38 # No arguments, so let's have the full menu
39 lunch
40 else
41 echo "z$target" | grep -q "-"
42 if [ $? -eq 0 ]; then
43 # A buildtype was specified, assume a full device name
44 lunch $target
45 else
46 # This is probably just the omni model name
47 lunch omni_$target-userdebug
48 fi
49 fi
50 return $?
51}
52
53alias bib=breakfast
54
55# Make using all available CPUs
56function mka() {
57 case `uname -s` in
58 Darwin)
59 make -j `sysctl hw.ncpu|cut -d" " -f2` "$@"
60 ;;
61 *)
62 schedtool -B -n 1 -e ionice -n 1 make -j `cat /proc/cpuinfo | grep "^processor" | wc -l` "$@"
63 ;;
64 esac
65}