|
|
1.1 root 1: # @(#)Makefile 7.9 (Berkeley) 5/8/91
2:
3: DESTDIR=/
4: STAND= ../../stand
5: INCPATH=-I../../sys -I../../ -I${STAND}
6: VPATH= ${STAND}
7: STANDDIR= ${DESTDIR}/stand
8:
9: CC= cc -traditional
10: C2= /usr/libexec/c2
11: CPP= cpp -traditional ${INCPATH} -DSTANDALONE -DAT386
12:
13: RELOC= 70000
14: RELOC2= 70200
15:
16: CFLAGS= -DSTANDALONE -DAT386 -O ${INCPATH}
17:
18: DRIVERS=cga.c fd.c kbd.c wd.c
19: SRCS= boot.c bootxx.c conf.c confxx.c copy.c fd.c fdbootblk.c prf.c \
20: srt0.c wdbootblk.c ${DRIVERS} ${SASRC}
21: LIBS= libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a
22: SMLIBS= libsmsa/libsmsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a
23:
24: BOOTBLOCKS= wdboot bootwd fdboot bootfd
25: DISKUTILS= boot copy cat ls
26: ALL= ${BOOTBLOCKS} ${DISKUTILS}
27:
28: all: ${ALL}
29:
30: libsa/libsa.a::
31: cd libsa; make
32: libsmsa/libsmsa.a::
33: cd libsmsa; make
34:
35: libdrive.a: conf.o prf.o ${DRIVERS:.c=.o}
36: ar crv $@ $?
37: ranlib $@
38:
39: # startups
40:
41: srt0.o: srt0.c
42: ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} srt0.c | ${AS} -o srt0.o
43:
44: wsrt0.o: srt0.c
45: ${CPP} -E -DLOCORE -DSMALL -DRELOC=0x${RELOC} -DREL srt0.c | \
46: ${AS} -o wsrt0.o
47:
48: relsrt0.o: srt0.c
49: ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} -DREL srt0.c | ${AS} -o relsrt0.o
50:
51: # block 0 boots
52:
53: wdbootblk.o: wdbootblk.c
54: ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} wdbootblk.c | ${AS} -o $@
55:
56: fdbootblk.o: fdbootblk.c
57: ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} fdbootblk.c | ${AS} -o $@
58:
59: # bootable from floppy or real disks
60:
61: boot: boot.o bootconf.o cga.o relsrt0.o ${LIBS}
62: ld -N -T ${RELOC} -o $@ boot.o bootconf.o cga.o relsrt0.o ${LIBS}
63:
64: bootconf.o: conf.o
65: ln -s conf.c bootconf.c
66: ${CC} -c ${CFLAGS} -DBOOT bootconf.c
67: rm -f bootconf.c
68:
69: # utilities
70:
71: cat: cat.o srt0.o conf.o ${LIBS}
72: ld -N -o $@ srt0.o cat.o conf.o ${LIBS}
73:
74: ls: ls.o srt0.o conf.o ${LIBS}
75: ld -N -o $@ srt0.o ls.o conf.o ${LIBS}
76:
77: copy: copy.o srt0.o conf.o ${LIBS}
78: ld -N -o $@ srt0.o copy.o conf.o ${LIBS}
79:
80: # getting booted from disc
81:
82: wdboot: 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:
89: bootwd: 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}
92: size a.out
93: cp a.out bwd
94: rm -f bootwd
95: strip a.out;dd if=a.out of=bootwd ibs=32 skip=1;rm -f a.out
96: ls -l bootwd
97:
98: fdboot: 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
104:
105: bootfd: 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}
107: size a.out
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
112:
113: sm_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:
120: sm_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:
127: sm_cga.o: cga.c
128: rm -f sm_cga.c
129: ln -s cga.c sm_cga.c
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:
134: sm_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
140:
141: confwd.o: confwd.c confxx.o
142: conffd.o: conffd.c confxx.o
143:
144: confxx.o:
145: touch confxx.o
146:
147: confwd.c: confxx.c
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
151:
152: conffd.c: confxx.c
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
156:
157: clean:
158: rm -f *.o *.exe *.i sm_*.c libdrive.a
159: rm -f a.out bfd bwd fdb wdb ${ALL}
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
163: cd libsa; make cleandir
164: cd libsmsa; make cleandir
165:
166: cleandir: clean
167: rm -f ${MAN} tags .depend
168:
169: depend: ${SRCS}
170: mkdep ${INCPATH} -DSTANDALONE ${SRCS} ${DUMMIES}
171:
172: install: ${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}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.