update dev300-m58
[ooovba.git] / dmake / tests / misc-19
blobaf824571219dcdb93a09c5868ec271700c9d0230
1 #!/bin/sh
3 # 02.09.2007 Volker Quetschke
4 # Check that temporary filenames are kept alive between recipe lines.
5 # (issue 67911)
7 : ${DMAKEPROG:=dmake}
8 file1="mfile1.mk"
9 tmpfiles="$file1"
11 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
13 # Remove files from prior failed run
14 rm -rf $tmpfiles
16 # Remember to quote variables in generated makefiles( $ -> \$ ).
17 cat > $file1 <<EOT
18 SHELL*:=/bin/sh
19 SHELLFLAGS*:=-ce
21 all :
22 @noop \$(assign TMPFILE:=\$(mktmp abcd))
23 @cat \$(TMPFILE)
25 EOT
27 output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
28 result1=$?
30 if test $result1 = 0 -a "$output1" = "abcd"; then
31 echo "OK"
32 else
33 echo "Wrong result: $output1"
34 echo
35 result1=1
36 fi
38 if test $result1 -eq 0 ; then
39 echo "Success - Cleaning up"
40 rm -rf $tmpfiles
41 exit
42 else
43 echo "Failure!"
44 exit 1