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