| 1 | # Makefile 4.9 81/04/15 |
| 2 | |
| 3 | DESTDIR= |
| 4 | CFLAGS= -O -DSTANDALONE ${COPTS} |
| 5 | COPTS= -DVAX780 -DVAX750 -DVAX7ZZ |
| 6 | RELOC= 70000 |
| 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 |
| 10 | |
| 11 | ALL= /usr/lib/libsa.a srt0.o boot cat ls icheck mkfs restor \ |
| 12 | tpicheck tpmkfs tprestor sboot |
| 13 | |
| 14 | all: ${ALL} |
| 15 | |
| 16 | /usr/lib/libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o |
| 17 | ar crv ${DESTDIR}/usr/lib/libsa.a $? |
| 18 | ranlib ${DESTDIR}/usr/lib/libsa.a |
| 19 | |
| 20 | ${DRIVERS}: |
| 21 | cc -c -S ${COPTS} $*.c |
| 22 | /lib/c2 -i $*.s | as -o $*.o |
| 23 | rm $*.s |
| 24 | |
| 25 | boot: boot.o relsrt0.o ${DESTDIR}/usr/lib/libsa.a |
| 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 | |
| 29 | sboot: boot.c relsrt0.o ${DESTDIR}/usr/lib/libsa.a |
| 30 | cp boot.c sboot.c; chmod +w sboot.c |
| 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 | |
| 36 | cat: cat.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
| 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 | |
| 40 | ls: ls.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
| 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 | |
| 44 | mkfs.o: /usr/src/cmd/mkfs.c |
| 45 | cc ${CFLAGS} -c /usr/src/cmd/mkfs.c |
| 46 | |
| 47 | mkfs: mkfs.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
| 48 | ld -N srt0.o mkfs.o -lsa -lc |
| 49 | cp a.out b.out; strip b.out; dd if=b.out of=mkfs ibs=32 skip=1; rm b.out |
| 50 | |
| 51 | restor.o: /usr/src/cmd/restor.c |
| 52 | cc ${CFLAGS} -c /usr/src/cmd/restor.c |
| 53 | |
| 54 | restor: restor.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
| 55 | ld -N srt0.o restor.o -lsa -lc |
| 56 | cp a.out b.out; strip b.out; dd if=b.out of=restor ibs=32 skip=1; rm b.out |
| 57 | |
| 58 | icheck.o: /usr/src/cmd/icheck.c |
| 59 | cc ${CFLAGS} -c /usr/src/cmd/icheck.c |
| 60 | |
| 61 | icheck: icheck.o srt0.o ${DESTDIR}/usr/lib/libsa.a |
| 62 | ld -N srt0.o icheck.o -lsa -lc |
| 63 | cp a.out b.out; strip b.out; dd if=b.out of=icheck ibs=32 skip=1; rm b.out |
| 64 | |
| 65 | tpmkfs: mkfs.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
| 66 | ld -N tpsrt0.o mkfs.o -lsa -lc |
| 67 | cp a.out b.out; strip b.out; dd if=b.out of=tpmkfs ibs=32 skip=1; rm b.out |
| 68 | |
| 69 | tprestor: restor.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
| 70 | ld -N tpsrt0.o restor.o -lsa -lc |
| 71 | cp a.out b.out; strip b.out; dd if=b.out of=tprestor ibs=32 skip=1; rm b.out |
| 72 | |
| 73 | tpicheck: icheck.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a |
| 74 | ld -N tpsrt0.o icheck.o -lsa -lc |
| 75 | cp a.out b.out; strip b.out; dd if=b.out of=tpicheck ibs=32 skip=1; rm b.out |
| 76 | |
| 77 | srt0.o: srt0.c |
| 78 | cc -E -DRELOC=0x${RELOC} ${COPTS} srt0.c | as -o srt0.o |
| 79 | |
| 80 | tpsrt0.o: srt0.c |
| 81 | cc -E -DRELOC=0x${RELOC} -DTP ${COPTS} srt0.c | as -o tpsrt0.o |
| 82 | |
| 83 | relsrt0.o: srt0.c |
| 84 | cc -E -DRELOC=0x${RELOC} -DREL ${COPTS} srt0.c | as -o relsrt0.o |
| 85 | |
| 86 | print: |
| 87 | @pr -f makefile |
| 88 | @/usr/ucb/ls -l | pr -f |
| 89 | @pr -f *.h *.c |
| 90 | |
| 91 | clean: |
| 92 | rm -f *.o *.exe *.i |
| 93 | rm -f a.out b.out boot cat ls icheck mkfs restor rpboot \ |
| 94 | tpicheck tpmkfs tprestor sboot |
| 95 | |
| 96 | lint: |
| 97 | lint ${COPTS} -hxbn boot.c ${SRCS} | \ |
| 98 | grep -v 'possible pointer alignment' | \ |
| 99 | grep -v 'struct/union .* never defined' |
| 100 | |
| 101 | install: ${ALL} |
| 102 | cp tprestor ${DESTDIR}/tp/restor |
| 103 | cp tpicheck ${DESTDIR}/tp/icheck |
| 104 | cp tpmkfs ${DESTDIR}/tp/mkfs |
| 105 | cp sboot ${DESTDIR}/tp/boot |
| 106 | cp boot icheck mkfs restor cat ls ../floppy |