|
|
1.1 root 1: SYS=research
2: < $SYS.mk
3: JL=juke.a
4: X=allocate cold getstatus ioshelves iodr_sh lib load nlun warm
5: JLIB=${X:%=$JL(%.o)}
6: JSRC=${X:%=%.c}
7:
8: SL=scsi.a
9: X=s_$IO ge_sense s_volid s_pperror s_fixedstr s_longat s_xd
10: SLIB=${X:%=$SL(%.o)}
11:
12: SHL=scsish.a
13: GENERIC=ge_dev ge_inq ge_stop ge_start ge_capacity ge_display\
14: ge_reset ge_tur ge_scsi ge_readt ge_copy # ge_sense in $SL
15: SONY=so_dev so_inq so_alt so_config so_status so_eject so_rel so_set\
16: so_shelfside so_diskid so_internal so_media so_readid so_copy\
17: so_i0.tab so_i1.tab so_scsi.tab so_sense so_nesd.tab
18: WREN=wr_dev wr_inq wr_rmode wr_wmode wr_diag
19: X=$GENERIC $SONY $WREN
20: SHLIB=${X:%=$SHL(%.o)}
21:
22: all:V: jukebox scsish
23:
24: both:V: ../jukebox ../scsish
25:
26: ../%: %
27: cp $prereq $target
28:
29: jukebox: jukebox.o $JL $SHL $SL
30: $CC $CFLAGS -o $target $prereq $LDFLAGS
31:
32: scsish: scsish.o $SHL $SL
33: $CC $CFLAGS -o $target $prereq $LDFLAGS
34:
35: jpp:V:
36: pr mkfile juke.h scsi.h jukebox.c $JSRC | lp -ddp -n2
37:
38: poot:V: scsish
39: echo 'dev scsi
40: copy 4 0 10 5 0 1' | scsish
41:
42: scsi.cpio:V: inc/scsi.h
43: find * -print | sed -e '/\.[oa]$/d' -e '/\.cpio$/d' | cpio -oc > $target
44: inc/scsi.h:Pcmp -s: /usr/include/scsi.h
45: cp $prereq $target
46:
47:
48: # below is just magic; believe it.
49:
50: $JL(%.o):N: %.o
51: $JL:Q: $JLIB
52: names=`membername $newprereq`
53: ar rv $JL $names && rm $names
54: $RANLIB $JL
55:
56: $SL(%.o):N: %.o
57: $SL:Q: $SLIB
58: names=`membername $newprereq`
59: ar rv $SL $names && rm $names
60: $RANLIB $SL
61:
62: $SHL(%.o):N: %.o
63: $SHL:Q: $SHLIB
64: names=`membername $newprereq`
65: ar rv $SHL $names && rm $names
66: $RANLIB $SHL
67:
68: s_%.o: scsi/%.c
69: cd scsi; $CC $CFLAGS -c $stem.c && mv $stem.o ../$target
70: so_%.o: sony/%.c
71: cd sony; $CC $CFLAGS -c $stem.c && mv $stem.o ../$target
72: so_%.o: sony/fns.h
73: ge_%.o: generic/%.c
74: cd generic; $CC $CFLAGS -c $stem.c && mv $stem.o ../$target
75: ge_%.o: generic/fns.h
76: wr_%.o: wren/%.c
77: cd wren; $CC $CFLAGS -c $stem.c && mv $stem.o ../$target
78: wr_%.o: wren/fns.h
79: so_%.o wr_%.o ge_%.o: scsish.h scsi.h
80:
81: so_%.tab.o:Q: sony/%.tab
82: cd sony
83: echo generating $target
84: p=$stem.tab
85: awk -F' ' '
86: 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;
87: h["8"]=8;h["9"]=9;h["a"]=10;h["b"]=11;h["c"]=12;h["d"]=13;h["e"]=14;h["f"]=15;
88: }
89: function done( i){
90: for(i = 0; i < 256; i++) if(x[i]){
91: print "\t\"" x[i] "\","
92: x[i] = ""
93: } else printf "\t\"<#%x>\",\n", i
94: print "};"
95: }
96: function hex(n, i){
97: return(h[substr(n, 1, 1)]*16+h[substr(n, 2, 1)]);
98: }
99: NF == 1 { if(NR > 1) done(); print "char *" $1 "[] = {" }
100: NF > 1 { x[hex($1)] = $2; }
101: END { done(); }' < $p > $p.c && $CC $CFLAGS -c $p.c && mv $p.o ../$target
102: rm $p.c
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.