4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 # Copyright 2018 Joyent, Inc. All rights reserved.
25 # Copyright 2017 Nexenta Systems, Inc.
29 # This Makefile defines all file modules and build rules for the
30 # directory uts/intel and its children. These are the source files which
31 # are specific to the intel processor.
33 # The following two-level ordering must be maintained in this file.
34 # Lines are sorted first in order of decreasing specificity based on
35 # the first directory component. That is, sun4u rules come before
36 # sparc rules come before common rules.
38 # Lines whose initial directory components are equal are sorted
39 # alphabetically by the remaining components.
42 # Need a way to distinguish between the ia32 and amd64 subdirs.
45 SUBARCH_DIR_64 = amd64
46 SUBARCH_DIR = $(SUBARCH_DIR_$(CLASS))
49 # Section 1a: C object build rules
51 $(OBJS_DIR)/%.o: $(SRC)/common/fs/%.c
55 $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/power/%.c
59 $(OBJS_DIR)/%.o: $(SRC)/common/util/i386/%.s
62 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/brand/sn1/%.s
65 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/brand/solaris10/%.s
68 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/dtrace/%.c
72 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/dtrace/%.s
75 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/fs/proc/%.c
79 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/ml/%.s
82 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/os/%.c
86 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/promif/%.c
90 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/syscall/%.c
94 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/%.c
98 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/%.c
102 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/%.s
103 $(COMPILE.s) -o $@ $<
105 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/debugger/%.c
106 $(COMPILE.c) -o $@ $<
109 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/events/%.c
110 $(COMPILE.c) -o $@ $<
113 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/hardware/%.c
114 $(COMPILE.c) -o $@ $<
117 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/dispatcher/%.c
118 $(COMPILE.c) -o $@ $<
121 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/executer/%.c
122 $(COMPILE.c) -o $@ $<
125 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/parser/%.c
126 $(COMPILE.c) -o $@ $<
129 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/namespace/%.c
130 $(COMPILE.c) -o $@ $<
133 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/resources/%.c
134 $(COMPILE.c) -o $@ $<
137 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/tables/%.c
138 $(COMPILE.c) -o $@ $<
141 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/utilities/%.c
142 $(COMPILE.c) -o $@ $<
145 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/acpica/disassembler/%.c
146 $(COMPILE.c) -o $@ $<
149 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/agpgart/%.c
150 $(COMPILE.c) -o $@ $<
153 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/agpmaster/%.c
154 $(COMPILE.c) -o $@ $<
157 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/amd8111s/%.c
158 $(COMPILE.c) -o $@ $<
161 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/amr/%.c
162 $(COMPILE.c) -o $@ $<
165 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/drm/%.c
166 $(COMPILE.c) -o $@ $<
169 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/hotplug/pcicfg/%.c
170 $(COMPILE.c) -o $@ $<
173 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/ipmi/%.c
174 $(COMPILE.c) -o $@ $<
177 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/intel_nb5000/%.c
178 $(COMPILE.c) -o $@ $<
181 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/intel_nhm/%.c
182 $(COMPILE.c) -o $@ $<
185 $(OBJS_DIR)/%.o: $(SRC)/common/mc/mc-amd/%.c
186 $(COMPILE.c) -o $@ $<
189 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/mc-amd/%.c
190 $(COMPILE.c) -o $@ $<
193 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/pci/%.c
194 $(COMPILE.c) -o $@ $<
197 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/pciex/%.c
198 $(COMPILE.c) -o $@ $<
201 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/dktp/controller/ata/%.c
202 $(COMPILE.c) -o $@ $<
205 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/dktp/dcdev/%.c
206 $(COMPILE.c) -o $@ $<
209 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/dktp/disk/%.c
210 $(COMPILE.c) -o $@ $<
213 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/dktp/drvobj/%.c
214 $(COMPILE.c) -o $@ $<
217 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/dktp/hba/ghd/%.c
218 $(COMPILE.c) -o $@ $<
221 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/dnet/%.c
222 $(COMPILE.c) -o $@ $<
225 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/scsi/adapters/arcmsr/%.c
226 $(COMPILE.c) -o $@ $<
229 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/scsi/targets/%.c
230 $(COMPILE.c) -o $@ $<
233 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/vgatext/%.c
234 $(COMPILE.c) -o $@ $<
237 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/vmxnet3s/%.c
238 $(COMPILE.c) -o $@ $<
241 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/scsi/adapters/pvscsi/%.c
242 $(COMPILE.c) -o $@ $<
245 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/nskern/%.s
246 $(COMPILE.s) -o $@ $<
248 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/os/%.c
249 $(COMPILE.c) -o $@ $<
252 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/pcbe/%.c
253 $(COMPILE.c) -o $@ $<
256 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/promif/%.c
257 $(COMPILE.c) -o $@ $<
260 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/syscall/%.c
261 $(COMPILE.c) -o $@ $<
264 $(OBJS_DIR)/%.o: $(UTSBASE)/common/os/%.c
265 $(COMPILE.c) -o $@ $<
268 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/kdi/%.c
269 $(COMPILE.c) -o $@ $<
272 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/kdi/%.s
273 $(COMPILE.s) -o $@ $<
275 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/zfs/%.c
276 $(COMPILE.c) -o $@ $<
280 # krtld compiled into unix
283 KRTLD_INC_PATH = -I$(UTSBASE)/common/krtld -I$(UTSBASE)/intel/sys
284 KRTLD_INC_PATH += -I$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld
286 KRTLD_CPPFLAGS_32 = -DELF_TARGET_386
287 KRTLD_CPPFLAGS_64 = -DELF_TARGET_AMD64 -DMODDIR_SUFFIX=\"amd64\"
288 KRTLD_CPPFLAGS = $(KRTLD_CPPFLAGS_$(CLASS)) -D_KRTLD
290 $(OBJS_DIR)/%.o: $(UTSBASE)/common/krtld/%.c
291 $(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
294 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.c
295 $(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
299 # _DBOOT indicates that krtld is called from a dboot ELF section
301 $(OBJS_DIR)/kobj.o := CPPFLAGS += -D_DBOOT
303 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.s
304 $(COMPILE.s) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
307 $(OBJS_DIR)/%.o: $(SRC)/common/util/$(SUBARCH_DIR)/%.c
308 $(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
313 # Section 1b: Lint `object' build rules.
315 $(LINTS_DIR)/%.ln: $(SRC)/common/fs/%.c
316 @($(LHEAD) $(LINT.c) $< $(LTAIL))
318 $(LINTS_DIR)/%.ln: $(SRC)/common/util/i386/%.s
319 @($(LHEAD) $(LINT.s) $< $(LTAIL))
321 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/brand/sn1/%.s
322 @($(LHEAD) $(LINT.s) $< $(LTAIL))
324 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/brand/solaris10/%.s
325 @($(LHEAD) $(LINT.s) $< $(LTAIL))
327 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/dtrace/%.c
328 @($(LHEAD) $(LINT.c) $< $(LTAIL))
330 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/dtrace/%.s
331 @($(LHEAD) $(LINT.s) $< $(LTAIL))
333 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/zfs/%.c
334 @($(LHEAD) $(LINT.c) $< $(LTAIL))
336 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/fs/proc/%.c
337 @($(LHEAD) $(LINT.c) $< $(LTAIL))
339 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/ml/%.s
340 @($(LHEAD) $(LINT.s) $< $(LTAIL))
342 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/os/%.c
343 @($(LHEAD) $(LINT.c) $< $(LTAIL))
345 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/promif/%.c
346 @($(LHEAD) $(LINT.c) $< $(LTAIL))
348 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/syscall/%.c
349 @($(LHEAD) $(LINT.c) $< $(LTAIL))
351 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/%.c
352 @($(LHEAD) $(LINT.c) $< $(LTAIL))
354 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/%.s
355 @($(LHEAD) $(LINT.s) $< $(LTAIL))
357 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/%.c
358 @($(LHEAD) $(LINT.c) $< $(LTAIL))
360 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/debugger/%.c
361 @($(LHEAD) $(LINT.c) $< $(LTAIL))
363 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/events/%.c
364 @($(LHEAD) $(LINT.c) $< $(LTAIL))
366 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/hardware/%.c
367 @($(LHEAD) $(LINT.c) $< $(LTAIL))
369 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/dispatcher/%.c
370 @($(LHEAD) $(LINT.c) $< $(LTAIL))
372 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/executer/%.c
373 @($(LHEAD) $(LINT.c) $< $(LTAIL))
375 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/parser/%.c
376 @($(LHEAD) $(LINT.c) $< $(LTAIL))
378 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/namespace/%.c
379 @($(LHEAD) $(LINT.c) $< $(LTAIL))
381 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/resources/%.c
382 @($(LHEAD) $(LINT.c) $< $(LTAIL))
384 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/tables/%.c
385 @($(LHEAD) $(LINT.c) $< $(LTAIL))
387 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/utilities/%.c
388 @($(LHEAD) $(LINT.c) $< $(LTAIL))
390 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/disassembler/%.c
391 @($(LHEAD) $(LINT.c) $< $(LTAIL))
393 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/agpgart/%.c
394 @($(LHEAD) $(LINT.c) $< $(LTAIL))
396 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/agpmaster/%.c
397 @($(LHEAD) $(LINT.c) $< $(LTAIL))
399 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/amd8111s/%.c
400 @($(LHEAD) $(LINT.c) $< $(LTAIL))
402 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/amr/%.c
403 @($(LHEAD) $(LINT.c) $< $(LTAIL))
405 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/scsi/adapters/arcmsr/%.c
406 @($(LHEAD) $(LINT.c) $< $(LTAIL))
408 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/drm/%.c
409 @($(LHEAD) $(LINT.c) $< $(LTAIL))
411 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/hotplug/pcicfg/%.c
412 @($(LHEAD) $(LINT.c) $< $(LTAIL))
414 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/hotplug/pci/%.c
415 @($(LHEAD) $(LINT.c) $< $(LTAIL))
417 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/intel_nb5000/%.c
418 @($(LHEAD) $(LINT.c) $< $(LTAIL))
420 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/intel_nhm/%.c
421 @($(LHEAD) $(LINT.c) $< $(LTAIL))
423 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/ipmi/%.c
424 @($(LHEAD) $(LINT.c) $< $(LTAIL))
426 $(LINTS_DIR)/%.ln: $(SRC)/common/mc/mc-amd/%.c
427 @($(LHEAD) $(LINT.c) $< $(LTAIL))
429 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/mc-amd/%.c
430 @($(LHEAD) $(LINT.c) $< $(LTAIL))
432 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/pci/%.c
433 @($(LHEAD) $(LINT.c) $< $(LTAIL))
435 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/pciex/%.c
436 @($(LHEAD) $(LINT.c) $< $(LTAIL))
438 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/controller/ata/%.c
439 @($(LHEAD) $(LINT.c) $< $(LTAIL))
441 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/dcdev/%.c
442 @($(LHEAD) $(LINT.c) $< $(LTAIL))
444 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/disk/%.c
445 @($(LHEAD) $(LINT.c) $< $(LTAIL))
447 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/drvobj/%.c
448 @($(LHEAD) $(LINT.c) $< $(LTAIL))
450 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/hba/ghd/%.c
451 @($(LHEAD) $(LINT.c) $< $(LTAIL))
453 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dnet/%.c
454 @($(LHEAD) $(LINT.c) $< $(LTAIL))
456 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/scsi/targets/%.c
457 @($(LHEAD) $(LINT.c) $< $(LTAIL))
459 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/vgatext/%.c
460 @($(LHEAD) $(LINT.c) $< $(LTAIL))
462 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/vmxnet3s/%.c
463 @($(LHEAD) $(LINT.c) $< $(LTAIL))
465 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/scsi/adapters/pvscsi/%.c
466 @($(LHEAD) $(LINT.c) $< $(LTAIL))
468 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/os/%.c
469 @($(LHEAD) $(LINT.c) $< $(LTAIL))
471 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/pcbe/%.c
472 @($(LHEAD) $(LINT.c) $< $(LTAIL))
474 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/promif/%.c
475 @($(LHEAD) $(LINT.c) $< $(LTAIL))
477 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/syscall/%.c
478 @($(LHEAD) $(LINT.c) $< $(LTAIL))
480 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/os/%.c
481 @($(LHEAD) $(LINT.c) $< $(LTAIL))
483 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/kdi/%.c
484 @($(LHEAD) $(LINT.c) $< $(LTAIL))
486 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/kdi/%.s
487 @($(LHEAD) $(LINT.s) $< $(LTAIL))
489 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/nskern/%.s
490 @($(LHEAD) $(LINT.s) $< $(LTAIL))
495 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/krtld/%.c
496 @($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
498 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.c
499 @($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
501 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.s
502 @($(LHEAD) $(LINT.s) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
504 $(LINTS_DIR)/%.ln: $(SRC)/common/util/$(SUBARCH_DIR)/%.c
505 @($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
507 $(OBJS_DIR)/kobj.ln := CPPFLAGS += -D_DBOOT