fd -> vn
[unix-history] / usr / src / sys / hp300 / stand / Makefile
CommitLineData
58751a5f 1# @(#)Makefile 7.7 (Berkeley) %G%
74652d1e 2
aa4cff4a
KB
3DESTDIR=
4STAND= ../../stand
5INCPATH=-I. -I${STAND} -I../../sys -I..
6VPATH= ${STAND}
74652d1e 7
aa4cff4a 8CC= cc -fpcc-struct-return
74652d1e
KM
9AS=as
10
74652d1e
KM
11# RELOC=FFF80000 allows for boot prog up to 7F000 (520192) bytes long
12RELOC= FFF80000
13
aa4cff4a
KB
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
ebe56e3d
KB
21SRCS= conf.c machdep.c prf.c ${DRIVERS}
22LIBS= ${STAND}/obj/libsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a
74652d1e
KM
23
24ALL= dboot nboot tboot tcopy
25
26all: ${ALL}
27
ebe56e3d
KB
28dboot nboot tboot tcopy: ${STAND}/obj/libsa.a libdrive.a
29
30${STAND}/obj/libsa.a:
31 cd ${STAND}; make
32
33libdrive.a: conf.o machdep.o prf.o ${DRIVERS:.c=.o}
aa4cff4a
KB
34 ar crv $@ $?
35 ranlib $@
74652d1e
KM
36
37${DRIVERS}: samachdep.h
74652d1e
KM
38
39# startups
40
41srt0.o: srt0.c
aa4cff4a 42 ${CC} -E ${INCPATH} ${DEFS} srt0.c | ${AS} -o srt0.o
74652d1e
KM
43
44tpsrt0.o: srt0.c
aa4cff4a 45 ${CC} -E ${INCPATH} ${DEFS} -DTP srt0.c | ${AS} -o tpsrt0.o
74652d1e
KM
46
47# bootable from tape
48
aa4cff4a
KB
49tboot: tboot.o srt0.o ${LIBS}
50 ld -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBS} -o $@
74652d1e
KM
51 @size tboot
52 @echo tboot total size should not exceed 520192 bytes
53
50bb203b 54tboot.o: boot.o
74652d1e 55 cp boot.c tboot.c; chmod +w tboot.c
aa4cff4a 56 ${CC} -c -O ${INCPATH} -DJUSTASK tboot.c
74652d1e
KM
57 rm -f tboot.c
58
aa4cff4a
KB
59tcopy: copy.o tpsrt0.o ${LIBS}
60 ld -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBS} -o $@
74652d1e
KM
61 @size tcopy
62 @echo tcopy total size should not exceed 520192 bytes
63
64# bootable from floppy or real disks
65
aa4cff4a
KB
66dboot: boot.o srt0.o bootconf.o ${LIBS}
67 ld -N -T ${RELOC} -e begin srt0.o boot.o bootconf.o ${LIBS} -o $@
74652d1e
KM
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
aa4cff4a
KB
73 rm -f bootconf.c
74 ln -s conf.c bootconf.c
75 ${CC} -c ${INCPATH} -DBOOT bootconf.c
74652d1e
KM
76 rm -f bootconf.c
77
78# non-secure boot
79
aa4cff4a
KB
80nboot: nboot.o srt0.o bootconf.o ${LIBS}
81 ld -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBS}
74652d1e
KM
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
50bb203b 86nboot.o: boot.o
aa4cff4a
KB
87 rm -f nboot.c
88 ln -s boot.c nboot.c
89 ${CC} -c -O ${INCPATH} -DINSECURE ${DEFS} nboot.c
74652d1e
KM
90 rm -f nboot.c
91
aa4cff4a
KB
92dcopy: copy.o srt0.o conf.o ${LIBS}
93 ld -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBS}
74652d1e
KM
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
74652d1e
KM
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
aa4cff4a 107 rm -f format drtest core sboot bootconf.c nboot.c
ebe56e3d 108 rm -f libdrive.a mkboot tboot tcopy dboot nboot installboot *.lif
58751a5f 109 cd ${STAND}; make clean
74652d1e
KM
110
111lint:
aa4cff4a 112 lint ${INCPATH} -hxbn boot.c ${SRCS} | \
74652d1e
KM
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
50bb203b 127depend: ${SRCS}
aa4cff4a 128 mkdep ${INCPATH} -DSTANDALONE ${SRCS}