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 -f - test.txt <<'EOF' &
18.PRECIOUS: test.txt
19
20test.txt:
21	@touch $@
22	@while : ; do sleep 1 ; done
23EOF
24pid=$!
25
26sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null &
27timer=$!
28
29while :
30do
31	if test -f test.txt
32	then
33		kill $pid
34		wait $pid
35		kill $timer
36		break
37	fi
38done
39
40test -f test.txt