Makefile revision 1.11
1#	from: @(#)Makefile	8.1 (Berkeley) 6/10/93
2#	     $Id: Makefile,v 1.11 1994/08/15 06:42:04 mycroft Exp $
3
4# RELOC=FFF00000 allows for boot prog up to FF000 (1044480) bytes long
5RELOC=	FFF00000
6
7CONS= -DDCACONSOLE -DITECONSOLE -DDCMCONSOLE
8DEFS= -DSTANDALONE -DCOMPAT_NOLABEL ${CONS} -Dhp300 # -DROMPRF
9CFLAGS=	-O ${INCPATH} ${DEFS}
10
11SRCS=   autoconf.c cons.c ct.c devopen.c dca.c dcm.c fhpib.c hil.c hpib.c \
12	ite.c ite_dv.c ite_gb.c ite_rb.c ite_subr.c ite_tc.c ite_hy.c \
13	nhpib.c rd.c scsi.c sd.c
14SRCS+=	conf.c machdep.c prf.c tgets.c
15
16S=	${.CURDIR}/../../..
17
18.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
19.PATH: ${S}/stand ${S}/lib/libsa
20
21INCPATH=-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa
22
23### find out what to use for libkern
24.include "$S/lib/libkern/Makefile.inc"
25LIBKERN=	${KERNLIB}
26
27.include "$S/lib/libsa/Makefile.inc"
28LIBSA=	${SA_LIB}
29
30LIBS=	${LIBSA} ${.OBJDIR}/libdrive.a \
31	${LIBSA} ${LIBKERN}
32
33BOOTS=	pboot dboot nboot dcopy tboot tcopy cat #ls
34ALL=	${BOOTS} mkboot installboot
35
36all: ${ALL}
37
38${BOOTS}: ${LIBS}
39
40OBJS=	${SRCS:N*.h:R:S/$/.o/g}
41${.OBJDIR}/libdrive.a: ${OBJS}
42	ar crv $@ $?
43	ranlib $@
44
45# depend on DEFS
46
47devopen.o machdep.o srt0.o: Makefile
48cons.o dca.o hil.o: Makefile
49ite.o ite_subr.o ite_dv.o ite_gb.o ite_hy.o ite_rb.o ite_tc.o: Makefile
50
51# startups
52
53srt0.o: ${.CURDIR}/srt0.s
54	${CC} ${INCPATH} ${DEFS} -c ${.CURDIR}/srt0.s
55
56tpsrt0.o: ${.CURDIR}/srt0.s
57	${CC} ${INCPATH} ${DEFS} -DTP -c ${.CURDIR}/srt0.s -o tpsrt0.o
58
59# new boot
60pboot:	pboot.o srt0.o ${LIBS}
61	ld -N -T ${RELOC} -e begin srt0.o pboot.o ${LIBS} -o $@
62	@size pboot
63	@echo pboot total size should not exceed 1044480 bytes
64
65ls:	ls.o srt0.o ${LIBS}
66	ld -N -T ${RELOC} -e begin srt0.o ls.o ${LIBS} -o $@
67	@size ls
68	@echo ls total size should not exceed 1044480 bytes
69
70cat:	cat.o srt0.o ${LIBS}
71	ld -N -T ${RELOC} -e begin srt0.o cat.o ${LIBS} -o $@
72	@size cat
73	@echo cat total size should not exceed 1044480 bytes
74
75# bootable from tape
76
77tboot:	tboot.o srt0.o ${LIBS}
78	ld -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBS} -o $@
79	@size tboot
80	@echo tboot total size should not exceed 1044480 bytes
81
82tboot.o: boot.c
83	cp ${.CURDIR}/boot.c tboot.c; chmod +w tboot.c
84	${CC} -c ${CFLAGS} -DJUSTASK tboot.c
85	rm -f tboot.c
86
87tcopy:	copy.o tpsrt0.o ${LIBS}
88	ld -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBS} -o $@
89	@size tcopy
90	@echo tcopy total size should not exceed 1044480 bytes
91
92# bootable from floppy or real disks
93
94dboot:	boot.o srt0.o bootconf.o ${LIBS}
95	ld -N -T ${RELOC} -e begin srt0.o boot.o bootconf.o ${LIBS} -o $@ 
96	@size dboot
97	@echo dboot text+data size should not exceed 57344 bytes
98	@echo dboot total size should not exceed 1044480 bytes
99
100bootconf.o: ${.CURDIR}/conf.c
101	rm -f bootconf.c
102	ln -s ${.CURDIR}/conf.c bootconf.c
103	${CC} -c ${CFLAGS} -DBOOT bootconf.c
104	rm -f bootconf.c
105
106# non-secure boot (allows booting non-root owned or world writable kernels)
107
108nboot:	nboot.o srt0.o bootconf.o ${LIBS}
109	ld -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBS}
110	@size nboot
111	@echo nboot text+data size should not exceed 57344 bytes
112	@echo nboot total size should not exceed 1044480 bytes
113
114nboot.o: ${.CURDIR}/boot.c
115	rm -f nboot.c
116	ln -s ${.CURDIR}/boot.c nboot.c
117	${CC} -c ${CFLAGS} -DINSECURE nboot.c
118	rm -f nboot.c
119
120dcopy:	copy.o srt0.o conf.o ${LIBS}
121	ld -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBS}
122
123mkboot: ${.CURDIR}/mkboot.c
124	${CC} ${CFLAGS} -o mkboot ${.CURDIR}/mkboot.c
125
126installboot: ${.CURDIR}/installboot.sh
127	@rm -f installboot
128	cp -p ${.CURDIR}/installboot.sh installboot
129
130# utilities
131
132clean cleandir:
133	rm -f *.o *.exe *.i errs make.out
134	rm -f a.out pboot cat ls tboot tcopy
135	rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
136	rm -f core sboot bootconf.c nboot.c
137	rm -f libdrive.a mkboot dboot dcopy nboot installboot *.lif
138
139install: mkboot installboot ${ALL}
140	./mkboot pboot netbsdboot.lif
141	./mkboot dboot diskboot.lif
142	./mkboot nboot ndiskboot.lif
143	./mkboot tboot tcopy tapeboot.lif
144	install -c -o bin -g bin -m 555 installboot ${DESTDIR}/usr/mdec
145	install -c -o bin -g bin -m 444 netbsdboot.lif ${DESTDIR}/usr/mdec/rdboot
146	rm -f ${DESTDIR}/usr/mdec/bootrd
147	ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/bootrd
148	rm -f ${DESTDIR}/usr/mdec/sdboot
149	ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/sdboot
150	rm -f ${DESTDIR}/usr/mdec/bootsd
151	ln ${DESTDIR}/usr/mdec/sdboot ${DESTDIR}/usr/mdec/bootsd
152	install -c -o bin -g bin -m 644 tapeboot.lif ${DESTDIR}/usr/mdec/bootct
153#	install -o bin -g bin -m 755 -d ${DESTDIR}/sys/hpdist/tp
154#	install -o bin -g bin -m 444 netbsdboot.lif ${DESTDIR}/sys/hpdist/tp
155#	install -o bin -g bin -m 444 tapeboot.lif ${DESTDIR}/sys/hpdist/tp
156#	install -o bin -g bin -m 444 diskboot.lif ${DESTDIR}/sys/hpdist/tp
157#	install -o bin -g bin -m 444 ndiskboot.lif ${DESTDIR}/sys/hpdist/tp
158
159.include <bsd.dep.mk>
160.include <bsd.obj.mk>
161# XXX This should not be necessary.
162.include <bsd.subdir.mk>
163
164FRC:
165