update dev300-m58
[ooovba.git] / dmake / tests / targets-27
blob3ad33b4c20ffadd591aca0bd991696c68cb35c7c
1 #!/bin/sh
3 # 15.08.2007 Volker Quetschke
4 # Another check that the .PHONY attribute works with %-targets. This test
5 # was still failing after issue 66751.
6 # (issue 80687)
8 : ${DMAKEPROG:=dmake}
9 file1="mfile1.mk"
10 file2="aa.x"
11 file3="aa.y"
12 file4="aa.z"
13 tmpfiles="$file1 $file2 $file3 $file4"
15 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
17 # Remove files from prior failed run
18 rm -rf $tmpfiles
20 # Remember to quote variables in generated makefiles( $ -> \$ ).
21 cat > $file1 <<EOT
22 SHELL*:=/bin/sh
23 SHELLFLAGS*:=-ce
25 %.x : %.y
26 @sleep 1
27 @+printf " and \$@.\n"
28 @touch \$@
30 aa.y .PHONY : aa.z
31 @+printf "Build \$@"
32 @touch \$@
34 EOT
36 # Create test environment
37 touch aa.z; sleep 1; touch aa.y ; sleep 1 ;touch aa.x
38 # Avoid that aa.x has the same time stamp as aa.y after
39 # that has been rebuild.
40 sleep 1
42 output1=`eval ${DMAKEPROG} -rf $file1 aa.x 2>&1 `
43 result1=$?
45 if test "$output1" != "Build aa.y and aa.x."; then
46 echo "Wrong result: $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