Commit | Line | Data |
---|---|---|
c140a385 | 1 | # Makefile 4.4 81/03/15 |
e05d064d | 2 | |
af93b5dd | 3 | DESTDIR= |
c140a385 BJ |
4 | CFLAGS= -O -DSTANDALONE ${COPTS} |
5 | COPTS= -DVAX750 -DVAX780 | |
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 | |
c140a385 | 11 | all: /usr/lib/libsa.a srt0.o boot cat ls icheck mkfs restor \ |
c549898e | 12 | tpicheck tpmkfs tprestor sboot |
e05d064d | 13 | |
c140a385 | 14 | /usr/lib/libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o |
af93b5dd BJ |
15 | ar crv ${DESTDIR}/usr/lib/libsa.a $? |
16 | ranlib ${DESTDIR}/usr/lib/libsa.a | |
e05d064d BJ |
17 | |
18 | ${DRIVERS}: | |
19 | cc -c -S ${COPTS} $*.c | |
c140a385 BJ |
20 | /lib/c2 -i $*.s | as -o $*.o |
21 | rm $*.s | |
e05d064d | 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 | ||
c140a385 BJ |
42 | mkfs.o: /usr/src/cmd/mkfs.c |
43 | cc ${CFLAGS} -c /usr/src/cmd/mkfs.c | |
35e7506c | 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 | ||
c140a385 BJ |
49 | restor.o: /usr/src/cmd/restor.c |
50 | cc ${CFLAGS} -c /usr/src/cmd/restor.c | |
35e7506c | 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 | ||
c140a385 BJ |
56 | icheck.o: /usr/src/cmd/icheck.c |
57 | cc ${CFLAGS} -c /usr/src/cmd/icheck.c | |
35e7506c | 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 | ||
c140a385 BJ |
75 | srt0.o: srt0.c |
76 | cc -E -DRELOC=${RELOC} srt0.c | as -o srt0.o | |
e05d064d | 77 | |
c140a385 BJ |
78 | tpsrt0.o: tpsrt0.c |
79 | cc -E -DRELOC=${RELOC} tpsrt0.c | as -o tpsrt0.o | |
7eed1b32 | 80 | |
c140a385 BJ |
81 | relsrt0.o: relsrt0.c |
82 | cc -E -DRELOC=${RELOC} relsrt0.c | as -o relsrt0.o | |
e05d064d | 83 | |
e05d064d | 84 | print: |
c140a385 BJ |
85 | @pr -f makefile |
86 | @/usr/ucb/ls -l | pr -f | |
87 | @pr -f *.h *.c | |
af93b5dd | 88 | |
e05d064d | 89 | clean: |
40249b35 | 90 | rm -f *.o *.exe *.i |
c549898e BJ |
91 | rm -f a.out b.out boot cat ls icheck mkfs restor rpboot \ |
92 | tpicheck tpmkfs tprestor sboot | |
e05d064d | 93 | |
c140a385 BJ |
94 | lint: |
95 | lint ${COPTS} -hxbn boot.c ${SRCS} | \ | |
96 | grep -v 'possible pointer alignment' | \ | |
97 | grep -v 'struct/unit .* never defined' | |
98 | ||
e05d064d BJ |
99 | install: |
100 | cp tprestor ${DESTDIR}/sys/restor | |
35e7506c | 101 | cp tpicheck ${DESTDIR}/sys/icheck |
e05d064d | 102 | cp tpmkfs ${DESTDIR}/sys/mkfs |
c549898e | 103 | cp sboot ${DESTDIR}/sys/boot |
c140a385 | 104 | cp boot icheck mkfs restor cat ls ../floppy |