Commit | Line | Data |
---|---|---|
3fceccc4 | 1 | # Makefile 4.11 81/05/10 |
e05d064d | 2 | |
af93b5dd | 3 | DESTDIR= |
faf25b5b | 4 | CFLAGS= -O -DSTANDALONE ${COPTS} |
53c207d6 | 5 | COPTS= -DVAX780 -DVAX750 -DVAX7ZZ |
bd5ddd44 | 6 | RELOC= 70000 |
c140a385 BJ |
7 | SRCS= sys.c conf.c prf.c machdep.c \ |
8 | autoconf.c hp.c ht.c mba.c rk.c tm.c ts.c up.c uba.c | |
9 | DRIVERS=autoconf.o hp.o ht.o mba.o rk.o tm.o ts.o up.o uba.o | |
e05d064d | 10 | |
9e3a67c5 | 11 | ALL= /usr/lib/libsa.a srt0.o boot cat ls icheck mkfs restor \ |
c549898e | 12 | tpicheck tpmkfs tprestor sboot |
e05d064d | 13 | |
9e3a67c5 BJ |
14 | all: ${ALL} |
15 | ||
c140a385 | 16 | /usr/lib/libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o |
af93b5dd BJ |
17 | ar crv ${DESTDIR}/usr/lib/libsa.a $? |
18 | ranlib ${DESTDIR}/usr/lib/libsa.a | |
e05d064d BJ |
19 | |
20 | ${DRIVERS}: | |
21 | cc -c -S ${COPTS} $*.c | |
c140a385 BJ |
22 | /lib/c2 -i $*.s | as -o $*.o |
23 | rm $*.s | |
e05d064d | 24 | |
af93b5dd | 25 | boot: boot.o relsrt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
26 | ld -N -T ${RELOC} relsrt0.o boot.o -lsa -lc |
27 | cp a.out b.out; strip b.out; dd if=b.out of=boot ibs=32 skip=1; rm b.out | |
28 | ||
c549898e | 29 | sboot: boot.c relsrt0.o ${DESTDIR}/usr/lib/libsa.a |
10899d3a | 30 | cp boot.c sboot.c; chmod +w sboot.c |
c549898e BJ |
31 | cc -c -O -DJUSTASK sboot.c |
32 | rm sboot.c | |
33 | ld -N -T ${RELOC} relsrt0.o sboot.o -lsa -lc | |
34 | cp a.out b.out; strip b.out; dd if=b.out of=sboot ibs=32 skip=1; rm b.out | |
35 | ||
af93b5dd | 36 | cat: cat.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
37 | ld -N srt0.o cat.o -lsa -lc |
38 | cp a.out b.out; strip b.out; dd if=b.out of=cat ibs=32 skip=1; rm b.out | |
39 | ||
af93b5dd | 40 | ls: ls.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
41 | ld -N srt0.o ls.o -lsa -lc |
42 | cp a.out b.out; strip b.out; dd if=b.out of=ls ibs=32 skip=1; rm b.out | |
43 | ||
3fceccc4 BJ |
44 | imptst: imptst.o srt0.o |
45 | ld -N srt0.o imptst.o -lsa -lc | |
faf25b5b BJ |
46 | cp a.out b.out; strip b.out; dd if=b.out of=imptst ibs=32 skip=1; rm b.out |
47 | ||
c140a385 BJ |
48 | mkfs.o: /usr/src/cmd/mkfs.c |
49 | cc ${CFLAGS} -c /usr/src/cmd/mkfs.c | |
35e7506c | 50 | |
af93b5dd | 51 | mkfs: mkfs.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
52 | ld -N srt0.o mkfs.o -lsa -lc |
53 | cp a.out b.out; strip b.out; dd if=b.out of=mkfs ibs=32 skip=1; rm b.out | |
54 | ||
c140a385 BJ |
55 | restor.o: /usr/src/cmd/restor.c |
56 | cc ${CFLAGS} -c /usr/src/cmd/restor.c | |
35e7506c | 57 | |
af93b5dd | 58 | restor: restor.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
59 | ld -N srt0.o restor.o -lsa -lc |
60 | cp a.out b.out; strip b.out; dd if=b.out of=restor ibs=32 skip=1; rm b.out | |
61 | ||
c140a385 BJ |
62 | icheck.o: /usr/src/cmd/icheck.c |
63 | cc ${CFLAGS} -c /usr/src/cmd/icheck.c | |
35e7506c | 64 | |
af93b5dd | 65 | icheck: icheck.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
35e7506c BJ |
66 | ld -N srt0.o icheck.o -lsa -lc |
67 | cp a.out b.out; strip b.out; dd if=b.out of=icheck ibs=32 skip=1; rm b.out | |
68 | ||
af93b5dd | 69 | tpmkfs: mkfs.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
70 | ld -N tpsrt0.o mkfs.o -lsa -lc |
71 | cp a.out b.out; strip b.out; dd if=b.out of=tpmkfs ibs=32 skip=1; rm b.out | |
72 | ||
af93b5dd | 73 | tprestor: restor.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
e05d064d BJ |
74 | ld -N tpsrt0.o restor.o -lsa -lc |
75 | cp a.out b.out; strip b.out; dd if=b.out of=tprestor ibs=32 skip=1; rm b.out | |
76 | ||
af93b5dd | 77 | tpicheck: icheck.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
35e7506c BJ |
78 | ld -N tpsrt0.o icheck.o -lsa -lc |
79 | cp a.out b.out; strip b.out; dd if=b.out of=tpicheck ibs=32 skip=1; rm b.out | |
80 | ||
c140a385 | 81 | srt0.o: srt0.c |
10899d3a | 82 | cc -E -DRELOC=0x${RELOC} ${COPTS} srt0.c | as -o srt0.o |
e05d064d | 83 | |
10899d3a BJ |
84 | tpsrt0.o: srt0.c |
85 | cc -E -DRELOC=0x${RELOC} -DTP ${COPTS} srt0.c | as -o tpsrt0.o | |
7eed1b32 | 86 | |
10899d3a BJ |
87 | relsrt0.o: srt0.c |
88 | cc -E -DRELOC=0x${RELOC} -DREL ${COPTS} srt0.c | as -o relsrt0.o | |
e05d064d | 89 | |
e05d064d | 90 | print: |
c140a385 BJ |
91 | @pr -f makefile |
92 | @/usr/ucb/ls -l | pr -f | |
93 | @pr -f *.h *.c | |
af93b5dd | 94 | |
e05d064d | 95 | clean: |
40249b35 | 96 | rm -f *.o *.exe *.i |
c549898e BJ |
97 | rm -f a.out b.out boot cat ls icheck mkfs restor rpboot \ |
98 | tpicheck tpmkfs tprestor sboot | |
e05d064d | 99 | |
c140a385 BJ |
100 | lint: |
101 | lint ${COPTS} -hxbn boot.c ${SRCS} | \ | |
102 | grep -v 'possible pointer alignment' | \ | |
610c6f01 | 103 | grep -v 'struct/union .* never defined' |
c140a385 | 104 | |
9e3a67c5 | 105 | install: ${ALL} |
6d7d79e8 BJ |
106 | cp tprestor ${DESTDIR}/tp/restor |
107 | cp tpicheck ${DESTDIR}/tp/icheck | |
108 | cp tpmkfs ${DESTDIR}/tp/mkfs | |
109 | cp sboot ${DESTDIR}/tp/boot | |
c140a385 | 110 | cp boot icheck mkfs restor cat ls ../floppy |