2006-04-20 06:17:40 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# 01.06.2005 Volker Quetschke
|
|
|
|
# Basic test of dmake existence and the needed infrastructure.
|
|
|
|
|
|
|
|
: ${DMAKEPROG:=dmake}
|
|
|
|
file1="mymakefile.mk"
|
|
|
|
file2="mytestfile"
|
|
|
|
tmpfiles="$file1 $file2"
|
|
|
|
|
|
|
|
trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
|
|
|
|
|
|
|
|
# Test for "test" programm in path
|
|
|
|
which test > /dev/null || { echo "Failure! \"test\" program missing." ; exit 1; }
|
|
|
|
echo "Found \"test\" program."
|
2006-06-29 05:26:48 -05:00
|
|
|
test=`which test`
|
2006-04-20 06:17:40 -05:00
|
|
|
|
|
|
|
# Test for "echo" programm in path
|
|
|
|
which echo > /dev/null || { echo "Failure! \"echo\" program missing." ; exit 1; }
|
|
|
|
echo "Found \"echo\" program."
|
|
|
|
|
|
|
|
# Test for dmake program
|
2006-06-29 05:26:48 -05:00
|
|
|
${test} -x "${DMAKEPROG}" || { echo "Failure! \"dmake\" is missing." ; exit 1; }
|
2006-04-20 06:17:40 -05:00
|
|
|
echo "Found \"dmake\" program."
|
|
|
|
|
|
|
|
# Remember to quote variables in generated makefiles( $ -> \$ ).
|
|
|
|
cat > $file1 <<EOT
|
|
|
|
# simple makefile
|
|
|
|
${file2}:
|
|
|
|
@echo 'Generating ${file2}'
|
|
|
|
touch ${file2}
|
|
|
|
EOT
|
|
|
|
|
|
|
|
${DMAKEPROG} -r -f $file1
|
|
|
|
result=$?
|
2006-06-29 05:26:48 -05:00
|
|
|
if ${test} ! -e "${file2}"; then
|
2006-04-20 06:17:40 -05:00
|
|
|
echo "File missing"
|
|
|
|
result=1
|
|
|
|
fi
|
|
|
|
|
2006-06-29 05:26:48 -05:00
|
|
|
${test} $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
|
|
|
|
${test} $result -ne 0 && echo "Failure!"
|
|
|
|
exit $result
|
|
|
|
|