Makefile revision 1.17
1#	$NetBSD: Makefile,v 1.17 1995/09/02 05:04:14 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
15#DEFS+=	-DNETIF_DEBUG -DRPC_DEBUG -DNFS_DEBUG -DRARP_DEBUG -DNET_DEBUG
16#DEFS+=	-DLE_DEBUG
17CFLAGS=	-O3 ${INCPATH} ${DEFS}
18
19SRCS=   autoconf.c cons.c devopen.c machdep.c prf.c
20OBJS=	${SRCS:N*.h:R:S/$/.o/g}
21DSRCS=	ct.c dca.c dcm.c fhpib.c hil.c hpib.c if_le.c \
22	ite.c ite_dv.c ite_gb.c ite_rb.c ite_subr.c ite_tc.c ite_hy.c \
23	nhpib.c rd.c scsi.c sd.c
24DOBJS=	${DSRCS:N*.h:R:S/$/.o/g}
25
26S=	${.CURDIR}/../../..
27
28.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
29.PATH: ${S}/stand
30
31INCPATH=-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa
32### find out what to use for libkern
33KERNREL=
34.include "$S/lib/libkern/Makefile.inc"
35LIBKERN=	${KERNLIB}
36
37.include "${.CURDIR}/libsa/Makefile.inc"
38LIBSA=	${SA_LIB}
39
40LIBS=	${OBJS} libdrive.a ${LIBSA} ${LIBKERN}
41
42BOOTS=	pboot netboot dboot dcopy tboot tcopy cat #ls
43ALL=	${BOOTS} mkboot installboot
44
45all: ${ALL}
46
47${BOOTS}: ${LIBS}
48
49libdrive.a: ${DOBJS}
50	rm -f $@
51	${AR} cq $@ ${DOBJS}
52	${RANLIB} $@
53
54# depend on DEFS
55
56devopen.o machdep.o srt0.o: Makefile
57cons.o dca.o hil.o: Makefile
58ite.o ite_subr.o ite_dv.o ite_gb.o ite_hy.o ite_rb.o ite_tc.o: Makefile
59
60# startups
61
62srt0.o: ${.CURDIR}/srt0.s
63	${CC} ${INCPATH} ${DEFS} -c ${.CURDIR}/srt0.s
64
65tpsrt0.o: ${.CURDIR}/srt0.s
66	${CC} ${INCPATH} ${DEFS} -DTP -c ${.CURDIR}/srt0.s -o $@
67
68# new boot
69pboot:	srt0.o pboot.o tgets.o conf.o ${LIBS}
70	${LD} -N -T ${RELOC} -e begin srt0.o pboot.o tgets.o conf.o ${LIBS} -o $@
71	@size $@
72	@echo $@ total size should not exceed 1044480 bytes
73
74ls:	srt0.o ls.o conf.o ${LIBS}
75	${LD} -N -T ${RELOC} -e begin srt0.o ls.o conf.o ${LIBS} -o $@
76	@size $@
77	@echo $@ total size should not exceed 1044480 bytes
78
79cat:	srt0.o cat.o conf.o ${LIBS}
80	${LD} -N -T ${RELOC} -e begin srt0.o cat.o conf.o ${LIBS} -o $@
81	@size $@
82	@echo $@ total size should not exceed 1044480 bytes
83
84# bootable from network
85
86netboot:	srt0.o netboot.o clock.o netconf.o netio.o tgets.o ${LIBS}
87	${LD} -N -T ${RELOC} -e begin srt0.o netboot.o clock.o netconf.o netio.o tgets.o ${LIBS} -o $@
88	@size $@
89	@echo $@ total size should not exceed 1044480 bytes
90	
91netconf.o: ${.CURDIR}/conf.c
92	${CC} ${CFLAGS} -DNETBOOT -c ${.CURDIR}/conf.c -o $@
93
94# bootable from tape
95
96tboot:	srt0.o tboot.o conf.o ${LIBS}
97	${LD} -N -T ${RELOC} -e begin srt0.o tboot.o conf.o ${LIBS} -o $@
98	@size $@
99	@echo $@ total size should not exceed 1044480 bytes
100
101tboot.o: ${.CURDIR}/boot.c
102	${CC} ${CFLAGS} -DJUSTASK -c ${.CURDIR}/boot.c -o $@
103
104tcopy:	tpsrt0.o copy.o conf.o ${LIBS}
105	${LD} -N -T ${RELOC} -e begin tpsrt0.o copy.o conf.o ${LIBS} -o $@
106	@size $@
107	@echo $@ total size should not exceed 1044480 bytes
108
109# bootable from floppy or real disks
110
111dboot:	srt0.o boot.o tapeconf.o ${LIBS}
112	${LD} -N -T ${RELOC} -e begin srt0.o boot.o tapeconf.o ${LIBS} -o $@
113	@size $@
114	@echo $@ text+data size should not exceed 57344 bytes
115	@echo $@ total size should not exceed 1044480 bytes
116
117tapeconf.o: ${.CURDIR}/conf.c
118	${CC} ${CFLAGS} -DTAPEBOOT -c ${.CURDIR}/conf.c -o $@
119
120dcopy:	srt0.o copy.o conf.o ${LIBS}
121	${LD} -N -T ${RELOC} -e begin srt0.o copy.o conf.o ${LIBS} -o $@
122
123mkboot: ${.CURDIR}/mkboot.c
124	${CC} ${CFLAGS} ${.CURDIR}/mkboot.c -o $@
125
126installboot: ${.CURDIR}/installboot.sh
127	@rm -f installboot
128	cp -p ${.CURDIR}/installboot.sh installboot
129
130# utilities
131
132clean::
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
137	rm -f libdrive.a mkboot dboot dcopy installboot *.lif
138
139install: mkboot installboot ${ALL}
140	./mkboot pboot netbsdboot.lif
141	./mkboot netboot netboot.lif
142	./mkboot dboot diskboot.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 -d -m 755 -o bin -g bin ${DESTDIR}/usr/mdec/rbootd
153	install -c -o bin -g bin -m 444 netboot.lif ${DESTDIR}/usr/mdec/rbootd/SYS_NBOOT
154	install -c -o bin -g bin -m 644 tapeboot.lif ${DESTDIR}/usr/mdec/bootct
155#	install -o bin -g bin -m 755 -d ${DESTDIR}/sys/hpdist/tp
156#	install -o bin -g bin -m 444 netbsdboot.lif ${DESTDIR}/sys/hpdist/tp
157#	install -o bin -g bin -m 444 tapeboot.lif ${DESTDIR}/sys/hpdist/tp
158#	install -o bin -g bin -m 444 diskboot.lif ${DESTDIR}/sys/hpdist/tp
159
160.include <bsd.prog.mk>
161.include <bsd.subdir.mk>
162