Makefile revision 1.20
1#	$NetBSD: Makefile,v 1.20 1996/06/26 17:44:21 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=	uboot inst
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
65# unified boot program (disk, network, tape)
66uboot:	srt0.o uboot.o tgets.o netio.o clock.o conf.o ${LIBS}
67	${LD} -N -T ${RELOC} -e begin srt0.o uboot.o tgets.o netio.o clock.o \
68	    conf.o ${LIBS} -o $@
69	@size $@
70	@echo $@ total size should not exceed 1044480 bytes
71
72# miniroot installation program
73inst: srt0.o inst.o clock.o conf.o netio.o tgets.o ${LIBS}
74	${LD} -N -T ${RELOC} -e begin srt0.o inst.o clock.o conf.o netio.o \
75	    tgets.o ${LIBS} -o $@
76	@size $@
77	@echo $@ total size should not exceed 1044480 bytes
78
79# helper program ... turns OMAGIC into LIF
80mkboot: ${.CURDIR}/mkboot.c
81	${CC} ${CFLAGS} ${.CURDIR}/mkboot.c -o $@
82
83installboot: ${.CURDIR}/installboot.sh
84	@rm -f installboot
85	cp -p ${.CURDIR}/installboot.sh installboot
86
87# utilities
88
89clean::
90	rm -f *.o *.i
91	rm -f a.out ${BOOTS}
92	rm -f libdrive.a mkboot installboot *.lif
93
94install: mkboot installboot ${ALL}
95	./mkboot uboot uboot.lif
96	./mkboot inst inst.lif
97	install -d -m 755 -o ${BINOWN} -g ${BINGRP} ${DESTDIR}/usr/mdec/rbootd
98	install -c -o ${BINOWN} -g ${BINGRP} -m 555 installboot \
99	    ${DESTDIR}/usr/mdec
100	install -c -o ${BINOWN} -g ${BINGRP} -m 444 uboot.lif \
101	    ${DESTDIR}/usr/mdec
102	rm -f ${DESTDIR}/usr/mdec/rdboot
103	ln ${DESTDIR}/usr/mdec/uboot.lif ${DESTDIR}/usr/mdec/rdboot
104	rm -f ${DESTDIR}/usr/mdec/bootrd
105	ln ${DESTDIR}/usr/mdec/uboot.lif ${DESTDIR}/usr/mdec/bootrd
106	rm -f ${DESTDIR}/usr/mdec/sdboot
107	ln ${DESTDIR}/usr/mdec/uboot.lif ${DESTDIR}/usr/mdec/sdboot
108	rm -f ${DESTDIR}/usr/mdec/bootsd
109	ln ${DESTDIR}/usr/mdec/uboot.lif ${DESTDIR}/usr/mdec/bootsd
110	rm -f ${DESTDIR}/usr/mdec/ctboot
111	ln ${DESTDIR}/usr/mdec/uboot.lif ${DESTDIR}/usr/mdec/ctboot
112	rm -f ${DESTDIR}/usr/mdec/bootct
113	ln ${DESTDIR}/usr/mdec/uboot.lif ${DESTDIR}/usr/mdec/bootct
114	rm -f ${DESTDIR}/usr/mdec/rbootd/SYS_UBOOT
115	ln ${DESTDIR}/usr/mdec/uboot.lif ${DESTDIR}/usr/mdec/rbootd/SYS_UBOOT
116	install -c -o ${BINOWN} -g ${BINGRP} -m 444 inst.lif \
117	    ${DESTDIR}/usr/mdec/rbootd/SYS_INST
118
119.include <bsd.prog.mk>
120.include <bsd.subdir.mk>
121