summaryrefslogtreecommitdiff
path: root/dmake/tests/misc-16
blob: 2e234d3d15a17fe9159fb298cda8e0716b6d26ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

# 17.11.2006 Volker Quetschke
# Check that parallel builds $(shell ...) only waits its own target and
# not for all previous recipe lines.
# (issue 61856)

: ${DMAKEPROG:=dmake}
file1="mfile1.mk"
file2="mytarget.dpcc"
tmpfiles="$file1 $file2"

trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15

# Remove files from prior failed run
rm -rf $tmpfiles

# Remember to quote variables in generated makefiles( $ -> \$ ).
cat > $file1 <<EOT
SHELL*:=/bin/sh 
SHELLFLAGS*:=-ce

all : all1 all2
	@+echo all

all1 :
	@+printf "1"
	@+sleep 2
	@+printf "4"

all2 :
	@+sleep 1
	@+printf "2"
	@+printf "\$(shell @+echo "3")"

EOT

output=`eval ${DMAKEPROG} -r -P2 -f $file1`
result=$?

if test "$output" != "1234all"; then
  echo "Wrong result: $output - expecting: 1234all"
  result=1
fi 
 
test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
test $result -ne 0 && echo "Failure!"
exit $result