Commit | Line | Data |
---|---|---|
40249b35 | 1 | # Makefile 4.2 %G% |
e05d064d | 2 | |
40249b35 | 3 | CPU= 780 |
af93b5dd | 4 | DESTDIR= |
40249b35 BJ |
5 | CFLAGS= -O -DSTANDALONE -DVAX=${CPU} |
6 | COPTS= -DVAX=${CPU} | |
bd5ddd44 | 7 | RELOC= 70000 |
40249b35 | 8 | DRIVERS=hp.o ht.o mba.o rk.o tm.o up.o uba.o |
e05d064d | 9 | |
c549898e BJ |
10 | all: /usr/lib/libsa.a srt0.o boot cat ls icheck mkfs restor \ |
11 | tpicheck tpmkfs tprestor sboot | |
e05d064d | 12 | |
40249b35 | 13 | /usr/lib/libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o |
af93b5dd BJ |
14 | ar crv ${DESTDIR}/usr/lib/libsa.a $? |
15 | ranlib ${DESTDIR}/usr/lib/libsa.a | |
e05d064d BJ |
16 | |
17 | ${DRIVERS}: | |
18 | cc -c -S ${COPTS} $*.c | |
19 | /lib/c2 -i $*.s $*.os | |
20 | as -o $*.o $*.os | |
21 | rm $*.s $*.os | |
22 | ||
af93b5dd | 23 | boot: boot.o relsrt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
24 | ld -N -T ${RELOC} relsrt0.o boot.o -lsa -lc |
25 | cp a.out b.out; strip b.out; dd if=b.out of=boot ibs=32 skip=1; rm b.out | |
26 | ||
c549898e BJ |
27 | sboot: boot.c relsrt0.o ${DESTDIR}/usr/lib/libsa.a |
28 | cp boot.c sboot.c | |
29 | cc -c -O -DJUSTASK sboot.c | |
30 | rm sboot.c | |
31 | ld -N -T ${RELOC} relsrt0.o sboot.o -lsa -lc | |
32 | cp a.out b.out; strip b.out; dd if=b.out of=sboot ibs=32 skip=1; rm b.out | |
33 | ||
af93b5dd | 34 | cat: cat.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
35 | ld -N srt0.o cat.o -lsa -lc |
36 | cp a.out b.out; strip b.out; dd if=b.out of=cat ibs=32 skip=1; rm b.out | |
37 | ||
af93b5dd | 38 | ls: ls.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
39 | ld -N srt0.o ls.o -lsa -lc |
40 | cp a.out b.out; strip b.out; dd if=b.out of=ls ibs=32 skip=1; rm b.out | |
41 | ||
35e7506c BJ |
42 | mkfs.o: /usr/src/cmd/mkfs.c |
43 | cc ${CFLAGS} -c /usr/src/cmd/mkfs.c | |
44 | ||
af93b5dd | 45 | mkfs: mkfs.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
46 | ld -N srt0.o mkfs.o -lsa -lc |
47 | cp a.out b.out; strip b.out; dd if=b.out of=mkfs ibs=32 skip=1; rm b.out | |
48 | ||
35e7506c BJ |
49 | restor.o: /usr/src/cmd/restor.c |
50 | cc ${CFLAGS} -c /usr/src/cmd/restor.c | |
51 | ||
af93b5dd | 52 | restor: restor.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
53 | ld -N srt0.o restor.o -lsa -lc |
54 | cp a.out b.out; strip b.out; dd if=b.out of=restor ibs=32 skip=1; rm b.out | |
55 | ||
35e7506c BJ |
56 | icheck.o: /usr/src/cmd/icheck.c |
57 | cc ${CFLAGS} -c /usr/src/cmd/icheck.c | |
58 | ||
af93b5dd | 59 | icheck: icheck.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
35e7506c BJ |
60 | ld -N srt0.o icheck.o -lsa -lc |
61 | cp a.out b.out; strip b.out; dd if=b.out of=icheck ibs=32 skip=1; rm b.out | |
62 | ||
af93b5dd | 63 | tpmkfs: mkfs.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
64 | ld -N tpsrt0.o mkfs.o -lsa -lc |
65 | cp a.out b.out; strip b.out; dd if=b.out of=tpmkfs ibs=32 skip=1; rm b.out | |
66 | ||
af93b5dd | 67 | tprestor: restor.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
68 | ld -N tpsrt0.o restor.o -lsa -lc |
69 | cp a.out b.out; strip b.out; dd if=b.out of=tprestor ibs=32 skip=1; rm b.out | |
70 | ||
af93b5dd | 71 | tpicheck: icheck.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
35e7506c BJ |
72 | ld -N tpsrt0.o icheck.o -lsa -lc |
73 | cp a.out b.out; strip b.out; dd if=b.out of=tpicheck ibs=32 skip=1; rm b.out | |
74 | ||
e05d064d | 75 | srt0.o: rel.m ../h/mtpr.m ../h/mba.m ../h/uba.m srt0.s |
40249b35 BJ |
76 | /lib/cpp -DVAX=${CPU} srt0.s >srt0.i |
77 | as -o srt0.o rel.m ../h/mtpr.m ../h/mba.m ../h/uba.m srt0.i | |
e05d064d BJ |
78 | |
79 | tpsrt0.o: rel.m ../h/mtpr.m ../h/mba.m ../h/uba.m tpsrt0.s | |
40249b35 BJ |
80 | /lib/cpp -DVAX=${CPU} tpsrt0.s >tpsrt0.i |
81 | as -o tpsrt0.o rel.m ../h/mtpr.m ../h/mba.m ../h/uba.m tpsrt0.i | |
e05d064d BJ |
82 | |
83 | relsrt0.o: rel.m ../h/mtpr.m ../h/mba.m ../h/uba.m relsrt0.s | |
40249b35 BJ |
84 | /lib/cpp -DVAX=${CPU} relsrt0.s >relsrt0.i |
85 | as -o relsrt0.o rel.m ../h/mtpr.m ../h/mba.m ../h/uba.m relsrt0.i | |
e05d064d BJ |
86 | |
87 | rpboot: rpboot.s | |
88 | as rpboot.s | |
89 | cp a.out b.out; strip b.out; dd if=b.out of=rpboot bs=32 skip=1; rm b.out | |
90 | print: | |
91 | @pr makefile | |
92 | @/usr/ucb/ls -l | pr | |
93 | @pr *.h | |
94 | @pr *.m *.s | |
95 | @pr *.c | |
96 | ||
af93b5dd BJ |
97 | vgrindt: |
98 | @vgrind -t -n makefile; | |
99 | @vgrind -t *.h; | |
100 | @vgrind -t -n *.m *.s; | |
101 | @vgrind -t *.c; | |
102 | ||
e05d064d | 103 | clean: |
40249b35 | 104 | rm -f *.o *.exe *.i |
c549898e BJ |
105 | rm -f a.out b.out boot cat ls icheck mkfs restor rpboot \ |
106 | tpicheck tpmkfs tprestor sboot | |
e05d064d BJ |
107 | |
108 | install: | |
109 | cp tprestor ${DESTDIR}/sys/restor | |
35e7506c | 110 | cp tpicheck ${DESTDIR}/sys/icheck |
e05d064d | 111 | cp tpmkfs ${DESTDIR}/sys/mkfs |
c549898e | 112 | cp sboot ${DESTDIR}/sys/boot |
35e7506c | 113 | cp boot icheck mkfs restor cat ls ../floppy |