blob: a411dd1ad51a9b8d877a5bea6bb01764d974b5cf (
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
# This Makefile defines the build rules for the directory uts/i86pc
# and its children. These are the source files which are i86pc
# "implementation architecture" dependent.
#
# The following two-level ordering must be maintained in this file.
# Lines are sorted first in order of decreasing specificity based on
# the first directory component. That is, i86pc rules come before
# intel rules come before common rules.
#
# Lines whose initial directory components are equal are sorted
# alphabetically by the remaining components.
#
# Section 1a: C object build rules
#
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/conf/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/cpu/amd_opteron/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/cpu/authenticamd/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/cpu/generic_cpu/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/cpu/genuineintel/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/intel_nb5000/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/battery/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/mc/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pci/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pciex/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pcplusmp/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pcplusmp/%.s
$(COMPILE.s) -o $@ $<
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/ppm/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/ppm/%.s
$(COMPILE.s) -o $@ $<
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/psm/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/psm/%.s
$(COMPILE.s) -o $@ $<
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/tzmon/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/ml/%.s
$(COMPILE.s) -o $@ $<
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/os/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/vm/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/ppm/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/common/os/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(SRC)/common/dis/i386/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/gfx_private/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/xsvc/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
#
# dboot stuff is always 32 bit, linked to run with phys_addr == virt_addr
#
DBOOT_OBJS_DIR = dboot/$(OBJS_DIR)
DBOOT_MACH_32 = -D_BOOT_TARGET_i386
DBOOT_MACH_64 = -D_BOOT_TARGET_amd64
DBOOT_DEFS = -D_BOOT $(DBOOT_MACH_$(CLASS))
DBOOT_DEFS += -D_MACHDEP -D_KMEMUSER -U_KERNEL -D_I32LPx
DBOOT_CC_INCL = -I$(SRC)/common $(INCLUDE_PATH)
DBOOT_AS_INCL = $(AS_INC_PATH)
DBOOT_AS = $(ONBLD_TOOLS)/bin/$(MACH)/aw
DBOOT_LINTS_DIR = $(DBOOT_OBJS_DIR)
DBOOT_LINTFLAGS_i86pc = $(LINTFLAGS_i386_32) $(LINTTAGS_i386_32)
DBOOT_LINTFLAGS = $(DBOOT_LINTFLAGS_$(PLATFORM)) $(LINTTAGS) $(C99LMODE) \
$(CPPFLAGS) $(DBOOT_DEFS)
DBOOT_LOCAL_LINTFLAGS = -c -dirout=$(DBOOT_LINTS_DIR) -I$(SRC)/common \
$(DBOOT_LINTFLAGS) $(DBOOT_LINTTAGS)
$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c
$(i386_CC) $(CERRWARN) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.c
$(i386_CC) $(CERRWARN) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/%.s
$(DBOOT_AS) -P -D_ASM $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
$(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/%.c
$(i386_CC) $(CERRWARN) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
$(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/i386/%.s
$(DBOOT_AS) -P -D_ASM $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.s
$(DBOOT_AS) -P -D_ASM $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
#
# Stuff to build bios_call.o for the kernel.
#
MAPFILE_BIOS = $(UTSBASE)/i86pc/conf/Mapfile.bios
$(OBJS_DIR)/bios_call.o: $(UTSBASE)/i86pc/ml/bios_call_src.s
$(COMPILE.s) -o $(OBJS_DIR)/bios_call_src.o \
$(UTSBASE)/i86pc/ml/bios_call_src.s
$(LD) -dn -M $(MAPFILE_BIOS) \
-o $(OBJS_DIR)/bios_call_src $(OBJS_DIR)/bios_call_src.o
@echo " .data" > $(OBJS_DIR)/bios_call.s
@echo " .globl bios_image" >> $(OBJS_DIR)/bios_call.s
@echo "bios_image:" >> $(OBJS_DIR)/bios_call.s
$(ELFEXTRACT) $(OBJS_DIR)/bios_call_src >> $(OBJS_DIR)/bios_call.s
@echo " .align 4" >> $(OBJS_DIR)/bios_call.s
@echo " .globl bios_size" >> $(OBJS_DIR)/bios_call.s
@echo "bios_size:" >> $(OBJS_DIR)/bios_call.s
@echo " .long . - bios_image" >> $(OBJS_DIR)/bios_call.s
$(COMPILE.s) -o $@ $(OBJS_DIR)/bios_call.s
# ridiculous contortions ---
ATOMIC_SUBDIR_32 = i386
ATOMIC_SUBDIR_64 = amd64
ATOMIC_SUBDIR = $(ATOMIC_SUBDIR_$(CLASS))
$(OBJS_DIR)/%.o: $(SRC)/common/atomic/$(ATOMIC_SUBDIR)/%.s
$(COMPILE.s) -o $@ $<
$(OBJS_DIR)/%.o: $(SRC)/common/mc/mc-amd/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
#
# dtrace stubs
#
$(OBJS_DIR)/dtracestubs.s: $(UNIX_O) $(LIBS)
nm -u $(UNIX_O) $(LIBS) | grep __dtrace_probe_ | sort | uniq | nawk '{ \
printf("\t.globl %s\n\t.type %s,@function\n%s:\n", \
$$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
$(DTRACESTUBS): $(DTRACESTUBS_O)
$(BUILD.SO) $(DTRACESTUBS_O)
#
# Section 1b: Lint `object' build rules
#
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/conf/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/cpu/amd_opteron/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/cpu/authenticamd/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/cpu/generic_cpu/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/cpu/genuineintel/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/intel_nb5000/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/battery/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/mc/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/pci/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/pciex/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/pcplusmp/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/pcplusmp/%.s
@($(LHEAD) $(LINT.s) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/ppm/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/ppm/%.s
@($(LHEAD) $(LINT.s) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/psm/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/psm/%.s
@($(LHEAD) $(LINT.s) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/tzmon/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/ml/%.s
@($(LHEAD) $(LINT.s) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/os/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/boot/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/vm/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/ppm/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/os/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(SRC)/common/dis/i386/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(SRC)/common/atomic/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(SRC)/common/mc/mc-amd/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/gfx_private/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/xsvc/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
#
# bios call has a funky name change while building
#
$(LINTS_DIR)/bios_call.ln: $(UTSBASE)/i86pc/ml/bios_call_src.s
@($(LHEAD) $(LINT.s) $(UTSBASE)/i86pc/ml/bios_call_src.s $(LTAIL))
@mv $(LINTS_DIR)/bios_call_src.ln $(LINTS_DIR)/bios_call.ln
#
# dboot always compiles in 32-bit mode, so force lint to be 32-bit mode too.
#
$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/dboot/%.c
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/dboot/%.s
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/boot/%.c
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
$(DBOOT_LINTS_DIR)/%.ln: $(COMMONBASE)/util/%.c
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
$(DBOOT_LINTS_DIR)/%.ln: $(COMMONBASE)/util/i386/%.s
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
|