update dev300-m58
[ooovba.git] / dmake / tests / targets-24
blob98c7603980fa0e20cfa6d7d9137837842539ee5c
1 #!/bin/sh
3 # 03.08.2007 Volker Quetschke
4 # Check that ambigous %-target are found.
5 # prerequisite.
6 # (issue 80144)
8 : ${DMAKEPROG:=dmake}
9 file1="mfile1.mk"
10 file2="aaa.aaa"
11 tmpfiles="$file1 $file2"
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 # Create test environment
19 touch aaa.aaa
21 # Remember to quote variables in generated makefiles( $ -> \$ ).
22 cat > $file1 <<EOT
23 SHELL*:=/bin/sh
24 SHELLFLAGS*:=-ce
26 .REMOVE : ; @echo remove \$<
28 %.a : %.b
29 @echo Blah
31 %.a : xx.b
32 @echo Blue
34 %.b :
35 touch $@
37 all : xx.a
38 @noop all
40 EOT
42 output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
43 result1=$?
45 if echo $output1 | grep ': -- Ambiguous inference chains for target' > /dev/null 2>&1 ; then
46 echo "OK"
47 else
48 echo "Test 1: Wrong result: $output1"
49 echo
50 result1=0
53 # Errorcode in $result1 means successfull test
54 if test $result1 -ne 0 ; then
55 echo "Success - Cleaning up"
56 rm -rf $tmpfiles
57 exit
58 else
59 echo "Failure!"
60 exit 1