summaryrefslogtreecommitdiff
path: root/sys/arch/hp300/stand/Makefile
blob: ffb7b8b9c1381c747433349c334d62039fea88e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#	$NetBSD: Makefile,v 1.19 1996/01/15 01:41:37 thorpej Exp $

#	@(#)Makefile	8.1 (Berkeley) 6/10/93

NOPROG=	noprog
NOMAN=	noman

SUBDIR=	libsa

# RELOC=FFF00000 allows for boot prog up to FF000 (1044480) bytes long
RELOC=	FFF00000

CONS=	-DDCACONSOLE -DITECONSOLE -DDCMCONSOLE
DEFS=	-DSTANDALONE -DCOMPAT_NOLABEL ${CONS} -Dhp300 # -DROMPRF
#DEFS+=	-DNETIF_DEBUG -DRPC_DEBUG -DNFS_DEBUG -DRARP_DEBUG -DNET_DEBUG
#DEFS+=	-DLE_DEBUG
CFLAGS=	-O3 ${INCPATH} ${DEFS}

SRCS=   autoconf.c cons.c devopen.c machdep.c prf.c
OBJS=	${SRCS:N*.h:R:S/$/.o/g}
DSRCS=	ct.c dca.c dcm.c fhpib.c hil.c hpib.c if_le.c \
	ite.c ite_dv.c ite_gb.c ite_rb.c ite_subr.c ite_tc.c ite_hy.c \
	nhpib.c rd.c scsi.c sd.c
DOBJS=	${DSRCS:N*.h:R:S/$/.o/g}

S=	${.CURDIR}/../../..

.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
.PATH: ${S}/stand

INCPATH=-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa
### find out what to use for libkern
KERNREL=
.include "$S/lib/libkern/Makefile.inc"
LIBKERN=	${KERNLIB}

.include "${.CURDIR}/libsa/Makefile.inc"
LIBSA=	${SA_LIB}

LIBS=	${OBJS} libdrive.a ${LIBSA} ${LIBKERN}

BOOTS=	pboot netboot sys_inst dboot dcopy tboot tcopy cat #ls
ALL=	${BOOTS} mkboot installboot

all: ${ALL}

${BOOTS}: ${LIBS}

libdrive.a: ${DOBJS}
	rm -f $@
	${AR} cq $@ ${DOBJS}
	${RANLIB} $@

# depend on DEFS

devopen.o machdep.o srt0.o: Makefile
cons.o dca.o hil.o: Makefile
ite.o ite_subr.o ite_dv.o ite_gb.o ite_hy.o ite_rb.o ite_tc.o: Makefile

# startups

srt0.o: ${.CURDIR}/srt0.s
	${CC} ${INCPATH} ${DEFS} -c ${.CURDIR}/srt0.s

tpsrt0.o: ${.CURDIR}/srt0.s
	${CC} ${INCPATH} ${DEFS} -DTP -c ${.CURDIR}/srt0.s -o $@

# new boot
pboot:	srt0.o pboot.o tgets.o conf.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin srt0.o pboot.o tgets.o conf.o ${LIBS} -o $@
	@size $@
	@echo $@ total size should not exceed 1044480 bytes

ls:	srt0.o ls.o conf.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin srt0.o ls.o conf.o ${LIBS} -o $@
	@size $@
	@echo $@ total size should not exceed 1044480 bytes

cat:	srt0.o cat.o conf.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin srt0.o cat.o conf.o ${LIBS} -o $@
	@size $@
	@echo $@ total size should not exceed 1044480 bytes

# installation
sys_inst: srt0.o sys_inst.o clock.o instconf.o inst_netio.o tgets.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin srt0.o sys_inst.o clock.o instconf.o inst_netio.o tgets.o ${LIBS} -o $@
	@size $@
	@echo $@ total size should not exceed 1044480 bytes

instconf.o: ${.CURDIR}/conf.c
	${CC} ${CFLAGS} -DSYS_INST -c ${.CURDIR}/conf.c -o $@

inst_netio.o: ${.CURDIR}/netio.c
	${CC} ${CFLAGS} -DSYS_INST -c ${.CURDIR}/netio.c -o $@

# bootable from network

netboot:	srt0.o netboot.o clock.o netconf.o netio.o tgets.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin srt0.o netboot.o clock.o netconf.o netio.o tgets.o ${LIBS} -o $@
	@size $@
	@echo $@ total size should not exceed 1044480 bytes

netconf.o: ${.CURDIR}/conf.c
	${CC} ${CFLAGS} -DNETBOOT -c ${.CURDIR}/conf.c -o $@

# bootable from tape

tboot:	srt0.o tboot.o conf.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin srt0.o tboot.o conf.o ${LIBS} -o $@
	@size $@
	@echo $@ total size should not exceed 1044480 bytes

tboot.o: ${.CURDIR}/boot.c
	${CC} ${CFLAGS} -DJUSTASK -c ${.CURDIR}/boot.c -o $@

tcopy:	tpsrt0.o copy.o conf.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin tpsrt0.o copy.o conf.o ${LIBS} -o $@
	@size $@
	@echo $@ total size should not exceed 1044480 bytes

# bootable from floppy or real disks

dboot:	srt0.o boot.o tapeconf.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin srt0.o boot.o tapeconf.o ${LIBS} -o $@
	@size $@
	@echo $@ text+data size should not exceed 57344 bytes
	@echo $@ total size should not exceed 1044480 bytes

tapeconf.o: ${.CURDIR}/conf.c
	${CC} ${CFLAGS} -DTAPEBOOT -c ${.CURDIR}/conf.c -o $@

dcopy:	srt0.o copy.o conf.o ${LIBS}
	${LD} -N -T ${RELOC} -e begin srt0.o copy.o conf.o ${LIBS} -o $@

mkboot: ${.CURDIR}/mkboot.c
	${CC} ${CFLAGS} ${.CURDIR}/mkboot.c -o $@

installboot: ${.CURDIR}/installboot.sh
	@rm -f installboot
	cp -p ${.CURDIR}/installboot.sh installboot

# utilities

clean::
	rm -f *.o *.exe *.i errs make.out
	rm -f a.out pboot cat ls tboot tcopy
	rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
	rm -f core sboot
	rm -f libdrive.a mkboot dboot dcopy installboot *.lif

install: mkboot installboot ${ALL}
	./mkboot pboot bsdboot.lif
	./mkboot netboot netboot.lif
	./mkboot sys_inst sys_inst.lif
	./mkboot dboot diskboot.lif
	./mkboot tboot tcopy tapeboot.lif
	install -c -o ${BINOWN} -g ${BINGRP} -m 555 installboot \
	    ${DESTDIR}/usr/mdec
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 bsdboot.lif \
	    ${DESTDIR}/usr/mdec/rdboot
	rm -f ${DESTDIR}/usr/mdec/bootrd
	ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/bootrd
	rm -f ${DESTDIR}/usr/mdec/sdboot
	ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/sdboot
	rm -f ${DESTDIR}/usr/mdec/bootsd
	ln ${DESTDIR}/usr/mdec/sdboot ${DESTDIR}/usr/mdec/bootsd
	install -d -m 755 -o ${BINOWN} -g ${BINGRP} ${DESTDIR}/usr/mdec/rbootd
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 netboot.lif \
	    ${DESTDIR}/usr/mdec/rbootd/SYS_NBOOT
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 sys_inst.lif \
	    ${DESTDIR}/usr/mdec/rbootd/SYS_INST
	install -c -o ${BINOWN} -g ${BINGRP} -m 644 tapeboot.lif \
	    ${DESTDIR}/usr/mdec/bootct

.include <bsd.prog.mk>
.include <bsd.subdir.mk>