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