BSD 4_4 release
[unix-history] / usr / src / sys / i386 / stand / Makefile
CommitLineData
ad787160 1# @(#)Makefile 8.1 (Berkeley) 6/11/93
abd458bc 2
a6f3e3ef 3DESTDIR=/
3d25fe73
KB
4STAND= ../../stand
5INCPATH=-I../../sys -I../../ -I${STAND}
6VPATH= ${STAND}
93cd703d 7STANDDIR= ${DESTDIR}/stand
d3fdcf07 8
3d25fe73
KB
9CC= cc -traditional
10C2= /usr/libexec/c2
11CPP= cpp -traditional ${INCPATH} -DSTANDALONE -DAT386
d3fdcf07 12
a6f3e3ef 13RELOC= 70000
abd458bc 14RELOC2= 70200
d3fdcf07
KB
15
16CFLAGS= -DSTANDALONE -DAT386 -O ${INCPATH}
17
18DRIVERS=cga.c fd.c kbd.c wd.c
d3fdcf07
KB
19SRCS= boot.c bootxx.c conf.c confxx.c copy.c fd.c fdbootblk.c prf.c \
20 srt0.c wdbootblk.c ${DRIVERS} ${SASRC}
399c5f4b
KB
21LIBS= libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a
22SMLIBS= libsmsa/libsmsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a
a6f3e3ef 23
abd458bc 24BOOTBLOCKS= wdboot bootwd fdboot bootfd
3d25fe73 25DISKUTILS= boot copy cat ls
a6f3e3ef
WN
26ALL= ${BOOTBLOCKS} ${DISKUTILS}
27
a6f3e3ef
WN
28all: ${ALL}
29
399c5f4b
KB
30libsa/libsa.a::
31 cd libsa; make
32libsmsa/libsmsa.a::
33 cd libsmsa; make
93cd703d
KB
34
35libdrive.a: conf.o prf.o ${DRIVERS:.c=.o}
70fe68aa
KB
36 ar crv $@ $?
37 ranlib $@
a6f3e3ef 38
a6f3e3ef
WN
39# startups
40
41srt0.o: srt0.c
abd458bc 42 ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} srt0.c | ${AS} -o srt0.o
a6f3e3ef 43
abd458bc 44wsrt0.o: srt0.c
3d25fe73
KB
45 ${CPP} -E -DLOCORE -DSMALL -DRELOC=0x${RELOC} -DREL srt0.c | \
46 ${AS} -o wsrt0.o
a6f3e3ef 47
abd458bc 48relsrt0.o: srt0.c
3d25fe73 49 ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} -DREL srt0.c | ${AS} -o relsrt0.o
a6f3e3ef 50
abd458bc 51# block 0 boots
a6f3e3ef 52
abd458bc 53wdbootblk.o: wdbootblk.c
3d25fe73 54 ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} wdbootblk.c | ${AS} -o $@
a6f3e3ef 55
abd458bc 56fdbootblk.o: fdbootblk.c
3d25fe73 57 ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} fdbootblk.c | ${AS} -o $@
a6f3e3ef
WN
58
59# bootable from floppy or real disks
60
70fe68aa
KB
61boot: boot.o bootconf.o cga.o relsrt0.o ${LIBS}
62 ld -N -T ${RELOC} -o $@ boot.o bootconf.o cga.o relsrt0.o ${LIBS}
a6f3e3ef
WN
63
64bootconf.o: conf.o
3d25fe73 65 ln -s conf.c bootconf.c
a6f3e3ef
WN
66 ${CC} -c ${CFLAGS} -DBOOT bootconf.c
67 rm -f bootconf.c
68
3d25fe73
KB
69# utilities
70
70fe68aa
KB
71cat: cat.o srt0.o conf.o ${LIBS}
72 ld -N -o $@ srt0.o cat.o conf.o ${LIBS}
a6f3e3ef 73
70fe68aa
KB
74ls: ls.o srt0.o conf.o ${LIBS}
75 ld -N -o $@ srt0.o ls.o conf.o ${LIBS}
a6f3e3ef 76
70fe68aa
KB
77copy: copy.o srt0.o conf.o ${LIBS}
78 ld -N -o $@ srt0.o copy.o conf.o ${LIBS}
a6f3e3ef
WN
79
80# getting booted from disc
81
abd458bc
WN
82wdboot: wdbootblk.o
83 ld -N -T ${RELOC} wdbootblk.o
84 cp a.out wdb
85 rm -f wdboot
86 strip a.out;dd if=a.out of=wdboot ibs=32 skip=1;rm -f a.out
87 ls -l wdboot
88
93cd703d
KB
89bootwd: wdbootblk.o wsrt0.o bootxx.o sm_confwd.o sm_wd.o sm_cga.o ${SMLIBS}
90 ld -N -T ${RELOC2} wsrt0.o bootxx.o sm_confwd.o sm_wd.o \
91 sm_cga.o ${SMLIBS}
a6f3e3ef 92 size a.out
abd458bc
WN
93 cp a.out bwd
94 rm -f bootwd
a6f3e3ef
WN
95 strip a.out;dd if=a.out of=bootwd ibs=32 skip=1;rm -f a.out
96 ls -l bootwd
97
abd458bc
WN
98fdboot: fdbootblk.o
99 ld -N -T ${RELOC} fdbootblk.o
100 cp a.out fdb
101 rm -f fdboot
102 strip a.out;dd if=a.out of=fdboot ibs=32 skip=1;rm -f a.out
103 ls -l fdboot
a6f3e3ef 104
93cd703d
KB
105bootfd: fdbootblk.o wsrt0.o bootxx.o fd.o sm_cga.o sm_conffd.o ${SMLIBS}
106 ld -N -T ${RELOC2} wsrt0.o bootxx.o fd.o sm_cga.o sm_conffd.o ${SMLIBS}
a6f3e3ef 107 size a.out
abd458bc
WN
108 cp a.out bfd
109 rm -f bootfd
110 strip a.out; dd if=a.out of=bootfd ibs=32 skip=1;rm -f a.out
111 ls -l bootfd
a6f3e3ef 112
93cd703d
KB
113sm_conffd.o: conffd.c
114 rm -f sm_conffd.c
115 ln -s conffd.c sm_conffd.c
116 ${CC} -S -DSMALL ${CFLAGS} sm_conffd.c
117 ${AS} sm_conffd.s -o sm_conffd.o
118 rm -f sm_conffd.s sm_conffd.c
119
120sm_confwd.o: confwd.c
121 rm -f sm_confwd.c
122 ln -s confwd.c sm_confwd.c
123 ${CC} -S -DSMALL ${CFLAGS} sm_confwd.c
124 ${AS} sm_confwd.s -o sm_confwd.o
125 rm -f sm_confwd.s sm_confwd.c
126
127sm_cga.o: cga.c
3d25fe73
KB
128 rm -f sm_cga.c
129 ln -s cga.c sm_cga.c
abd458bc
WN
130 ${CC} -S -DSMALL ${CFLAGS} sm_cga.c
131 ${AS} sm_cga.s -o sm_cga.o
132 rm -f sm_cga.s sm_cga.c
133
93cd703d
KB
134sm_wd.o: wd.c
135 rm -f sm_wd.c
136 ln -s wd.c sm_wd.c
137 ${CC} -S -DSMALL ${CFLAGS} sm_wd.c
138 ${AS} sm_wd.s -o sm_wd.o
139 rm -f sm_wd.s sm_wd.c
3d25fe73 140
a6f3e3ef 141confwd.o: confwd.c confxx.o
abd458bc 142conffd.o: conffd.c confxx.o
a6f3e3ef
WN
143
144confxx.o:
145 touch confxx.o
146
147confwd.c: confxx.c
3d25fe73
KB
148 rm -f confwd.c
149 sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > confwd.c
150 sed -e 's/XX/wd/' -e 's/xx/wd/g' < confxx.c >> confwd.c
a6f3e3ef 151
abd458bc 152conffd.c: confxx.c
3d25fe73
KB
153 rm -f conffd.c
154 sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > conffd.c
155 sed -e 's/XX/fd/' -e 's/xx/fd/g' < confxx.c >> conffd.c
a6f3e3ef
WN
156
157clean:
93cd703d 158 rm -f *.o *.exe *.i sm_*.c libdrive.a
3d25fe73 159 rm -f a.out bfd bwd fdb wdb ${ALL}
a6f3e3ef
WN
160 rm -f boot[a-wyz]? boot[a-wyz]?? boot[a-wyz]?.c boot[a-wyz]??.c \
161 conf[a-wyz]?.c conf[a-wyz]??.c
162 rm -f format core sboot bootconf.c
399c5f4b
KB
163 cd libsa; make cleandir
164 cd libsmsa; make cleandir
a6f3e3ef 165
3d25fe73
KB
166cleandir: clean
167 rm -f ${MAN} tags .depend
168
169depend: ${SRCS}
170 mkdep ${INCPATH} -DSTANDALONE ${SRCS} ${DUMMIES}
a6f3e3ef
WN
171
172install: ${ALL}
173 install -c -s boot ${DESTDIR}
174 cp ${DISKUTILS} ../dist/floppy
175 cp ${TAPEUTILS} ../dist/tp
176 cp ${BOOTBLOCKS} ${STANDDIR}
177 cp ${DISKUTILS} ${STANDDIR}