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