BSD 4_3_Reno release
[unix-history] / usr / src / sys / hpstand / Makefile
CommitLineData
74652d1e
KM
1#
2# Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
3# All rights reserved.
4#
1c15e888
C
5# Redistribution and use in source and binary forms are permitted provided
6# that: (1) source distributions retain this entire copyright notice and
7# comment, and (2) distributions including binaries display the following
8# acknowledgement: ``This product includes software developed by the
9# University of California, Berkeley and its contributors'' in the
10# documentation or other materials provided with the distribution and in
11# all advertising materials mentioning features or use of this software.
12# Neither the name of the University nor the names of its contributors may
13# be used to endorse or promote products derived from this software without
14# specific prior written permission.
15# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
16# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
17# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
74652d1e 18#
1c15e888 19# @(#)Makefile 7.4 (Berkeley) 7/1/90
74652d1e 20#
74652d1e
KM
21DESTDIR=
22
23#CC=occ -Dconst= -Dvolatile= -Dsigned= -Dinline=
24#AS=oas
25
26CC=cc -Dconst=__const__ -Dvolatile=__volatile__ \
27 -Dsigned=__signed__ -Dinline=__inline__ -fpcc-struct-return
28AS=as
29
ed452f34 30INCPATH=-I. -I/usr/include -I../sys -I..
18239460 31CONS= -DDCACONSOLE -DITECONSOLE -DDCMCONSOLE
74652d1e
KM
32DEFS= -DSTANDALONE ${CONS} # -DROMPRF # -DDEBUG
33COPTS=
34CFLAGS= -O ${INCPATH} ${DEFS} ${COPTS}
35# RELOC=FFF80000 allows for boot prog up to 7F000 (520192) bytes long
36RELOC= FFF80000
37
38SRCS= sys.c conf.c prf.c machdep.c autoconf.c \
39 hpib.c nhpib.c fhpib.c rd.c ct.c scsi.c sd.c hil.c \
18239460 40 cons.c ite.c ite_subr.c ite_dv.c ite_gb.c ite_rb.c ite_tc.c dca.c dcm.c
74652d1e
KM
41DUMMIES=
42DRIVERS=autoconf.o hpib.o nhpib.o fhpib.o rd.o ct.o scsi.o sd.o hil.o \
18239460 43 cons.o ite.o ite_subr.o ite_dv.o ite_gb.o ite_rb.o ite_tc.o dca.o dcm.o
74652d1e
KM
44LIBSA= libsa.a
45
46ALL= dboot nboot tboot tcopy
47
48all: ${ALL}
49
50${LIBSA}: sys.o conf.o ${DRIVERS} prf.o machdep.o
51 ar crv ${LIBSA} $?
52 ranlib ${LIBSA}
53
54${DRIVERS}: samachdep.h
55 ${CC} -c ${CFLAGS} $*.c
56
57# startups
58
59srt0.o: srt0.c
60 ${CC} -E ${INCPATH} ${DEFS} ${COPTS} srt0.c | ${AS} -o srt0.o
61
62tpsrt0.o: srt0.c
63 ${CC} -E ${INCPATH} ${DEFS} ${COPTS} -DTP srt0.c | ${AS} -o tpsrt0.o
64
65# bootable from tape
66
67tboot: tboot.o srt0.o ${LIBSA}
50bb203b 68 ld -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBSA} -lc -o tboot
74652d1e
KM
69 @size tboot
70 @echo tboot total size should not exceed 520192 bytes
71
50bb203b 72tboot.o: boot.o
74652d1e
KM
73 cp boot.c tboot.c; chmod +w tboot.c
74 ${CC} -c -O ${INCPATH} ${COPTS} -DJUSTASK tboot.c
75 rm -f tboot.c
76
77tcopy: copy.o tpsrt0.o ${LIBSA}
50bb203b 78 ld -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBSA} -lc -o tcopy
74652d1e
KM
79 @size tcopy
80 @echo tcopy total size should not exceed 520192 bytes
81
82# bootable from floppy or real disks
83
84dboot: boot.o srt0.o bootconf.o ${LIBSA}
50bb203b 85 ld -N -T ${RELOC} -e begin -o dboot srt0.o boot.o bootconf.o ${LIBSA} -lc
74652d1e
KM
86 @size dboot
87 @echo dboot text+data size should not exceed 57344 bytes
88 @echo dboot total size should not exceed 520192 bytes
89
90bootconf.o: conf.o
91 cp conf.c bootconf.c
92 ${CC} -c ${INCPATH} ${COPTS} -DBOOT bootconf.c
93 rm -f bootconf.c
94
95# non-secure boot
96
97nboot: nboot.o srt0.o bootconf.o ${LIBSA}
50bb203b 98 ld -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBSA} -lc
74652d1e
KM
99 @size nboot
100 @echo nboot text+data size should not exceed 57344 bytes
101 @echo nboot total size should not exceed 520192 bytes
102
50bb203b 103nboot.o: boot.o
74652d1e
KM
104 cp boot.c nboot.c; chmod +w nboot.c
105 ${CC} -c -O ${INCPATH} ${COPTS} -DINSECURE ${DEFS} nboot.c
106 rm -f nboot.c
107
108dcopy: copy.o srt0.o conf.o ${LIBSA}
50bb203b 109 ld -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBSA} -lc
74652d1e
KM
110
111mkboot: mkboot.c
112 ${CC} ${CFLAGS} -o mkboot mkboot.c
113
114installboot: installboot.c
115 ${CC} ${CFLAGS} -o installboot installboot.c
116
117# utilities
118
119print:
120 @pr makefile
121 @ls -l | pr
122 @pr *.h *.c
123
124clean:
125 rm -f *.o *.exe *.i errs make.out
126 rm -f a.out boot cat tpboot tpcopy copy tpformat
127 rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
128 rm -f format drtest core sboot bootconf.c
129 rm -f libsa.a mkboot tboot tcopy dboot nboot installboot *.lif
130
131lint:
132 lint ${INCPATH} ${COPTS} -hxbn boot.c ${SRCS} | \
133 grep -v 'possible pointer alignment' | \
134 grep -v 'struct/union .* never defined'
135
136install: mkboot installboot ${ALL}
137 mkboot dboot diskboot.lif
138 mkboot nboot ndiskboot.lif
139 mkboot tboot tcopy tapeboot.lif
140 install -c -s installboot ${DESTDIR}/usr/mdec
141 install -c -m 644 diskboot.lif ${DESTDIR}/usr/mdec/bootrd
142 rm -f ${DESTDIR}/usr/mdec/bootsd
143 ln ${DESTDIR}/usr/mdec/bootrd ${DESTDIR}/usr/mdec/bootsd
144 install -c -m 644 tapeboot.lif ${DESTDIR}/usr/mdec/bootct
145 mv diskboot.lif ndiskboot.lif tapeboot.lif ${DESTDIR}/sys/hpdist/tp
146
50bb203b
MK
147depend: ${SRCS}
148 mkdep ${INCPATH} -DSTANDALONE ${SRCS} ${DUMMIES}