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	trap - EXIT
12}
13
14rm -f file.txt
15trap 'cleanup 0' EXIT
16trap 'cleanup 1' INT TERM HUP
17
18$EXEC scc make -f - <<'EOF' &
19file.txt:
20	@touch $@
21	@while : ; do sleep 1 ; done
22EOF
23pid=$!
24
25sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null &
26timer=$!
27
28while :
29do
30	if test -f file.txt
31	then
32		kill $pid
33		wait $pid
34		kill $timer
35		break
36	fi
37done
38
39! test -f file.txt