|
|
1.1 ! root 1: CPP=/lib/cpp ! 2: RELSRC= (source file area) ! 3: DESTDIR= ("make" binaries output area) ! 4: COMP=${RELSRC}/lib/ccom ! 5: OPT=${RELSRC}/lib/c2 ! 6: LIST=/usr/bin/alist ! 7: ASM=/bin/as ! 8: LD=/bin/ld ! 9: LIB=${DESTDIR}/lib ! 10: CLIB=${DESTDIR}/lib/libc.a ! 11: START=$LIB/crt0.o ! 12: TMP=/tmp/cct$$ ! 13: L= ! 14: P= ! 15: ecode=0 ! 16: noasm=0 ! 17: conly=0 ! 18: names=0 ! 19: ppopts=-I${DESTDIR}/usr/include ! 20: ! 21: trap "rm -f $TMP.?; exit 2" 1 2 3 ! 22: ! 23: for i in $* ! 24: do ! 25: case $i in ! 26: *.c) case $names in ! 27: 0) names=1 ;; ! 28: 1) names=2 ;; ! 29: esac ;; ! 30: esac ! 31: done ! 32: for i in $* ! 33: do ! 34: case $i in ! 35: -O) ! 36: opt=$OPT ! 37: ;; ! 38: -c) ! 39: conly=1 ! 40: ;; ! 41: -L) ! 42: L=l ! 43: opt= ! 44: cflag="$cflag -Xg" ! 45: ;; ! 46: -P|-R|-d*) ! 47: asflg="$asflg $i" ! 48: ;; ! 49: -S) ! 50: noasm=1 ! 51: conly=1 ! 52: ;; ! 53: -I*|-[DU]*|-C) ! 54: ppopts=$ppopts\ $i ! 55: ;; ! 56: -E) ! 57: exflg=E ! 58: noasm=1 ! 59: ;; ! 60: -g) ! 61: cflag="$cflag -Xg" ! 62: ;; ! 63: -w) ! 64: cflag="$cflag $i" ! 65: ;; ! 66: -p) ! 67: cflag="$cflag -XP" ! 68: START=$LIB/mcrt0.o ! 69: CLIB=${DESTDIR}/usr/lib/libc_p.a ! 70: ;; ! 71: *.c) ! 72: f=$i ! 73: i=`basename $i .c` ! 74: case $names in ! 75: 1) del=$i.o ;; ! 76: *) echo $f: 1>&2 ;; ! 77: esac ! 78: case $exflg in ! 79: E) $CPP $ppopts $f - ; exit 0; ! 80: esac ! 81: $CPP $ppopts $f | $COMP $cflag >$TMP.a ! 82: case $? in ! 83: 0) ! 84: case $L in ! 85: l) $LIST $f $TMP.a $TMP.b; mv $TMP.b $TMP.a;; ! 86: esac ! 87: case "$opt" in ! 88: $OPT) ! 89: $opt $TMP.a $TMP.b ! 90: case $? in ! 91: 0) ! 92: mv $TMP.b $TMP.a ;; ! 93: *) ! 94: rm -f $TMP.b ;; ! 95: esac ! 96: ;; ! 97: esac ! 98: case $noasm in ! 99: 0) ! 100: asflg="$asflg -o $i.o" ! 101: $ASM $asflg $TMP.a ! 102: case $? in ! 103: 0) ! 104: ldarg="$ldarg $i.o" ;; ! 105: *) ! 106: rm -f $i.o ! 107: ecode=3 ;; ! 108: esac ! 109: rm -f $TMP.a ! 110: ;; ! 111: 1) ! 112: mv $TMP.a $i.s ! 113: ;; ! 114: esac ! 115: ;; ! 116: *) ! 117: rm -f $TMP.a ! 118: ecode=2 ! 119: ;; ! 120: esac ! 121: ;; ! 122: *.s) ! 123: case $noasm in ! 124: 0) ! 125: f=$i ! 126: i=`basename $i .s` ! 127: asflg="$asflg -o $i.o" ! 128: $ASM $asflg $f ! 129: case $? in ! 130: 0) ! 131: ldarg="$ldarg $i.o" ;; ! 132: *) ! 133: rm -f $i.o ! 134: ecode=4 ;; ! 135: esac ! 136: rm -f $TMP.a ! 137: ;; ! 138: esac ! 139: ;; ! 140: -l*) ! 141: j=`echo $i | sed s/-l//` ! 142: ldarg="$ldarg ${DESTDIR}/usr/lib/lib$j.a" ! 143: ;; ! 144: *) ! 145: ldarg="$ldarg $i" ! 146: ;; ! 147: esac ! 148: done ! 149: case $conly in ! 150: 0) ! 151: case $ecode in ! 152: 0) ! 153: $LD -X $START $ldarg $CLIB ! 154: case $? in ! 155: 0) ;; ! 156: *) ! 157: ecode=5 ;; ! 158: esac ! 159: rm -f $del ! 160: ;; ! 161: esac ! 162: ;; ! 163: esac ! 164: exit $ecode
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.