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