Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / dmake / tests / targets-29
blob004553eb93d55ab102e65f0c927e916b442a9aef
1 #!/bin/sh
3 # 24.09.2007 Volker Quetschke
4 # Check that the .REMOVE target does not crash dmake in parallel builds.
5 # (issue 80012)
7 : ${DMAKEPROG:=dmake}
8 file1="mfile1.mk"
9 file2="aaa.aaa"
10 file3="aaa.bbb"
11 file4="aaa.ccc"
12 tmpfiles="$file1 $file2 $file3 $file4"
14 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
16 # Remove files from prior failed run
17 rm -rf $tmpfiles
19 # Remember to quote variables in generated makefiles( $ -> \$ ).
20 cat > $file1 <<EOT
21 SHELL*:=/bin/sh
22 SHELLFLAGS*:=-ce
24 .REMOVE :; @echo remove intermediate target: \$<
26 %.aaa : %.bbb
27 @echo built \$@
29 %.bbb : %.ccc
30 @sleep 1
31 @echo built \$@
33 %.ccc :
34 @echo built \$@
36 all : aaa.aaa
37 @echo Done
39 EOT
41 output1=`eval ${DMAKEPROG} -P2 -rf $file1 2>&1`
42 result1=$?
44 if test $result1 -ne 0; then
45 echo "Failure! Remove the corefile!"
46 echo "Output: $output1"
47 result1=1
48 else
49 echo "OK"
50 fi
52 if test $result1 -eq 0 ; then
53 echo "Success - Cleaning up"
54 rm -rf $tmpfiles
55 exit
56 else
57 echo "Failure!"
58 exit 1