xref: /original-bsd/sys/hp300/stand/Makefile (revision 3705696b)
1#	@(#)Makefile	8.1 (Berkeley) 06/10/93
2
3DESTDIR=
4INCPATH=-I. -I../..
5VPATH=	../../stand.att
6
7CC=cc
8AS=as
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} # -DROMPRF
15CFLAGS=	-O ${INCPATH} ${DEFS}
16
17DRIVERS=autoconf.c cons.c ct.c dca.c dcm.c fhpib.c hil.c hpib.c ite.c \
18	ite_dv.c ite_gb.c ite_hy.c ite_rb.c ite_subr.c ite_tc.c nhpib.c rd.c \
19	scsi.c sd.c
20SRCS=	conf.c label.c machdep.c prf.c ${DRIVERS}
21LIBS=	libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libgnulib.a \
22	${DESTDIR}/usr/lib/libc.a
23
24ALL=	dboot nboot tboot tcopy mkboot installboot
25
26all: ${ALL}
27
28dboot nboot tboot tcopy: ${LIBS}
29
30libsa/libsa.a: FRC
31	cd libsa; make
32
33libdrive.a: conf.o label.o machdep.o prf.o ${DRIVERS:.c=.o}
34	ar crv $@ $?
35	ranlib $@
36
37${DRIVERS}: samachdep.h
38
39# depend on DEFS
40
41label.o machdep.o srt0.o: Makefile
42cons.o dca.o hil.o: Makefile
43ite.o ite_subr.o ite_dv.o ite_gb.o ite_hy.o ite_rb.o ite_tc.o: Makefile
44
45# startups
46
47srt0.o: srt0.c
48	${CC} -E ${INCPATH} ${DEFS} srt0.c | ${AS} -o srt0.o
49
50tpsrt0.o: srt0.c
51	${CC} -E ${INCPATH} ${DEFS} -DTP srt0.c | ${AS} -o tpsrt0.o
52
53# bootable from tape
54
55tboot:	tboot.o srt0.o ${LIBS}
56	ld -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBS} -o $@
57	@size tboot
58	@echo tboot total size should not exceed 1044480 bytes
59
60tboot.o: boot.o
61	cp boot.c tboot.c; chmod +w tboot.c
62	${CC} -c ${CFLAGS} -DJUSTASK tboot.c
63	rm -f tboot.c
64
65tcopy:	copy.o tpsrt0.o ${LIBS}
66	ld -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBS} -o $@
67	@size tcopy
68	@echo tcopy total size should not exceed 1044480 bytes
69
70# bootable from floppy or real disks
71
72dboot:	boot.o srt0.o bootconf.o ${LIBS}
73	ld -N -T ${RELOC} -e begin srt0.o boot.o bootconf.o ${LIBS} -o $@
74	@size dboot
75	@echo dboot text+data size should not exceed 57344 bytes
76	@echo dboot total size should not exceed 1044480 bytes
77
78bootconf.o: conf.o
79	rm -f bootconf.c
80	ln -s conf.c bootconf.c
81	${CC} -c ${CFLAGS} -DBOOT bootconf.c
82	rm -f bootconf.c
83
84# non-secure boot (allows booting non-root owned or world writable kernels)
85
86nboot:	nboot.o srt0.o bootconf.o ${LIBS}
87	ld -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBS}
88	@size nboot
89	@echo nboot text+data size should not exceed 57344 bytes
90	@echo nboot total size should not exceed 1044480 bytes
91
92nboot.o: boot.o
93	rm -f nboot.c
94	ln -s boot.c nboot.c
95	${CC} -c ${CFLAGS} -DINSECURE nboot.c
96	rm -f nboot.c
97
98dcopy:	copy.o srt0.o conf.o ${LIBS}
99	ld -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBS}
100
101mkboot: mkboot.c
102	${CC} ${CFLAGS} -o mkboot mkboot.c
103
104installboot: installboot.sh
105	@rm -f installboot
106	cp -p installboot.sh installboot
107
108# utilities
109
110clean cleandir:
111	rm -f .depend *.o *.exe *.i errs make.out
112	rm -f a.out boot cat tpboot tpcopy copy tpformat
113	rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
114	rm -f format drtest core sboot bootconf.c nboot.c
115	rm -f libdrive.a mkboot tboot tcopy dboot nboot installboot *.lif
116	cd libsa; make cleandir
117
118install: mkboot installboot ${ALL}
119	./mkboot dboot diskboot.lif
120	./mkboot nboot ndiskboot.lif
121	./mkboot tboot tcopy tapeboot.lif
122	install -o bin -g bin -m 555 installboot ${DESTDIR}/usr/mdec
123	install -o bin -g bin -m 444 diskboot.lif ${DESTDIR}/usr/mdec/rdboot
124	rm -f ${DESTDIR}/usr/mdec/bootrd
125	ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/bootrd
126	rm -f ${DESTDIR}/usr/mdec/sdboot
127	ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/sdboot
128	rm -f ${DESTDIR}/usr/mdec/bootsd
129	ln ${DESTDIR}/usr/mdec/sdboot ${DESTDIR}/usr/mdec/bootsd
130	install -o bin -g bin -m 444 tapeboot.lif ${DESTDIR}/usr/mdec/ctboot
131#	mv diskboot.lif ndiskboot.lif tapeboot.lif ${DESTDIR}/sys/hpdist/tp
132
133depend: ${SRCS}
134	mkdep ${INCPATH} ${DEFS} ${SRCS}
135	mkdep -a -p ${INCPATH} ${DEFS} mkboot.c
136	cd libsa; make depend
137
138FRC:
139