Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / dmake / tests / misc-9
blobc3f8aad1ab392f3896429f36c997d4832521448e
1 #!/bin/sh
3 # 01.03.2006 Volker Quetschke
4 # If a dependency is added to a target after it is already build as an
5 # indered .INCLUDE makefile the new dependency can be lost in parallel
6 # builds.
7 # (issue 61969)
9 : ${DMAKEPROG:=dmake}
10 file1="mfile1.mk"
11 file2="mytarget.dpcc"
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 cat > $file1 <<EOT
21 SHELL*:=/bin/sh
22 SHELLFLAGS*:=-ce
24 %.dpcc :
25 @sleep 1
26 # The following line adds a dependency to %.obj when the %.dpcc is included
27 @+echo \$@ : \$(@:b).obj > \$@
29 # This has to be build if mytarget.dpcc is included and is requested
30 # as a target
31 # Adding the wait makes sure that the unpatched dmake is ended before the
32 # next recipe line is started, therefore loosing it.
33 %.obj :
34 @sleep 1
35 @echo making: \$@
37 .INCLUDE : mytarget.dpcc
39 # Make this the main target
40 mytarget.dpcc :
42 EOT
44 output=`eval ${DMAKEPROG} -r -P2 -f $file1`
45 result=$?
47 if test "$output" != "making: mytarget.obj"; then
48 result=1
49 fi
51 test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
52 test $result -ne 0 && echo "Failure! Recipe line got lost."
53 exit $result