File: make-j

package info (click to toggle)
distcc 2.18.3-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,188 kB
  • ctags: 1,536
  • sloc: ansic: 12,829; sh: 3,183; python: 1,313; makefile: 493
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+"$@"}