scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#!/bin/sh
 2
 3cleanup()
 4{
 5	rm -f test.txt
 6	kill -KILL $pid 2>/dev/null
 7	if test $1 -ne 0
 8	then
 9		kill -KILL $$
10	fi
11}
12
13rm -f file.txt
14trap 'cleanup 0' EXIT
15trap 'cleanup 1' INT TERM HUP
16
17$EXEC scc make -nf - test.txt <<'EOF' &
18test.txt:
19	@+touch $@
20	+@while : ; do sleep 1 ; done
21EOF
22pid=$!
23
24sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null &
25timer=$!
26
27while :
28do
29	if test -f test.txt
30	then
31		kill $pid
32		wait $pid
33		kill $timer
34		break
35	fi
36done
37
38test -f test.txt