update dev300-m58
[ooovba.git] / dmake / tests / targets-4
blob2bc66d9ec519961c864573f7ecb5f1baea73d417
1 #!/bin/sh
3 # 03.06.2006 Volker Quetschke
4 # Check that a warning is issued for special or meta targets with
5 # empty recipes.
6 # (issue 65360) - Well, the issue is talking about slightly a different
7 # issue but a related patch was committed with this issue reference.
9 : ${DMAKEPROG:=dmake}
10 file1="mfile1.mk"
11 file2="mfile2.mk"
12 tmpfiles="$file1 $file2"
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 # Testcase 1 - AUGMAKE meta targets
21 cat > $file1 <<EOT
22 SHELL*:=/bin/sh
23 SHELLFLAGS*:=-ce
25 .NIX :
27 something :
28 +echo "A target."
30 EOT
32 # Testcase 2 - Percent targets
33 cat > $file2 <<EOT
34 SHELL*:=/bin/sh
35 SHELLFLAGS*:=-ce
37 %.a : %.b
39 something :
40 +echo "A target."
42 EOT
44 output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
45 result1=$?
46 output2=`eval ${DMAKEPROG} -r -f $file2 2>&1 `
47 result2=$?
49 if echo $output1 | grep -v 'Warning: -- Empty recipe' > /dev/null 2>&1 ; then
50 echo "Test 1: Wrong result: $output1"
51 echo
52 result1=1
55 if echo $output2 | grep -v 'Warning: -- Empty recipe' > /dev/null 2>&1 ; then
56 echo "Test 2: Wrong result: $output2"
57 echo
58 result1=1
61 if test $result1 -eq 0 -a $result2 -eq 0; then
62 echo "Success - Cleaning up"
63 rm -rf $tmpfiles
64 exit
65 result=0
66 else
67 echo "Failure!"
68 result=1
70 exit $result