summaryrefslogtreecommitdiff
path: root/dmake/tests/misc-17
blob: 158b1157575242b6150cb0d320ef635682f7bafa (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
#!/bin/sh

# 19.11.2006 Volker Quetschke
# Check that a global .SEQUENTIAL attribute enforces MAXPROCESS=1.
# (issue 71704)

: ${DMAKEPROG:=dmake}
file1="mfile1.mk"
file2="my.inc"
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=-c

my.inc :
	@+echo "MYMAXPROCESS!:=\$(MAXPROCESS)" > my.inc

.INCLUDE : my.inc

all:
	@+echo "MYMAXPROCESS:\$(MYMAXPROCESS):"

EOT

output=`eval ${DMAKEPROG} -S -P2 -rf $file1 all`
result=$?

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