summaryrefslogtreecommitdiff
path: root/sys/src/boot/pc/mkfile
blob: 34e2e1f5247a9c16c0953249a04af3ab7a521ba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
objtype=386
</$objtype/mkfile
BIN=/386

TARG=\
	9load\
	9loadask\
	9loaddebug\
	9loadlite\
	9loadlitedebug\
	9loadusb\
	9pxeload\
	9pxeloaddebug\
	mbr\
	pbs\
	pbslba\

CORE=\
	alarm.$O\
	cga.$O\
	clock.$O\
	console.$O\
	dosboot.$O\
	devfloppy.$O\
	dma.$O\
	fs.$O\
	ilock.$O\
	kbd.$O\
	kfsboot.$O\
	print.$O\
	queue.$O\
	trap.$O\

LOAD=\
	8250.$O\
	apm.$O\
	boot.$O\
	cis.$O\
	conf.$O\
	devbios.$O\
	devi82365.$O\
	devpccard.$O\
	devsd.$O\
	inflate.$O\
	load.$O\
	memory.$O\
	part.$O\
	pci.$O\
	sdata.$O\
	sdmylex.$O\
	sd53c8xx.$O\
	sdiahci.$O\
	sdscsi.$O\
	sdaoe.$O\
	sdbios.$O\

ETHER=\
	bootp.$O\
	ether.$O\
	ether2114x.$O\
	ether2000.$O\
	ether589.$O\
	ether79c970.$O\
	ether8003.$O\
	ether8139.$O\
	ether8169.$O\
	ether82563.$O\
	ether82557.$O\
	ether83815.$O\
	ether8390.$O\
	etherec2t.$O\
	etherelnk3.$O\
	etherigbe.$O\
	ethermii.$O\
	etherrhine.$O\
	etherdp83820.$O\

BCOM=\
	bcom.$O\
	bootld.$O\
	devsd.$O\
	memory.$O\
	part.$O\
	pci.$O\
	sdata.$O\
	sdscsi.$O\

HFILES=\
	lib.h\
	mem.h\
	dat.h\
	fns.h\
	io.h\
	aoe.h\

CFLAGS=-FTVw -I.

all:V:	$TARG

9load:	l.$O $CORE $LOAD $ETHER nobiosload.$O
	$LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc -lip
	ls -l $target

9pxeload:	lpxe.$O $CORE $LOAD $ETHER nobiosload.$O
	$LD -o $target -H3 -T0x80007C00 -l $prereq -lflate -lc -lip
	ls -l $target

9loaddebug:	l.$O $CORE $LOAD $ETHER nobiosload.$O
	$LD -o $target -T0x80010000 -l $prereq -lflate -lc -lip
	ls -l $target
	# acid $target
	# map({"text", 0x80010000, 0x80090000, 0x00000020})

9pxeloaddebug:	lpxe.$O $CORE $LOAD $ETHER nobiosload.$O
	$LD -o $target -T0x80007C00 -l $prereq -lflate -lc -lip
	ls -l $target
	# acid $target
	# map({"text", 0x80010000, 0x80090000, 0x00000020})

9loadlite:	l.$O $CORE $LOAD noether.$O nobiosload.$O
	$LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc
	ls -l $target

9loadlitedebug:	l.$O $CORE $LOAD noether.$O nobiosload.$O
	$LD -o $target -T0x80010000 -l $prereq -lflate -lc
	ls -l $target
	# acid $target
	# map({"text", 0x80010000, 0x80090000, 0x00000020})

9loadusb:	l.$O $CORE $LOAD $ETHER biosload.$O
	$LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc -lip
	ls -l $target

9loadask:	l.$O $CORE $LOAD $ETHER askbiosload.$O
	$LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc -lip
	ls -l $target

ld.com:	ld.$O $CORE $BCOM
	$LD -o $target -H3 -T0x80080100 -l $prereq -lc
	ls -l $target

lddebug:	ld.$O $CORE $BCOM
	$LD -o $target -T0x80080100 -l $prereq -lc
	ls -l $target
	# acid $target
	# map({"text", 0x80080100, 0x800B0000, 0x00000020})

ld.$O:	l.s
	$AS -DDOTCOM -o $target l.s

l.$O: l.s
	$AS -DVGA -o $target l.s

lpxe.$O: l.s
	$AS -DPXE -DVGA -o $target l.s

lnovga.$O: l.s
	$AS -o $target l.s

lpxenovga.$O: l.s
	$AS -DPXE -o $target l.s

loadverb.$O: load.c
	$CC -o $target $CFLAGS '-DVERBOSE=1' load.c

%.$O:	%.s
	$AS $stem.s

%.$O:	%.c
	$CC $CFLAGS $stem.c

%.$O:	$HFILES

l.$O pbs.$O pbslba.$O mbr.$O:	x16.h

clock.$O floppy.$O trap.$O:	ureg.h
bcom.$O conf.$O devfloppy.$O devsd.$O dosboot.$O fs.$O \
	kfsboot.$O load.$O part.$O:	dosfs.h fs.h kfs.h
ether.$O etherelnk3.$O:	etherif.h
devsd.$O part.$O sdata.$O sdscsi.$O: sd.h
bootp.$O:	ip.h

mbr:	mbr.$O
	$LD -o $target -H3 -T0x0600 -l $prereq
	ls -l $target

pbs&:	pbs%.$O
	$LD -o $target -H3 -T0x7C00 -l $prereq
	ls -l $target

pbs&.debug:	pbs%.$O
	$LD -o $target -T0x7C00 -l $prereq
	ls -l $target
	# acid $target
	# map({"text", 0x7C00, 0x7E00, 0x00000020})
	
clean:
	rm -f *.[$OS] [$OS].out y.tab.? y.debug y.output $TARG 9loaddebug lddebug

install:V:
	for (i in $TARG)
		mk $MKFLAGS $i.install

%.install:V:	$BIN/%
#	for (fs in $EXTRACOPIES)
#		9fs $fs && cp $prereq /n/$fs/$prereq
	;

$BIN/%:	%
	cp $stem $BIN/$stem

UPDATE=\
	mkfile\
	${CORE:%.$O=%.c}\
	${LOAD:%.$O=%.c}\
	${BCOM:%.$O=%.c}\
	${ETHER:%.$O=%.c}\
	$HFILES\
	l.s\
	noether.c\
	pbs.s\
	pbslba.s\
	mbr.s\
	x16.h\
	ureg.h\
	dosfs.h\
	fs.h\
	kfs.h\
	etherif.h\
	sd.h\
	ip.h\
	devfloppy.h\
	${TARG:%=/386/%}\

update:V:
	update $UPDATEFLAGS $UPDATE