buildtrace (859B)
1 #!/bin/sh 2 3 build() 4 { 5 cd cddl/lib/libdtrace && make -j$(sysctl -n hw.ncpu) all && cd - 6 cd cddl/usr.sbin/dtrace && make -j$(sysctl -n hw.ncpu) all && cd - 7 cd sys/modules/dtrace/ && make -j$(sysctl -n hw.ncpu) all && cd - 8 } 9 10 clean() 11 { 12 cd cddl/lib/libdtrace && make clean cleandepend && cd - 13 cd cddl/usr.sbin/dtrace && make clean cleandepend && cd - 14 cd sys/modules/dtrace/ && make clean cleandepend && cd - 15 } 16 17 install() 18 { 19 kldunload dtraceall 20 cd cddl/lib/libdtrace && make -j$(sysctl -n hw.ncpu) install && cd - 21 cd cddl/usr.sbin/dtrace && make -j$(sysctl -n hw.ncpu) install && cd - 22 cd sys/modules/dtrace/ && make -j$(sysctl -n hw.ncpu) install \ 23 KMODDIR=/boot/kernel && cd - 24 kldload dtraceall 25 } 26 27 cd /usr/src 28 while getopts "bci" arg; do 29 case "${arg}" in 30 b) build ;; 31 c) clean ;; 32 i) install ;; 33 *) echo "usage: ${0##*/} [bci]" 1>&2; exit 1 34 esac 35 done