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