Update ooo320-m1
[ooovba.git] / dmake / tests / targets-26
blob10ac0d43f2b75d96cab223eee9ae69b1baaea383
1 #!/bin/sh
3 # 10.08.2007 Volker Quetschke
4 # Check that the .PHONY attribute works with %-targets.
5 # (issue 66751)
7 : ${DMAKEPROG:=dmake}
8 file1="mfile1.mk"
9 file2="phonyfile.a"
10 file3="phonyfile.b"
11 tmpfiles="$file1 $file2 $file3"
13 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
15 # Remove files from prior failed run
16 rm -rf $tmpfiles
18 # Remember to quote variables in generated makefiles( $ -> \$ ).
19 cat > $file1 <<EOT
20 SHELL*:=/bin/sh
21 SHELLFLAGS*:=-ce
23 %.a : %.b
24 @sleep 1
25 @touch \$@
26 @+printf " and \$@.\n"
28 #%.b :
29 %.b .PHONY :
30 @touch \$@
31 @+printf "Build \$@"
33 EOT
35 touch phonyfile.a phonyfile.b
36 # Avoid that phonyfile.a has the same time stamp as phonyfile.b after
37 # that has been rebuild.
38 sleep 1
40 output1=`eval ${DMAKEPROG} -rf $file1 phonyfile.a 2>&1 `
41 result1=$?
43 if test "$output1" != "Build phonyfile.b and phonyfile.a."; then
44 echo "Wrong result: $output1"
45 result1=1
46 else
47 echo "OK"
48 fi
50 if test $result1 -eq 0 ; then
51 echo "Success - Cleaning up"
52 rm -rf $tmpfiles
53 exit
54 else
55 echo "Failure!"
56 exit 1