Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / dmake / tests / targets-13
blob702a9b0a10ca041758b4b8c32e8e9ad2fa433efc
1 #!/bin/sh
3 # 16.07.2006 Volker Quetschke
4 # Check that dmake warns if a previously unset macro (i.e. it is
5 # assumed to be empty) is used and later set to a different value.
6 # (issue 67166)
8 : ${DMAKEPROG:=dmake}
9 file1="mfile1.mk"
10 tmpfiles="$file1"
12 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
14 # Remove files from prior failed run
15 rm -rf $tmpfiles
17 # Remember to quote variables in generated makefiles( $ -> \$ ).
18 # Check that we issue a warning.
19 cat > $file1 <<EOT
20 SHELL*:=/bin/sh
21 SHELLFLAGS*:=-ce
23 all: \$(NEWDEP)
24 @+echo all
26 NEWDEP=my_dependency
27 EOT
29 output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
30 result1=$?
32 if echo $output1 | grep 'Warning: -- Macro .* redefined after use' > /dev/null 2>&1 ; then
33 dummy=1
34 # OK
35 else
36 echo "Test 1: Wrong result: $output1"
37 echo
38 result1=1
41 if test $result1 -eq 0 ; then
42 echo "Success - Cleaning up"
43 rm -rf $tmpfiles
44 result=0
45 else
46 echo "Failure! dmake failed to issue a warning."
47 result=1
49 exit $result