Annotation of researchv10dc/cmd/oworm/scsi/mkfile, revision 1.1

1.1     ! root        1: NAMES=y.tab lex inquiry init status disk sense start read diag capacity helptab\
        !             2:        media odump reset worm write copy search config testunit internal\
        !             3:        i0.tab i1.tab scsi.tab alternate readid diskid
        !             4: L=lib.a
        !             5: OBJ=`echo $NAMES|sed -e 's/[^ ][^ ]*/$L(&.o)/g'`
        !             6: CLIB=`echo $NAMES|sed -e 's/[^ ][^ ]*/O\/&.O/g'`
        !             7: CFLAGS=-g
        !             8: NPROC=2
        !             9: ALL=wmount scsish
        !            10: W=/usr/lib/worm
        !            11: INS=$W/wmount $W/scsish
        !            12: 
        !            13: install:V:     $INS
        !            14: 
        !            15: ship:  $INS
        !            16:        ship $newprereq && touch ship
        !            17: 
        !            18: $W/(wmount|scsish):R:  \\1
        !            19:        cp $prereq $target && strip -g $target && chmod 775 $target
        !            20: 
        !            21: wmount:        wmount.o $L
        !            22:        $CC $CFLAGS -o $target $prereq
        !            23: 
        !            24: scsish:        scsish.o $L
        !            25:        $CC $CFLAGS -o $target $prereq
        !            26: 
        !            27: clean:V:
        !            28:        rm -f O/* $ALL *.o
        !            29: 
        !            30: %.tab.c:Q:     %.tab
        !            31:        echo generating $target
        !            32:        p=$stem.tab
        !            33:        awk -F' ' '
        !            34:        BEGIN   { h["0"]=0;h["1"]=1;h["2"]=2;h["3"]=3;h["4"]=4;h["5"]=5;h["6"]=6;h["7"]=7;
        !            35:                h["8"]=8;h["9"]=9;h["a"]=10;h["b"]=11;h["c"]=12;h["d"]=13;h["e"]=14;h["f"]=15;
        !            36:                }
        !            37:        function done(  i){
        !            38:                for(i = 0; i < 256; i++) if(x[i]){
        !            39:                                print "\t\"" x[i] "\","
        !            40:                                x[i] = ""
        !            41:                        } else printf "\t\"<#%x>\",\n", i
        !            42:                print "};"
        !            43:        }
        !            44:        function hex(n, i){
        !            45:                return(h[substr(n, 1, 1)]*16+h[substr(n, 2, 1)]);
        !            46:        }
        !            47:        NF == 1 { if(NR > 1) done(); print "char *" $1 "[] = {" }
        !            48:        NF > 1  { x[hex($1)] = $2; }
        !            49:        END     { done(); }' < $p > $p.c
        !            50: 
        !            51: %.o O/%.O:     scsi.h
        !            52: 
        !            53: cyntax:V:      O/wmount O/scsish
        !            54: 
        !            55: O/wmount:      O/wmount.O $CLIB
        !            56:        cyntax $prereq && touch $target
        !            57: 
        !            58: O/scsish:      O/scsish.O $CLIB
        !            59:        cyntax $prereq && touch $target
        !            60: 
        !            61: pp:
        !            62:        smalllp [a-w]*.h [a-w]*.[cy]
        !            63: 
        !            64: y.tab.c y.tab.h:       gram.y
        !            65:        yacc -d -D gram.y
        !            66:        ed - y.tab.c <<!
        !            67:        ,s/printf/print/
        !            68:        w
        !            69:        q
        !            70:        !
        !            71: 
        !            72: x.tab.h:Q:     y.tab.h
        !            73:        cmp -s x.tab.h y.tab.h || cp y.tab.h x.tab.h
        !            74: 
        !            75: y.tab.o lex.o: x.tab.h
        !            76: 
        !            77: lex.o: lex.l
        !            78:        lex -t lex.l > lex.c
        !            79:        ed - lex.c <<!
        !            80:        ,s/fprintf(yyout/fprint(2/
        !            81:        w
        !            82:        q
        !            83:        !
        !            84:        $CC $CFLAGS -c lex.c && rm lex.c
        !            85: 
        !            86: helptab.c:QD:  gram.y
        !            87:        ( echo 'char *helpstrs[] = {'
        !            88:        sed -n -e '1,/^line/d
        !            89:        /^drive/,$d
        !            90:        /::/s/::.*/",/
        !            91:        /:/s/.*:/       "/p
        !            92:        /|/s/  *{.*/",/
        !            93:        /|/s/.*|        */      "/p' < gram.y
        !            94:        echo '  0'
        !            95:        echo '};'
        !            96:        ) > $target
        !            97: 
        !            98: $L(%.o):N:     %.o
        !            99: $L:Q:  $OBJ
        !           100:        names=`membername $newprereq`
        !           101:        ar rv $L $names && rm $names
        !           102:        ranlib $L
        !           103: 
        !           104: O/%.O: %.c
        !           105:        cyntax -c $CFLAGS $stem.c && mv $stem.O O
        !           106: 
        !           107: O/y.tab.O:     y.tab.c
        !           108:        cyntax -c -Vyyerror:1 y.tab.c && mv y.tab.O O
        !           109: 
        !           110: O/lex.O:       lex.l
        !           111:        > /tmp/lex.c
        !           112:        cyntax -c /tmp/lex.c && mv /tmp/lex.O O
        !           113: 
        !           114: spit:  scsish
        !           115:        push spit $newprereq . && touch $target
        !           116: 
        !           117: scsi.out:      scsi.ms
        !           118:        tbl scsi.ms | troff -Tpost > $target
        !           119: 
        !           120: scsi.lp:       scsi.out
        !           121:        lp -dpsu $prereq
        !           122: 
        !           123: scsi.man:V:
        !           124:        troff -Tpost -man /usr/man/man1/worm.1 /usr/man/man?/scsi*.? | lp -dpsu

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.