xref: /original-bsd/sys/hp300/stand/Makefile (revision 53fb7652)
1#	@(#)Makefile	7.8 (Berkeley) 05/08/91
2
3DESTDIR=
4STAND=	../../stand
5INCPATH=-I. -I${STAND} -I../../sys -I..
6VPATH=	${STAND}
7
8CC=	cc -fpcc-struct-return
9AS=as
10
11# RELOC=FFF80000 allows for boot prog up to 7F000 (520192) bytes long
12RELOC=	FFF80000
13
14CONS= -DDCACONSOLE -DITECONSOLE -DDCMCONSOLE
15DEFS= -DSTANDALONE ${CONS} # -DROMPRF
16CFLAGS=	-O ${INCPATH} ${DEFS}
17
18DRIVERS=autoconf.c cons.c ct.c dca.c dcm.c fhpib.c hil.c hpib.c ite.c \
19	ite_dv.c ite_gb.c ite_rb.c ite_subr.c ite_tc.c nhpib.c rd.c \
20	scsi.c sd.c
21SRCS=	conf.c machdep.c prf.c ${DRIVERS}
22LIBS=	libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a
23
24ALL=	dboot nboot tboot tcopy
25
26all: ${ALL}
27
28dboot nboot tboot tcopy: ${LIBS}
29
30libsa/libsa.a::
31	cd libsa; make
32
33libdrive.a: conf.o machdep.o prf.o ${DRIVERS:.c=.o}
34	ar crv $@ $?
35	ranlib $@
36
37${DRIVERS}: samachdep.h
38
39# startups
40
41srt0.o: srt0.c
42	${CC} -E ${INCPATH} ${DEFS} srt0.c | ${AS} -o srt0.o
43
44tpsrt0.o: srt0.c
45	${CC} -E ${INCPATH} ${DEFS} -DTP srt0.c | ${AS} -o tpsrt0.o
46
47# bootable from tape
48
49tboot:	tboot.o srt0.o ${LIBS}
50	ld -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBS} -o $@
51	@size tboot
52	@echo tboot total size should not exceed 520192 bytes
53
54tboot.o: boot.o
55	cp boot.c tboot.c; chmod +w tboot.c
56	${CC} -c -O ${INCPATH} -DJUSTASK tboot.c
57	rm -f tboot.c
58
59tcopy:	copy.o tpsrt0.o ${LIBS}
60	ld -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBS} -o $@
61	@size tcopy
62	@echo tcopy total size should not exceed 520192 bytes
63
64# bootable from floppy or real disks
65
66dboot:	boot.o srt0.o bootconf.o ${LIBS}
67	ld -N -T ${RELOC} -e begin srt0.o boot.o bootconf.o ${LIBS} -o $@
68	@size dboot
69	@echo dboot text+data size should not exceed 57344 bytes
70	@echo dboot total size should not exceed 520192 bytes
71
72bootconf.o: conf.o
73	rm -f bootconf.c
74	ln -s conf.c bootconf.c
75	${CC} -c ${INCPATH} -DBOOT bootconf.c
76	rm -f bootconf.c
77
78# non-secure boot
79
80nboot:	nboot.o srt0.o bootconf.o ${LIBS}
81	ld -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBS}
82	@size nboot
83	@echo nboot text+data size should not exceed 57344 bytes
84	@echo nboot total size should not exceed 520192 bytes
85
86nboot.o: boot.o
87	rm -f nboot.c
88	ln -s boot.c nboot.c
89	${CC} -c -O ${INCPATH} -DINSECURE ${DEFS} nboot.c
90	rm -f nboot.c
91
92dcopy: copy.o srt0.o conf.o ${LIBS}
93	ld -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBS}
94
95mkboot: mkboot.c
96	${CC} ${CFLAGS} -o mkboot mkboot.c
97
98installboot: installboot.c
99	${CC} ${CFLAGS} -o installboot installboot.c
100
101# utilities
102
103clean:
104	rm -f *.o *.exe *.i errs make.out
105	rm -f a.out boot cat tpboot tpcopy copy tpformat
106	rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
107	rm -f format drtest core sboot bootconf.c nboot.c
108	rm -f libdrive.a mkboot tboot tcopy dboot nboot installboot *.lif
109	cd libsa; make cleandir
110
111lint:
112	lint ${INCPATH} -hxbn boot.c ${SRCS} | \
113	    grep -v 'possible pointer alignment' | \
114	    grep -v 'struct/union .* never defined'
115
116install: mkboot installboot ${ALL}
117	mkboot dboot diskboot.lif
118	mkboot nboot ndiskboot.lif
119	mkboot tboot tcopy tapeboot.lif
120	install -c -s installboot ${DESTDIR}/usr/mdec
121	install -c -m 644 diskboot.lif ${DESTDIR}/usr/mdec/bootrd
122	rm -f ${DESTDIR}/usr/mdec/bootsd
123	ln ${DESTDIR}/usr/mdec/bootrd ${DESTDIR}/usr/mdec/bootsd
124	install -c -m 644 tapeboot.lif ${DESTDIR}/usr/mdec/bootct
125	mv diskboot.lif ndiskboot.lif tapeboot.lif ${DESTDIR}/sys/hpdist/tp
126
127depend: ${SRCS}
128	mkdep ${INCPATH} -DSTANDALONE ${SRCS}
129