1if test -r $1=x
2then
3  dependon $1=x
4  libs=`grep '\.lib *$' "$1=x"`
5  libscat=''
6  for i in $libs
7  do
8    libscat="$libscat "'`'"cat $i"'`'
9  done
10  objs=`grep -v '\.lib *$' "$1=x"`
11  dependon load $1.o $objs $libs
12  directtarget
13  formake ./load $1 $objs "$libscat"
14  eval ./load $1 $objs $libscat
15  exit 0
16fi
17
18if test -r $1=s
19then
20  dependon $1=s warn-auto.sh $1.sh conf-home
21  formake cat warn-auto.sh $1.sh '\'
22  formake '| sed s}HOME}"`head -1 conf-home`"}g \'
23  formake '>' $1
24  formake chmod 755 $1
25  cat warn-auto.sh $1.sh | sed s}HOME}"`head -1 conf-home`"}g
26  chmod 755 $3
27  exit 0
28fi
29
30case "$1" in
31  shar)
32    dependon FILES `cat FILES`
33    formake 'shar -m `cat FILES` > shar'
34    formake 'chmod 400 shar'
35    shar -m `cat FILES`
36    chmod 400 $3
37    ;;
38  compile|load|makelib)
39    dependon make-$1 warn-auto.sh systype
40    formake "( cat warn-auto.sh; ./make-$1 "'"`cat systype`"'" ) > $1"
41    formake "chmod 755 $1"
42    cat warn-auto.sh
43    ./make-$1 "`cat systype`"
44    chmod 755 $3
45    ;;
46  make-compile|make-load|make-makelib)
47    dependon $1.sh auto-ccld.sh
48    formake "cat auto-ccld.sh $1.sh > $1"
49    formake "chmod 755 $1"
50    cat auto-ccld.sh $1.sh
51    chmod 755 $3
52    ;;
53  systype)
54    dependon find-systype trycpp.c
55    formake './find-systype > systype'
56    ./find-systype
57    ;;
58  find-systype)
59    dependon find-systype.sh auto-ccld.sh
60    formake 'cat auto-ccld.sh find-systype.sh > find-systype'
61    formake 'chmod 755 find-systype'
62    cat auto-ccld.sh find-systype.sh
63    chmod 755 $3
64    ;;
65  auto-ccld.sh)
66    dependon conf-cc conf-ld warn-auto.sh
67    formake '( cat warn-auto.sh; \'
68    formake 'echo CC=\'\''`head -1 conf-cc`\'\''; \'
69    formake 'echo LD=\'\''`head -1 conf-ld`\'\'' \'
70    formake ') > auto-ccld.sh'
71    cat warn-auto.sh
72    echo CC=\'`head -1 conf-cc`\'
73    echo LD=\'`head -1 conf-ld`\'
74    ;;
75  *)
76    nosuchtarget
77    ;;
78esac
79