1#!/bin/rc 2 3x=/tmp/mk$pid 4 5fn sigexit { rm -f $x } 6fn sigint { rm -f $x } 7 8tee $x < $1 | sed -e 's/\$\(([^)]*)\)([ :\/])/$\1\2/g 9 s/\$\(([^)]*)\)$/$\1/g 10 s/\$\(([^)]*)\)/${\1}/g 11 s/^ @/ / 12 /^ -/,/[^\\]$/{ 13 /[^\\]\$/s/$/; set -e/ 14 } 15 /^ -/s/ -/ set +e; / 16 s/:\&/:/ 17 s/\$% /$stem /g 18 s/\$%\./$stem\./g 19 s/\$%/${stem}/g 20 s/\$@([ ]|$)/$target\1/g 21 s/\$@/${target}/g 22 s/\$\^/${prereq}/g 23 s/\$\?/$newprereq/g' 24 25if(grep -s 'cd[ ]|make' < $x){ 26 { 27 echo 'Warning: recipes containing cd or make need attention.' 28 grep 'cd[ ]|make' < $x 29 } >[1=2] 30} 31