merge the formfield patch from ooo-build
[ooovba.git] / dmake / tests / targets-20
blob64a6a5b06ad0cac6eb05b3892a53b1d8e68db4be
1 #!/bin/sh
3 # 12.07.2007 Volker Quetschke
4 # Make sure that intermediate targets get created. BUG: If an intermediate
5 # %-target does not exist it inherits the time stamp of it's parent and
6 # doesn not get made.
7 # Recipe: Create ptarget.c and then (newer) ptarget.a but ptarget.b did
8 # not get made.
9 # (issue 69462)
11 : ${DMAKEPROG:=dmake}
12 file1="mfile1.mk"
13 file2="ptarget.a"
14 file3="ptarget.b"
15 file4="ptarget.c"
16 tmpfiles="$file1 $file2 $file3 $file4"
18 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
20 # Remove files from prior failed run
21 rm -rf $tmpfiles
23 # Create test environment
24 touch ptarget.c
25 touch ptarget.a
27 # Remember to quote variables in generated makefiles( $ -> \$ ).
28 cat > $file1 <<EOT
29 SHELL*:=/bin/sh
30 SHELLFLAGS*:=-ce
32 %.a : %.b
33 @cp \$< \$@
35 %.b .PRECIOUS : %.c
36 @cp \$< \$@
37 @+printf "OK"
39 %.c :
40 @touch \$@
42 all : ptarget.a
43 @+echo "done"
46 EOT
48 output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
49 result1=$?
51 if test "$output1" != "OKdone"; then
52 echo "Wrong result: $output1"
53 result1=1
54 else
55 echo "OK"
56 fi
58 if test $result1 -eq 0 ; then
59 echo "Success - Cleaning up"
60 rm -rf $tmpfiles
61 exit
62 else
63 echo "Failure!"
64 exit 1