xref: /plan9-contrib/sys/src/boot/pc/mkfile (revision 25fc69938fdecc61cd09e795cbe2d2f72f1082b1)
1objtype=386
2</$objtype/mkfile
3BIN=/386
4
5TARG=\
6	9load\
7	9loaddebug\
8	9loadlite\
9	9loadlitedebug\
10	9pxeload\
11	9pxeloaddebug\
12	ld.com\
13	mbr\
14	pbs\
15	pbslba\
16
17CORE=\
18	alarm.$O\
19	cga.$O\
20	clock.$O\
21	console.$O\
22	dosboot.$O\
23	devfloppy.$O\
24	dma.$O\
25	fs.$O\
26	ilock.$O\
27	kbd.$O\
28	kfsboot.$O\
29	print.$O\
30	queue.$O\
31	trap.$O\
32
33LOAD=\
34	8250.$O\
35	apm.$O\
36	boot.$O\
37	cis.$O\
38	conf.$O\
39	devbios.$O\
40	devi82365.$O\
41	devpccard.$O\
42	devsd.$O\
43	inflate.$O\
44	load.$O\
45	memory.$O\
46	part.$O\
47	pci.$O\
48	sdata.$O\
49	sdmylex.$O\
50	sd53c8xx.$O\
51	sdiahci.$O\
52	sdscsi.$O\
53	sdaoe.$O\
54	sdbios.$O\
55
56ETHER=\
57	bootp.$O\
58	ether.$O\
59	ether2114x.$O\
60	ether2000.$O\
61	ether589.$O\
62	ether79c970.$O\
63	ether8003.$O\
64	ether8139.$O\
65	ether8169.$O\
66	ether82563.$O\
67	ether82557.$O\
68	ether83815.$O\
69	ether8390.$O\
70	etherec2t.$O\
71	etherelnk3.$O\
72	etherigbe.$O\
73	ethermii.$O\
74	etherrhine.$O\
75	etherdp83820.$O\
76
77BCOM=\
78	bcom.$O\
79	bootld.$O\
80	devsd.$O\
81	memory.$O\
82	part.$O\
83	pci.$O\
84	sdata.$O\
85	sdscsi.$O\
86
87HFILES=\
88	lib.h\
89	mem.h\
90	dat.h\
91	fns.h\
92	io.h\
93	aoe.h\
94
95CFLAGS=-FTVw -I.
96
97all:V:	$TARG
98
999load:	l.$O $CORE $LOAD $ETHER
100	$LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc -lip
101	ls -l $target
102
1039pxeload:	lpxe.$O $CORE $LOAD $ETHER
104	$LD -o $target -H3 -T0x80007C00 -l $prereq -lflate -lc -lip
105	ls -l $target
106
1079loaddebug:	l.$O $CORE $LOAD $ETHER
108	$LD -o $target -T0x80010000 -l $prereq -lflate -lc -lip
109	ls -l $target
110	# acid $target
111	# map({"text", 0x80010000, 0x80090000, 0x00000020})
112
1139pxeloaddebug:	lpxe.$O $CORE $LOAD $ETHER
114	$LD -o $target -T0x80007C00 -l $prereq -lflate -lc -lip
115	ls -l $target
116	# acid $target
117	# map({"text", 0x80010000, 0x80090000, 0x00000020})
118
1199loadlite:	l.$O $CORE $LOAD noether.$O
120	$LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc
121	ls -l $target
122
1239loadlitedebug:	l.$O $CORE $LOAD noether.$O
124	$LD -o $target -T0x80010000 -l $prereq -lflate -lc
125	ls -l $target
126	# acid $target
127	# map({"text", 0x80010000, 0x80090000, 0x00000020})
128
129ld.com:	ld.$O $CORE $BCOM
130	$LD -o $target -H3 -T0x80080100 -l $prereq -lc
131	ls -l $target
132
133lddebug:	ld.$O $CORE $BCOM
134	$LD -o $target -T0x80080100 -l $prereq -lc
135	ls -l $target
136	# acid $target
137	# map({"text", 0x80080100, 0x800B0000, 0x00000020})
138
139ld.$O:	l.s
140	$AS -DDOTCOM -o $target l.s
141
142l.$O: l.s
143	$AS -DVGA -o $target l.s
144
145lpxe.$O: l.s
146	$AS -DPXE -DVGA -o $target l.s
147
148lnovga.$O: l.s
149	$AS -o $target l.s
150
151lpxenovga.$O: l.s
152	$AS -DPXE -o $target l.s
153
154loadverb.$O: load.c
155	$CC -o $target $CFLAGS '-DVERBOSE=1' load.c
156
157%.$O:	%.s
158	$AS $stem.s
159
160%.$O:	%.c
161	$CC $CFLAGS $stem.c
162
163%.$O:	$HFILES
164
165l.$O pbs.$O pbslba.$O mbr.$O:	x16.h
166
167clock.$O floppy.$O trap.$O:	ureg.h
168bcom.$O conf.$O devfloppy.$O devsd.$O dosboot.$O fs.$O \
169	kfsboot.$O load.$O part.$O:	dosfs.h fs.h kfs.h
170ether.$O etherelnk3.$O:	etherif.h
171devsd.$O part.$O sdata.$O sdscsi.$O: sd.h
172bootp.$O:	ip.h
173
174mbr:	mbr.$O
175	$LD -o $target -H3 -T0x0600 -l $prereq
176	ls -l $target
177
178pbs&:	pbs%.$O
179	$LD -o $target -H3 -T0x7C00 -l $prereq
180	ls -l $target
181
182pbs&.debug:	pbs%.$O
183	$LD -o $target -T0x7C00 -l $prereq
184	ls -l $target
185	# acid $target
186	# map({"text", 0x7C00, 0x7E00, 0x00000020})
187
188clean:
189	rm -f *.[$OS] [$OS].out y.tab.? y.debug y.output $TARG 9loaddebug lddebug
190
191install:V:
192	for (i in $TARG)
193		mk $MKFLAGS $i.install
194
195%.install:V:	$BIN/%
196	# import lookout / /n/lookout
197	# cp $prereq /n/lookout/$prereq
198
199$BIN/%:	%
200	cp $stem $BIN/$stem
201
202UPDATE=\
203	mkfile\
204	${CORE:%.$O=%.c}\
205	${LOAD:%.$O=%.c}\
206	${BCOM:%.$O=%.c}\
207	${ETHER:%.$O=%.c}\
208	$HFILES\
209	l.s\
210	noether.c\
211	pbs.s\
212	pbslba.s\
213	mbr.s\
214	x16.h\
215	ureg.h\
216	dosfs.h\
217	fs.h\
218	kfs.h\
219	etherif.h\
220	sd.h\
221	ip.h\
222	devfloppy.h\
223	${TARG:%=/386/%}\
224
225update:V:
226	update $UPDATEFLAGS $UPDATE
227
228