make 730boot with 730boot.o
[unix-history] / usr / src / sys / vax / stand / Makefile
CommitLineData
bd2f236f 1# Makefile 4.34 83/08/11
e05d064d 2
b5d17f4d 3DESTDIR=/
faf25b5b 4CFLAGS= -O -DSTANDALONE ${COPTS}
b5d17f4d 5COPTS= -DVAX780 -DVAX750 -DVAX730
6fe57a65 6730OPTS=-O -DSTANDALONE -DVAX730
bd5ddd44 7RELOC= 70000
c140a385 8SRCS= sys.c conf.c prf.c machdep.c \
3b9afe4f
SL
9 autoconf.c hp.c hpmaptype.c ht.c idc.c mba.c mt.c rk.c \
10 rl.c tm.c ts.c \
11 up.c upmaptype.c uba.c uda.c ut.c \
6fe57a65 12 drtest.c format.c up.old.c hp.old.c
3b9afe4f
SL
13DRIVERS=autoconf.o hp.o hpmaptype.o ht.o idc.o mba.o mt.o \
14 rk.o rl.o tm.o ts.o \
15 up.o upmaptype.o uba.o uda.o ut.o
6fe57a65
SL
16# These drivers don't have ecc correction and bad sector forwarding;
17# they are placed in the file system boot area for 750's. If your
18# root has bad sectors you can try and squeeze the newer drivers in...
19ODRIVERS=hp.old.o up.old.o
e05d064d 20
0839bdeb 21ALL= /usr/lib/libsa.a srt0.o boot tpboot copy tpcopy \
76780d43 22 format tpformat drtest boothp boothk bootup bootra bootrl \
d5e22e3a 23 730boot 730copy 730format 730drtest
e05d064d 24
9e3a67c5
BJ
25all: ${ALL}
26
6fe57a65 27/usr/lib/libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o dkbad.o
b5d17f4d
BJ
28 ar crv /usr/lib/libsa.a $?
29 ranlib /usr/lib/libsa.a
e05d064d 30
6fe57a65 31${ODRIVERS} ${DRIVERS}: savax.h
e05d064d 32 cc -c -S ${COPTS} $*.c
c140a385
BJ
33 /lib/c2 -i $*.s | as -o $*.o
34 rm $*.s
e05d064d 35
6fe57a65
SL
36dkbad.o: ../vax/dkbad.c
37 ${CC} -c ${CFLAGS} ../vax/dkbad.c
38
b5d17f4d 39# startups
e05d064d 40
a031a31b 41srt0.o: srt0.c ../vax/mtpr.h ../vax/cpu.h
b5d17f4d 42 cc -E -DRELOC=0x${RELOC} ${COPTS} srt0.c | as -o srt0.o
faf25b5b 43
a031a31b 44tpsrt0.o: srt0.c ../vax/mtpr.h ../vax/cpu.h
b5d17f4d 45 cc -E -DRELOC=0x${RELOC} -DTP ${COPTS} srt0.c | as -o tpsrt0.o
35e7506c 46
a031a31b 47relsrt0.o: srt0.c ../vax/mtpr.h ../vax/cpu.h
b5d17f4d 48 cc -E -DRELOC=0x${RELOC} -DREL ${COPTS} srt0.c | as -o relsrt0.o
e05d064d 49
b5d17f4d 50# bootable from tape
35e7506c 51
b5d17f4d
BJ
52tpboot: tpboot.o relsrt0.o /usr/lib/libsa.a
53 ld -N -T ${RELOC} relsrt0.o tpboot.o -lsa -lc
54 cp a.out b.out; strip b.out; dd if=b.out of=tpboot ibs=32 skip=1; rm b.out
e05d064d 55
b5d17f4d
BJ
56tpboot.o: boot.c ../h/param.h ../h/inode.h ../h/fs.h
57tpboot.o: saio.h ../h/reboot.h ../h/vm.h
58 cp boot.c tpboot.c; chmod +w tpboot.c
59 cc -c -O -DJUSTASK tpboot.c
60 rm tpboot.c
35e7506c 61
d5e22e3a
SL
62tpcopy: copy.o tpsrt0.o /usr/lib/libsa.a
63 ld -N tpsrt0.o copy.o -lsa -lc
2493f9f8
SL
64 cp a.out b.out; strip b.out; \
65 dd if=b.out of=tpcopy ibs=32 skip=1; rm b.out
35e7506c 66
6fe57a65 67tpformat: format.o tpsrt0.o confhpup.o /usr/lib/libsa.a
077a9f49 68 cp format.c tpformat.c; chmod +w tpformat.c
a7fd309c 69 cc -c -O -DJUSTEXIT tpformat.c
077a9f49 70 rm tpformat.c
6fe57a65 71 ld -N tpsrt0.o tpformat.o confhpup.o -lsa -lc
2493f9f8
SL
72 cp a.out b.out; strip b.out; \
73 dd if=b.out of=tpformat ibs=32 skip=1; rm b.out
077a9f49 74
b5d17f4d 75# bootable from floppy or real disks
e05d064d 76
b5d17f4d
BJ
77boot: boot.o relsrt0.o bootconf.o /usr/lib/libsa.a
78 ld -N -T ${RELOC} -o boot relsrt0.o boot.o bootconf.o -lsa -lc
e05d064d 79
d737d5e5 80bootconf.o: conf.c ../h/param.h ../h/inode.h ../machine/pte.h
a031a31b 81bootconf.o: ../h/fs.h saio.h ../vaxmba/mbareg.h
b5d17f4d
BJ
82 cp conf.c bootconf.c
83 cc -c ${COPTS} -DBOOT bootconf.c
84 rm bootconf.c
35e7506c 85
b5d17f4d
BJ
86copy: copy.o srt0.o conf.o /usr/lib/libsa.a
87 ld -N -o copy srt0.o copy.o conf.o -lsa -lc
e05d064d 88
6fe57a65
SL
89format: format.o srt0.o confhpup.o /usr/lib/libsa.a
90 ld -N -o format srt0.o format.o confhpup.o -lsa -lc
0839bdeb 91
6fe57a65
SL
92drtest: drtest.o srt0.o confhpup.o /usr/lib/libsa.a
93 ld -N -o drtest srt0.o drtest.o confhpup.o -lsa -lc
0839bdeb 94
2493f9f8
SL
95# for 730s minimize size to avoid microcode botch
96# (won't load files larger than 12.5 Kbytes)
76780d43 97
2493f9f8
SL
98730boot.o: boot.c ../h/param.h ../h/inode.h ../h/fs.h
99730boot.o: saio.h ../h/reboot.h ../h/vm.h
100 cp boot.c 730boot.c; chmod +w 730boot.c
101 cc -c ${730OPTS} -DJUSTASK 730boot.c
102 rm 730boot.c
103
104730boot: 730boot.o relsrt0.o 730bootconf.o /usr/lib/libsa.a
bd2f236f 105 ld -N -T ${RELOC} -o 730boot relsrt0.o 730boot.o 730bootconf.o -lsa -lc
76780d43
SL
106
107730bootconf.o: conf.c ../h/param.h ../h/inode.h ../machine/pte.h
108730bootconf.o: ../h/fs.h saio.h
109 cp conf.c 730bootconf.c
110 cc -c ${730OPTS} -DBOOT 730bootconf.c
d5e22e3a 111 rm -f 730bootconf.c
76780d43
SL
112
113730copy: copy.o srt0.o 730conf.o /usr/lib/libsa.a
114 ld -N -o 730copy srt0.o copy.o 730conf.o -lsa -lc
115
6fe57a65
SL
116730drtest: drtest.o srt0.o confup.o /usr/lib/libsa.a
117 ld -N -o 730drtest srt0.o drtest.o confup.o -lsa -lc
d5e22e3a 118
6fe57a65
SL
119730format: format.o srt0.o confup.o /usr/lib/libsa.a
120 ld -N -o 730format srt0.o format.o confup.o -lsa -lc
d5e22e3a 121
76780d43
SL
122730conf.o: conf.c ../h/param.h ../h/inode.h ../machine/pte.h
123730conf.o: ../h/fs.h saio.h
124 cp conf.c 730conf.c
6fe57a65 125 cc -c ${730OPTS} 730conf.c
d5e22e3a 126 rm -f 730conf.c
76780d43 127
b5d17f4d 128# bootstrap from ether
7eed1b32 129
b5d17f4d 130### not yet, rosin, not yet ###
e05d064d 131
9b4d040b 132# getting booted from disc
af93b5dd 133
9b4d040b 134boothk: relsrt0.o boothk.o confrk.o /usr/lib/libsa.a
b5d17f4d 135 ld -N -T ${RELOC} relsrt0.o boothk.o confrk.o -lsa -lc
9b4d040b 136 cp a.out b.out;strip b.out;dd if=b.out of=boothk ibs=32 skip=1;rm b.out
b5d17f4d 137
6fe57a65
SL
138boothp: relsrt0.o boothp.o confhp.o hp.old.o /usr/lib/libsa.a
139 ld -N -T ${RELOC} relsrt0.o boothp.o confhp.o hp.old.o -lsa -lc
9b4d040b 140 cp a.out b.out;strip b.out;dd if=b.out of=boothp ibs=32 skip=1;rm b.out
b5d17f4d 141
6fe57a65
SL
142bootup: relsrt0.o bootup.o confup.o up.old.o /usr/lib/libsa.a
143 ld -N -T ${RELOC} relsrt0.o bootup.o confup.o up.old.o -lsa -lc
9b4d040b
SL
144 cp a.out b.out;strip b.out;dd if=b.out of=bootup ibs=32 skip=1;rm b.out
145
76780d43
SL
146bootra: relsrt0.o bootra.o confra.o /usr/lib/libsa.a
147 ld -N -T ${RELOC} relsrt0.o bootra.o confra.o -lsa -lc
148 cp a.out b.out;strip b.out;dd if=b.out of=bootra ibs=32 skip=1;rm b.out
149
76780d43 150bootrl: relsrt0.o bootrl.o confrl.o /usr/lib/libsa.a
05ec64d7 151 ld -N -T ${RELOC} relsrt0.o bootrl.o confrl.o -lsa -lc
76780d43
SL
152 cp a.out b.out;strip b.out;dd if=b.out of=bootrl ibs=32 skip=1;rm b.out
153
d5e22e3a 154boothp.o: boothp.c ../h/param.h ../h/inode.h ../machine/pte.h ../h/reboot.h
b5d17f4d 155boothp.o: ../h/fs.h saio.h
d5e22e3a 156boothk.o: boothk.c ../h/param.h ../h/inode.h ../machine/pte.h ../h/reboot.h
b5d17f4d 157boothk.o: ../h/fs.h saio.h
d5e22e3a 158bootup.o: bootup.c ../h/param.h ../h/inode.h ../machine/pte.h ../h/reboot.h
76780d43 159bootup.o: ../h/fs.h saio.h
d5e22e3a 160bootra.o: bootra.c ../h/param.h ../h/inode.h ../machine/pte.h ../h/reboot.h
76780d43 161bootra.o: ../h/fs.h saio.h
d5e22e3a 162bootrl.o: bootrl.c ../h/param.h ../h/inode.h ../machine/pte.h ../h/reboot.h
76780d43 163bootrl.o: ../h/fs.h saio.h
d737d5e5 164
d5e22e3a
SL
165boothk.c: bootxx.c
166 sed -e 's/xx/hk/g' <bootxx.c >boothk.c
167boothp.c: bootxx.c
168 sed -e 's/xx/hp/g' <bootxx.c >boothp.c
169bootup.c: bootxx.c
170 sed -e 's/xx/up/g' <bootxx.c >bootup.c
171bootra.c: bootxx.c
172 sed -e 's/xx/ra/g' <bootxx.c >bootra.c
173bootrl.c: bootxx.c
174 sed -e 's/xx/rl/g' <bootxx.c >bootrl.c
175
d737d5e5 176confrk.o: confrk.c ../h/param.h ../h/fs.h ../machine/pte.h ../h/inode.h saio.h
d737d5e5 177confhp.o: confhp.c ../h/param.h ../h/fs.h ../machine/pte.h ../h/inode.h saio.h
d737d5e5 178confup.o: confup.c ../h/param.h ../h/fs.h ../machine/pte.h ../h/inode.h saio.h
76780d43 179confra.o: confra.c ../h/param.h ../h/fs.h ../machine/pte.h ../h/inode.h saio.h
76780d43 180confrl.o: confrl.c ../h/param.h ../h/fs.h ../machine/pte.h ../h/inode.h saio.h
b5d17f4d
BJ
181
182confrk.c: confxx.c
183 sed -e 's/XX/hk/' -e 's/xx/rk/g' <confxx.c >confrk.c
184confhp.c: confxx.c
185 sed -e 's/XX/hp/' -e 's/xx/hp/g' <confxx.c >confhp.c
186confup.c: confxx.c
187 sed -e 's/XX/up/' -e 's/xx/up/g' <confxx.c >confup.c
76780d43
SL
188confra.c: confxx.c
189 sed -e 's/XX/ra/' -e 's/xx/ra/g' <confxx.c >confra.c
190confrl.c: confxx.c
191 sed -e 's/XX/rl/' -e 's/xx/rl/g' <confxx.c >confrl.c
9b4d040b
SL
192
193# utilities
194
195print:
196 @pr makefile
197 @ls -l | pr
198 @pr *.h *.c
199
200clean:
201 rm -f *.o *.exe *.i errs
077a9f49 202 rm -f a.out b.out boot cat tpboot tpcopy copy tpformat
d5e22e3a 203 rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
077a9f49 204 rm -f format drtest core sboot bootconf.c
d5e22e3a 205 rm -f 730boot 730copy 730drtest 730format
9b4d040b
SL
206
207lint:
208 lint ${COPTS} -hxbn boot.c ${SRCS} | \
209 grep -v 'possible pointer alignment' | \
210 grep -v 'struct/union .* never defined'
211
212install: ${ALL}
213 cp tpcopy ${DESTDIR}/tp/copy
214 cp tpboot ${DESTDIR}/tp/boot
a7fd309c 215 cp tpformat ${DESTDIR}/tp/format
2493f9f8
SL
216 cp boot a.out; strip a.out; \
217 dd if=a.out of=../floppy/boot bs=32 skip=1
76780d43 218 cp 730boot a.out; strip a.out; \
a67bb785 219 dd if=a.out of=../cassette/boot.730 bs=32 skip=1
2493f9f8
SL
220 cp ../floppy/boot ../cassette/boot.750
221 cp copy a.out; strip a.out; \
222 dd if=a.out of=../floppy/copy bs=32 skip=1
76780d43 223 cp 730copy a.out; strip a.out; \
a67bb785 224 dd if=a.out of=../cassette/copy.730 bs=32 skip=1
2493f9f8 225 cp ../floppy/copy ../cassette/copy.750
077a9f49
SL
226 cp format a.out; strip a.out; \
227 dd if=a.out of=../floppy/format bs=32 skip=1
d5e22e3a 228 cp 730format a.out; strip a.out; \
a67bb785 229 dd if=a.out of=../cassette/format.730 bs=32 skip=1
2493f9f8 230 cp ../floppy/format ../cassette/format.750
077a9f49
SL
231 cp drtest a.out; strip a.out; \
232 dd if=a.out of=../floppy/drtest bs=32 skip=1
d5e22e3a 233 cp 730drtest a.out; strip a.out; \
a67bb785 234 dd if=a.out of=../cassette/drtest.730 bs=32 skip=1
2493f9f8 235 cp ../floppy/drtest ../cassette/drtest.750
76780d43 236 cp bootup boothk boothp bootra bootrl ${DESTDIR}/usr/mdec
9b4d040b
SL
237
238# beware...