Andrew Rossignol | c5ba98d | 2017-02-28 18:31:01 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Quit if any command produces an error. |
| 4 | set -e |
| 5 | |
| 6 | # Build and run the CHRE simulator. |
Andrew Rossignol | b97643e | 2017-10-10 16:22:52 -0700 | [diff] [blame] | 7 | CHRE_HOST_OS=`uname` |
| 8 | if [[ $CHRE_HOST_OS == 'Darwin' ]]; then |
| 9 | JOB_COUNT=`sysctl -n hw.ncpu` |
| 10 | else |
Andrew Rossignol | 879b224 | 2017-05-01 11:22:01 -0700 | [diff] [blame] | 11 | JOB_COUNT=$((`grep -c ^processor /proc/cpuinfo`)) |
Andrew Rossignol | b97643e | 2017-10-10 16:22:52 -0700 | [diff] [blame] | 12 | fi |
Andrew Rossignol | 879b224 | 2017-05-01 11:22:01 -0700 | [diff] [blame] | 13 | |
Andrew Rossignol | 9904d2c | 2017-06-05 14:54:42 -0700 | [diff] [blame] | 14 | # Export the variant Makefile. |
| 15 | export CHRE_VARIANT_MK_INCLUDES=variant/simulator/variant.mk |
| 16 | |
Andrew Rossignol | 879b224 | 2017-05-01 11:22:01 -0700 | [diff] [blame] | 17 | make google_x86_linux_debug -j$JOB_COUNT |
Andrew Rossignol | fc4d354 | 2017-08-29 16:16:33 -0700 | [diff] [blame] | 18 | ./out/google_x86_linux_debug/libchre ${@:1} |