1# 2# Copyright (c) 1990 The Regents of the University of California. 3# All rights reserved. 4# 5# %sccs.include.redist.sh 6# 7# @(#)Makefile 7.24 (Berkeley) 12/16/90 8# 9 10DESTDIR= 11STAND= ../../stand 12INCPATH=-I. -I../.. 13VPATH= ${STAND}:../vax 14C2= /usr/libexec/c2 15DEFS= ${INCPATH} -DSTANDALONE -DCOMPAT_42 16MACH= -DVAX8600 -DVAX8200 -DVAX780 -DVAX750 -DVAX730 -DVAX630 -DVAX650 17LS= /bin/ls 18 19# Collections of C options: 20# COPTS device drivers/assembler, not optimized 21# SMOPTS "small" versions for 7.5K bootxx programs 22# 730OPTS "small" versions for 11/730-only versions 23# CFLAGS everything else 24 25COPTS= ${DEFS} ${MACH} 26CFLAGS= -O ${DEFS} ${MACH} 27730OPTS=-O ${DEFS} -DVAX730 28SMOPTS= ${DEFS} -DSMALL -DVAX750 -DVAX630 -DVAX650 29 30RELOC= 150000 31LIBSA= libsa.a 32 33SRCS= autoconf.c boot.c bootxx.c cat.c copy.c dev.c drtest.c format.c \ 34 format.c getfile.c gets.c hp.c hpmaptype.c ht.c idc.c kdb.c \ 35 machdep.c mba.c mt.c prf.c printn.c qdcons.c qvcons.c qfont.c \ 36 rk.c rl.c sys.c tm.c tmscp.c ts.c uba.c uda.c up.c upmaptype.c \ 37 ut.c conf.c ../vax/dkbad.c 38DUMMIES=confxx.c 39DRIVERS=autoconf.o hp.o hpmaptype.o ht.o idc.o kdb.o mba.o mt.o qdcons.o \ 40 qvcons.o rk.o rl.o tm.o tmscp.o ts.o up.o upmaptype.o uba.o uda.o \ 41 ut.o 42SMOBJ= bootxx.o sm_sys.o sm_autoconf.o 43 44# These drivers don't have ecc correction and bad sector forwarding; 45# they are placed in the file system boot area for 750's. If your 46# root has bad sectors you can try and squeeze the newer drivers in... 47ODRIVERS=sm_hp.o sm_up.o 48 49MDEC= boothp boothk bootkra bootup bootra bootrl 50ALL= boot tpboot cat copy tpcopy format tpformat drtest ls \ 51 730boot 730copy 730format 730drtest ${MDEC} 52 53all: ${ALL} 54 55${LIBSA}: conf.o dev.o dkbad.o getfile.o gets.o machdep.o prf.o printn.o \ 56 qfont.o sys.o ${DRIVERS} 57 ar crv ${LIBSA} $? 58 ranlib ${LIBSA} 59 60${DRIVERS}: 61 ${CC} -c -S ${COPTS} $*.c 62 ${C2} -i $*.s | as -o $*.o 63 rm -f $*.s 64 65# startups 66 67srt0.o: srt0.c ../include/mtpr.h ../include/cpu.h 68 ${CC} -E -DRELOC=0x${RELOC} ${COPTS} srt0.c | as -o srt0.o 69 70tpsrt0.o: srt0.c ../include/mtpr.h ../include/cpu.h 71 ${CC} -E -DRELOC=0x${RELOC} -DTP ${COPTS} srt0.c | as -o tpsrt0.o 72 73relsrt0.o: srt0.c ../include/mtpr.h ../include/cpu.h 74 ${CC} -E -DRELOC=0x${RELOC} -DREL ${COPTS} srt0.c | as -o relsrt0.o 75 76# bootable from tape 77 78tpboot: tpboot.o relsrt0.o ${LIBSA} 79 ld -N -T ${RELOC} relsrt0.o tpboot.o ${LIBSA} -lc 80 strip a.out; dd if=a.out of=tpboot ibs=32 skip=1; rm -f a.out 81 82tpboot.o: boot.o 83 rm -f $*.c 84 ln -s boot.c $*.c 85 ${CC} -c ${CFLAGS} -DJUSTASK $*.c 86 rm -f $*.c 87 88tpcopy: copy.o tpsrt0.o ${LIBSA} 89 ld -N tpsrt0.o copy.o ${LIBSA} -lc 90 strip a.out; dd if=a.out of=tpcopy ibs=32 skip=1; rm -f a.out 91 92tpformat: tpformat.o tpsrt0.o confhpup.o ${LIBSA} 93 ld -N tpsrt0.o tpformat.o confhpup.o ${LIBSA} -lc 94 strip a.out; dd if=a.out of=tpformat ibs=32 skip=1; rm -f a.out 95 96tpformat.o: format.o 97 rm -f $*.c 98 ln -s format.c $*.c 99 ${CC} -c ${CFLAGS} -DJUSTEXIT $*.c 100 rm -f $*.c 101 102# bootable from floppy or real disks 103 104boot: boot.o relsrt0.o bootconf.o ${LIBSA} 105 ld -N -T ${RELOC} -o $@ relsrt0.o boot.o bootconf.o ${LIBSA} -lc 106 107bootconf.o: conf.o 108 rm -f $*.c 109 ln -s conf.c $*.c 110 ${CC} -c ${CFLAGS} -DBOOT $*.c 111 rm -f $*.c 112 113copy: copy.o srt0.o getfile.o ${LIBSA} 114 ld -N -o $@ srt0.o copy.o getfile.o ${LIBSA} -lc 115 116cat: cat.o srt0.o getfile.o ${LIBSA} 117 ld -N -o $@ srt0.o cat.o getfile.o ${LIBSA} -lc 118 119ls: ls.o srt0.o ${LIBSA} 120 ld -N -o $@ srt0.o ls.o ${LIBSA} -lc 121 122format: format.o srt0.o confhpup.o ${LIBSA} 123 ld -N -o $@ srt0.o format.o confhpup.o ${LIBSA} -lc 124 125drtest: drtest.o srt0.o confhpup.o ${LIBSA} 126 ld -N -o $@ srt0.o drtest.o confhpup.o ${LIBSA} -lc 127 128# for 730s minimize size to avoid microcode botch 129# (won't load files larger than 12.5 Kbytes) 130 131730boot.o: boot.o 132 rm -f $*.c 133 ln -s boot.c $*.c 134 ${CC} -c ${730OPTS} $*.c 135 rm -f $*.c 136 137730boot: 730boot.o relsrt0.o 730bootconf.o ${LIBSA} 138 ld -N -T ${RELOC} -o 730boot relsrt0.o 730boot.o 730bootconf.o ${LIBSA} -lc 139 140730bootconf.o: conf.o 141 rm -f $*.c 142 ln -s conf.c $*.c 143 ${CC} -c ${730OPTS} -DBOOT $*.c 144 rm -f $*.c 145 146730copy: copy.o srt0.o 730conf.o ${LIBSA} 147 ld -N -o $@ srt0.o copy.o 730conf.o ${LIBSA} -lc 148 149730drtest: drtest.o srt0.o confup.o ${LIBSA} 150 ld -N -o $@ srt0.o drtest.o confup.o ${LIBSA} -lc 151 152730format: format.o srt0.o confup.o ${LIBSA} 153 ld -N -o $@ srt0.o format.o confup.o ${LIBSA} -lc 154 155730conf.o: conf.o 156 rm -f $*.c 157 ln -s conf.c $*.c 158 ${CC} -c ${730OPTS} $*.c 159 rm -f $*.c 160 161# bootstrap from ether 162 163### not yet, rosin, not yet ### 164 165# getting booted from disc 166 167boothk: relsrt0.o confrk.o ${SMOBJ} ${LIBSA} 168 ld -N -T ${RELOC} relsrt0.o confrk.o ${SMOBJ} ${LIBSA} -lc 169 size a.out 170 rm -f $@ 171 strip a.out;dd if=a.out of=$@ ibs=32 skip=1;rm -f a.out 172 ${LS} -l $@ 173 174boothp: relsrt0.o confhp.o sm_hp.o ${SMOBJ} ${LIBSA} 175 ld -N -T ${RELOC} relsrt0.o confhp.o sm_hp.o ${SMOBJ} ${LIBSA} -lc 176 size a.out 177 rm -f $@ 178 strip a.out;dd if=a.out of=$@ ibs=32 skip=1;rm -f a.out 179 ${LS} -l $@ 180 181bootkra: relsrt0.o confkra.o ${SMOBJ} ${LIBSA} 182 ld -N -T ${RELOC} relsrt0.o confkra.o ${SMOBJ} ${LIBSA} -lc 183 size a.out 184 rm -f $@ 185 strip a.out;dd if=a.out of=$@ ibs=32 skip=1;rm -f a.out 186 ${LS} -l $@ 187 188bootup: relsrt0.o confup.o sm_up.o ${SMOBJ} ${LIBSA} 189 ld -N -T ${RELOC} relsrt0.o confup.o sm_up.o ${SMOBJ} ${LIBSA} -lc 190 size a.out 191 rm -f $@ 192 strip a.out;dd if=a.out of=$@ ibs=32 skip=1;rm -f a.out 193 ${LS} -l $@ 194 195bootra: relsrt0.o confra.o ${SMOBJ} ${LIBSA} 196 ld -N -T ${RELOC} relsrt0.o confra.o ${SMOBJ} ${LIBSA} -lc 197 size a.out 198 rm -f $@ 199 strip a.out;dd if=a.out of=$@ ibs=32 skip=1;rm -f a.out 200 ${LS} -l $@ 201 202bootrl: relsrt0.o confrl.o ${SMOBJ} ${LIBSA} 203 ld -N -T ${RELOC} relsrt0.o confrl.o ${SMOBJ} ${LIBSA} -lc 204 size a.out 205 rm -f $@ 206 strip a.out;dd if=a.out of=$@ ibs=32 skip=1;rm -f a.out 207 ${LS} -l $@ 208 209sm_hp.o: hp.o 210 rm -f sm_hp.c 211 ln -s hp.c sm_hp.c 212 ${CC} -S ${SMOPTS} sm_hp.c 213 ${C2} -i sm_hp.s | as -o sm_hp.o 214 rm -f sm_hp.s sm_hp.c 215 216sm_up.o: up.o 217 rm -f sm_up.c 218 ln -s up.c sm_up.c 219 ${CC} -S ${SMOPTS} sm_up.c 220 ${C2} -i sm_up.s | as -o sm_up.o 221 rm -f sm_up.s sm_up.c 222 223sm_sys.o: ${STAND}/sys.c 224 rm -f sm_sys.c 225 ln -s ${STAND}/sys.c sm_sys.c 226 ${CC} -c -O ${SMOPTS} sm_sys.c 227 rm -f sm_sys.c 228 229sm_autoconf.o: autoconf.o 230 rm -f sm_autoconf.c 231 ln -s autoconf.c sm_autoconf.c 232 ${CC} -c -O ${SMOPTS} sm_autoconf.c 233 rm -f sm_autoconf.c 234 235confrk.o: confrk.c confxx.o 236confhp.o: confhp.c confxx.o 237confkra.o: confkra.c confxx.o 238confup.o: confup.c confxx.o 239confra.o: confra.c confxx.o 240confrl.o: confrl.c confxx.o 241 242confxx.o: 243 touch confxx.o 244 245confrk.c: confxx.c ${STAND}/dev.c 246 sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > confrk.c 247 sed -e 's/XX/hk/' -e 's/xx/rk/g' < confxx.c >> confrk.c 248confhp.c: confxx.c ${STAND}/dev.c 249 sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > confhp.c 250 sed -e 's/XX/hp/' -e 's/xx/hp/g' < confxx.c >> confhp.c 251confkra.c: confxx.c ${STAND}/dev.c 252 sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > confkra.c 253 sed -e 's/XX/kra/' -e 's/xx/kra/g' < confxx.c >> confkra.c 254confup.c: confxx.c ${STAND}/dev.c 255 sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > confup.c 256 sed -e 's/XX/up/' -e 's/xx/up/g' < confxx.c >> confup.c 257confra.c: confxx.c ${STAND}/dev.c 258 sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > confra.c 259 sed -e 's/XX/ra/' -e 's/xx/ra/g' < confxx.c >> confra.c 260confrl.c: confxx.c ${STAND}/dev.c 261 sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > confrl.c 262 sed -e 's/XX/rl/' -e 's/xx/rl/g' < confxx.c >> confrl.c 263 264clean: 265 rm -f *.o *.exe *.i sm_*.c libsa.a 266 rm -f boot[a-wyz][a-z].c conf[a-wyz][a-z].c confkra.c 267 rm -f ${ALL} a.out core errs sboot bootconf.c 268 269cleandir: clean 270 rm -f ${MAN} tags .depend 271 272depend: ${SRCS} 273 mkdep ${INCPATH} -DSTANDALONE ${SRCS} ${DUMMIES} 274 275install: FRC 276 install -c -s -o bin -g bin -m 644 \ 277 format cat copy drtest ls ${DESTDIR}/stand 278 [ -d ../vaxdist/tp ] || mkdir ../vaxdist/tp 279 cp tpcopy ../vaxdist/tp/copy 280 cp tpboot ../vaxdist/tp/boot 281 cp tpformat ../vaxdist/tp/format 282 cp boot a.out; strip a.out; \ 283 dd if=a.out of=../floppy/boot bs=32 skip=1; rm a.out 284 cp 730boot a.out; strip a.out; \ 285 dd if=a.out of=../cassette/boot.730 bs=32 skip=1; rm a.out 286 cp ../floppy/boot ../cassette/boot.750 287 cp ../floppy/boot ../consolerl/boot 288 cp copy a.out; strip a.out; \ 289 dd if=a.out of=../floppy/copy bs=32 skip=1; rm a.out 290 cp 730copy a.out; strip a.out; \ 291 dd if=a.out of=../cassette/copy.730 bs=32 skip=1; rm a.out 292 cp ../floppy/copy ../cassette/copy.750 293 cp ../floppy/copy ../consolerl/copy 294 cp format a.out; strip a.out; \ 295 dd if=a.out of=../floppy/format bs=32 skip=1; rm a.out 296 cp 730format a.out; strip a.out; \ 297 dd if=a.out of=../cassette/format.730 bs=32 skip=1; rm a.out 298 cp ../floppy/format ../cassette/format.750 299 cp ../floppy/format ../consolerl/format 300 cp drtest a.out; strip a.out; \ 301 dd if=a.out of=../floppy/drtest bs=32 skip=1; rm a.out 302 cp 730drtest a.out; strip a.out; \ 303 dd if=a.out of=../cassette/drtest.730 bs=32 skip=1; rm a.out 304 cp ../floppy/drtest ../cassette/drtest.750 305 cp ../floppy/drtest ../consolerl/drtest 306 install -c -o bin -g bin -m 444 ${MDEC} ${DESTDIR}/usr/mdec 307 rm -f ${DESTDIR}/usr/mdec/bootrd 308 ln ${DESTDIR}/usr/mdec/bootra ${DESTDIR}/usr/mdec/bootrd 309 310lint: ${SRCS} 311 lint ${COPTS} -hxbn boot.c ${SRCS} | \ 312 sed -e '/possible pointer alignment/d' \ 313 -e '/struct\/union .* never defined/d' 314 315tags: ${SRCS} 316 ctags ${SRCS} ${DUMMIES} 317 318FRC: 319