File: make-j

package info (click to toggle)
distcc 3.1-6.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,568 kB
  • ctags: 3,009
  • sloc: ansic: 19,204; python: 6,177; sh: 4,023; makefile: 862; perl: 52
file content (21 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh

# make-j script from Alexandre Oliva <aoliva@redhat.com> for use with distcc

# Tests which machines are up, and runs Make with concurrency set
# appropriately.

hostlist=$DISTCC_HOSTS
distcc_port=4200
DISTCC_HOSTS=
count=0
for h in $hostlist; do
  echo trying $h... >&2
  if test "x$h" = xlocalhost || nc -z $h $distcc_port; then
    echo added $h... >&2
    DISTCC_HOSTS=`echo $DISTCC_HOSTS $h` # remove leading blank
    count=`expr $count + 1`
  fi
done
export DISTCC_HOSTS
exec make -j $count ${1+"$@"}