update dev300-m58
[ooovba.git] / dmake / tests / misc-2
blob06748dd980371f7f1394b36691c8ab74cad818c1
1 #!/bin/sh
3 # 01.09.2005 Volker Quetschke
4 # Tests if dmake can work with makefiles with DOS lineendings.
5 # (issue 52238)
7 : ${DMAKEPROG:=dmake}
8 file1="mymakefile.mk"
9 file2="mymakefile_dos.mk"
10 tmpfiles="$file1 $file2"
12 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
14 trap 'rm -rf $tmpfiles' 1 2 3 15
16 # Remember to quote variables in generated makefiles( $ -> \$ ).
17 cat > $file1 <<EOT
18 # Testing continuation char in recipes
19 SHELL*:=/bin/sh
20 SHELLFLAGS*:=-ce
22 .NOTABS !:= yes
24 all:
26 echo aaa
28 EOT
30 #more compatible version of: unix2dos $file1
31 : ${AWK:=awk}
32 #$AWK 'sub("$", "\r")' $file1 > $file2
33 $AWK '{print $0"\r"}' $file1 > $file2
35 ${DMAKEPROG} -r -f $file2
36 result=$?
38 test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
39 test $result -ne 0 && echo "Failure!"
40 exit $result