Commit | Line | Data |
---|---|---|
2d1379f5 | 1 | # Makefile 4.25 83/02/12 |
e05d064d | 2 | |
b5d17f4d | 3 | DESTDIR=/ |
faf25b5b | 4 | CFLAGS= -O -DSTANDALONE ${COPTS} |
b5d17f4d | 5 | COPTS= -DVAX780 -DVAX750 -DVAX730 |
bd5ddd44 | 6 | RELOC= 70000 |
c140a385 | 7 | SRCS= sys.c conf.c prf.c machdep.c \ |
b5d17f4d | 8 | autoconf.c hp.c ht.c idc.c mba.c mt.c rk.c tm.c ts.c \ |
0839bdeb | 9 | up.c uba.c uda.c ut.c \ |
077a9f49 | 10 | drtest.c format.c up.new.c |
b5d17f4d BJ |
11 | DRIVERS=autoconf.o hp.o ht.o idc.o mba.o mt.o rk.o tm.o ts.o \ |
12 | up.o uba.o uda.o ut.o | |
0839bdeb | 13 | NEWDRIVERS=hp.new.o up.new.o |
e05d064d | 14 | |
0839bdeb | 15 | ALL= /usr/lib/libsa.a srt0.o boot tpboot copy tpcopy \ |
912bc793 | 16 | format tpformat drtest boothp boothk bootup |
e05d064d | 17 | |
9e3a67c5 BJ |
18 | all: ${ALL} |
19 | ||
c140a385 | 20 | /usr/lib/libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o |
b5d17f4d BJ |
21 | ar crv /usr/lib/libsa.a $? |
22 | ranlib /usr/lib/libsa.a | |
e05d064d | 23 | |
0839bdeb | 24 | ${NEWDRIVERS} ${DRIVERS}: savax.h |
e05d064d | 25 | cc -c -S ${COPTS} $*.c |
c140a385 BJ |
26 | /lib/c2 -i $*.s | as -o $*.o |
27 | rm $*.s | |
e05d064d | 28 | |
b5d17f4d | 29 | # startups |
e05d064d | 30 | |
a031a31b | 31 | srt0.o: srt0.c ../vax/mtpr.h ../vax/cpu.h |
b5d17f4d | 32 | cc -E -DRELOC=0x${RELOC} ${COPTS} srt0.c | as -o srt0.o |
faf25b5b | 33 | |
a031a31b | 34 | tpsrt0.o: srt0.c ../vax/mtpr.h ../vax/cpu.h |
b5d17f4d | 35 | cc -E -DRELOC=0x${RELOC} -DTP ${COPTS} srt0.c | as -o tpsrt0.o |
35e7506c | 36 | |
a031a31b | 37 | relsrt0.o: srt0.c ../vax/mtpr.h ../vax/cpu.h |
b5d17f4d | 38 | cc -E -DRELOC=0x${RELOC} -DREL ${COPTS} srt0.c | as -o relsrt0.o |
e05d064d | 39 | |
b5d17f4d | 40 | # bootable from tape |
35e7506c | 41 | |
b5d17f4d BJ |
42 | tpboot: tpboot.o relsrt0.o /usr/lib/libsa.a |
43 | ld -N -T ${RELOC} relsrt0.o tpboot.o -lsa -lc | |
44 | cp a.out b.out; strip b.out; dd if=b.out of=tpboot ibs=32 skip=1; rm b.out | |
e05d064d | 45 | |
b5d17f4d BJ |
46 | tpboot.o: boot.c ../h/param.h ../h/inode.h ../h/fs.h |
47 | tpboot.o: saio.h ../h/reboot.h ../h/vm.h | |
48 | cp boot.c tpboot.c; chmod +w tpboot.c | |
49 | cc -c -O -DJUSTASK tpboot.c | |
50 | rm tpboot.c | |
35e7506c | 51 | |
b5d17f4d BJ |
52 | tpcopy: copy.c tpsrt0.o /usr/lib/libsa.a |
53 | cp copy.c tpcopy.c; chmod +w tpcopy.c | |
54 | cc -c -O tpcopy.c | |
55 | rm tpcopy.c | |
56 | ld -N tpsrt0.o tpcopy.o -lsa -lc | |
57 | cp a.out b.out; strip b.out; dd if=b.out of=tpcopy ibs=32 skip=1; rm b.out | |
35e7506c | 58 | |
077a9f49 SL |
59 | tpformat: format.c tpsrt0.o /usr/lib/libsa.a |
60 | cp format.c tpformat.c; chmod +w tpformat.c | |
61 | cc -c -O tpformat.c | |
62 | rm tpformat.c | |
63 | ld -N tpsrt0.o tpformat.o -lsa -lc | |
64 | cp a.out b.out; strip b.out; dd if=b.out of=tpformat ibs=32 skip=1; rm b.out | |
65 | ||
b5d17f4d | 66 | # bootable from floppy or real disks |
e05d064d | 67 | |
b5d17f4d BJ |
68 | boot: boot.o relsrt0.o bootconf.o /usr/lib/libsa.a |
69 | ld -N -T ${RELOC} -o boot relsrt0.o boot.o bootconf.o -lsa -lc | |
e05d064d | 70 | |
d737d5e5 | 71 | bootconf.o: conf.c ../h/param.h ../h/inode.h ../machine/pte.h |
a031a31b | 72 | bootconf.o: ../h/fs.h saio.h ../vaxmba/mbareg.h |
b5d17f4d BJ |
73 | cp conf.c bootconf.c |
74 | cc -c ${COPTS} -DBOOT bootconf.c | |
75 | rm bootconf.c | |
35e7506c | 76 | |
b5d17f4d BJ |
77 | copy: copy.o srt0.o conf.o /usr/lib/libsa.a |
78 | ld -N -o copy srt0.o copy.o conf.o -lsa -lc | |
e05d064d | 79 | |
077a9f49 SL |
80 | format: format.o srt0.o dkbad.o |
81 | format: confhpup.o hp.new.o up.new.o /usr/lib/libsa.a | |
82 | ld -N -o format srt0.o format.o dkbad.o confhpup.o \ | |
83 | hp.new.o up.new.o -lsa -lc | |
0839bdeb | 84 | |
077a9f49 SL |
85 | drtest: drtest.o srt0.o dkbad.o |
86 | drtest: confhpup.o hp.new.o up.new.o /usr/lib/libsa.a | |
87 | ld -N -o drtest srt0.o drtest.o dkbad.o confhpup.o \ | |
88 | hp.new.o up.new.o -lsa -lc | |
7845b2bb | 89 | |
54323a14 HS |
90 | dkbad.o: ../vax/dkbad.c |
91 | ${CC} -c ${CFLAGS} ../vax/dkbad.c | |
0839bdeb | 92 | |
b5d17f4d | 93 | # bootstrap from ether |
7eed1b32 | 94 | |
b5d17f4d | 95 | ### not yet, rosin, not yet ### |
e05d064d | 96 | |
9b4d040b | 97 | # getting booted from disc |
af93b5dd | 98 | |
9b4d040b | 99 | boothk: relsrt0.o boothk.o confrk.o /usr/lib/libsa.a |
b5d17f4d | 100 | ld -N -T ${RELOC} relsrt0.o boothk.o confrk.o -lsa -lc |
9b4d040b | 101 | cp a.out b.out;strip b.out;dd if=b.out of=boothk ibs=32 skip=1;rm b.out |
b5d17f4d | 102 | |
9b4d040b SL |
103 | boothk.o: bootxx.c |
104 | cc -c -S ${COPTS} -DBOOTRK bootxx.c | |
105 | /lib/c2 -i bootxx.s | as -o boothk.o | |
106 | rm -f bootxx.s | |
b5d17f4d | 107 | |
9b4d040b | 108 | boothp: relsrt0.o boothp.o confhp.o /usr/lib/libsa.a |
b5d17f4d | 109 | ld -N -T ${RELOC} relsrt0.o boothp.o confhp.o -lsa -lc |
9b4d040b | 110 | cp a.out b.out;strip b.out;dd if=b.out of=boothp ibs=32 skip=1;rm b.out |
b5d17f4d | 111 | |
9b4d040b SL |
112 | boothp.o: bootxx.c |
113 | cc -c -S ${COPTS} -DBOOTHP bootxx.c | |
114 | /lib/c2 -i bootxx.s | as -o boothp.o | |
115 | rm -f bootxx.s | |
b5d17f4d | 116 | |
9b4d040b | 117 | bootup: relsrt0.o bootup.o confup.o /usr/lib/libsa.a |
b5d17f4d | 118 | ld -N -T ${RELOC} relsrt0.o bootup.o confup.o -lsa -lc |
9b4d040b SL |
119 | cp a.out b.out;strip b.out;dd if=b.out of=bootup ibs=32 skip=1;rm b.out |
120 | ||
121 | bootup.o: bootxx.c | |
122 | cc -c -S ${COPTS} -DBOOTUP bootxx.c | |
123 | /lib/c2 -i bootxx.s | as -o bootup.o | |
124 | rm -f bootxx.s | |
b5d17f4d | 125 | |
d737d5e5 | 126 | boothp.o: bootxx.c ../h/param.h ../h/inode.h ../machine/pte.h ../h/reboot.h |
b5d17f4d | 127 | boothp.o: ../h/fs.h saio.h |
d737d5e5 | 128 | boothk.o: bootxx.c ../h/param.h ../h/inode.h ../machine/pte.h ../h/reboot.h |
b5d17f4d | 129 | boothk.o: ../h/fs.h saio.h |
d737d5e5 SL |
130 | bootup.o: bootxx.c ../h/param.h ../h/inode.h ../machine/pte.h ../h/reboot.h |
131 | ||
132 | confrk.o: confrk.c ../h/param.h ../h/fs.h ../machine/pte.h ../h/inode.h saio.h | |
133 | ${CC} -c ${CFLAGS} confrk.c | |
134 | confhp.o: confhp.c ../h/param.h ../h/fs.h ../machine/pte.h ../h/inode.h saio.h | |
135 | ${CC} -c ${CFLAGS} confhp.c | |
136 | confup.o: confup.c ../h/param.h ../h/fs.h ../machine/pte.h ../h/inode.h saio.h | |
137 | ${CC} -c ${CFLAGS} confup.c | |
b5d17f4d BJ |
138 | |
139 | confrk.c: confxx.c | |
140 | sed -e 's/XX/hk/' -e 's/xx/rk/g' <confxx.c >confrk.c | |
141 | confhp.c: confxx.c | |
142 | sed -e 's/XX/hp/' -e 's/xx/hp/g' <confxx.c >confhp.c | |
143 | confup.c: confxx.c | |
144 | sed -e 's/XX/up/' -e 's/xx/up/g' <confxx.c >confup.c | |
9b4d040b SL |
145 | |
146 | # utilities | |
147 | ||
148 | print: | |
149 | @pr makefile | |
150 | @ls -l | pr | |
151 | @pr *.h *.c | |
152 | ||
153 | clean: | |
154 | rm -f *.o *.exe *.i errs | |
077a9f49 | 155 | rm -f a.out b.out boot cat tpboot tpcopy copy tpformat |
9b4d040b | 156 | rm -f boot[a-z]? conf[a-wyz][a-z].c |
077a9f49 | 157 | rm -f format drtest core sboot bootconf.c |
9b4d040b SL |
158 | |
159 | lint: | |
160 | lint ${COPTS} -hxbn boot.c ${SRCS} | \ | |
161 | grep -v 'possible pointer alignment' | \ | |
162 | grep -v 'struct/union .* never defined' | |
163 | ||
164 | install: ${ALL} | |
165 | cp tpcopy ${DESTDIR}/tp/copy | |
166 | cp tpboot ${DESTDIR}/tp/boot | |
167 | cp copy a.out; strip a.out; dd if=a.out of=../floppy/copy bs=32 skip=1 | |
168 | cp boot a.out; strip a.out; dd if=a.out of=../floppy/boot bs=32 skip=1 | |
077a9f49 SL |
169 | cp format a.out; strip a.out; \ |
170 | dd if=a.out of=../floppy/format bs=32 skip=1 | |
171 | cp drtest a.out; strip a.out; \ | |
172 | dd if=a.out of=../floppy/drtest bs=32 skip=1 | |
9b4d040b SL |
173 | cp bootup boothk boothp ${DESTDIR}/usr/mdec |
174 | ||
175 | # beware... |