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 2012 Joyent, Inc. All rights reserved.
25 # Copyright 2016 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/heci/%.c
238 $(COMPILE.c) -o $@ $<
241 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/vmxnet3s/%.c
242 $(COMPILE.c) -o $@ $<
245 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/scsi/adapters/pvscsi/%.c
246 $(COMPILE.c) -o $@ $<
249 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/nskern/%.s
250 $(COMPILE.s) -o $@ $<
252 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/os/%.c
253 $(COMPILE.c) -o $@ $<
256 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/pcbe/%.c
257 $(COMPILE.c) -o $@ $<
260 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/promif/%.c
261 $(COMPILE.c) -o $@ $<
264 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/syscall/%.c
265 $(COMPILE.c) -o $@ $<
268 $(OBJS_DIR)/%.o: $(UTSBASE)/common/os/%.c
269 $(COMPILE.c) -o $@ $<
272 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/kdi/%.c
273 $(COMPILE.c) -o $@ $<
276 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/kdi/%.s
277 $(COMPILE.s) -o $@ $<
279 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/kdi/$(SUBARCH_DIR)/%.s
280 $(COMPILE.s) -o $@ $<
282 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/zfs/%.c
283 $(COMPILE.c) -o $@ $<
287 # krtld compiled into unix
290 KRTLD_INC_PATH = -I$(UTSBASE)/common/krtld -I$(UTSBASE)/intel/sys
291 KRTLD_INC_PATH += -I$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld
293 KRTLD_CPPFLAGS_32 = -DELF_TARGET_386
294 KRTLD_CPPFLAGS_64 = -DELF_TARGET_AMD64 -DMODDIR_SUFFIX=\"amd64\"
295 KRTLD_CPPFLAGS = $(KRTLD_CPPFLAGS_$(CLASS)) -D_KRTLD
297 $(OBJS_DIR)/%.o: $(UTSBASE)/common/krtld/%.c
298 $(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
301 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.c
302 $(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
306 # _DBOOT indicates that krtld is called from a dboot ELF section
308 $(OBJS_DIR)/kobj.o := CPPFLAGS += -D_DBOOT
310 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.s
311 $(COMPILE.s) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
314 $(OBJS_DIR)/%.o: $(SRC)/common/util/$(SUBARCH_DIR)/%.c
315 $(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
320 # Section 1b: Lint `object' build rules.
322 $(LINTS_DIR)/%.ln: $(SRC)/common/fs/%.c
323 @($(LHEAD) $(LINT.c) $< $(LTAIL))
325 $(LINTS_DIR)/%.ln: $(SRC)/common/util/i386/%.s
326 @($(LHEAD) $(LINT.s) $< $(LTAIL))
328 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/brand/sn1/%.s
329 @($(LHEAD) $(LINT.s) $< $(LTAIL))
331 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/brand/solaris10/%.s
332 @($(LHEAD) $(LINT.s) $< $(LTAIL))
334 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/dtrace/%.c
335 @($(LHEAD) $(LINT.c) $< $(LTAIL))
337 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/dtrace/%.s
338 @($(LHEAD) $(LINT.s) $< $(LTAIL))
340 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/zfs/%.c
341 @($(LHEAD) $(LINT.c) $< $(LTAIL))
343 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/fs/proc/%.c
344 @($(LHEAD) $(LINT.c) $< $(LTAIL))
346 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/ml/%.s
347 @($(LHEAD) $(LINT.s) $< $(LTAIL))
349 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/os/%.c
350 @($(LHEAD) $(LINT.c) $< $(LTAIL))
352 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/promif/%.c
353 @($(LHEAD) $(LINT.c) $< $(LTAIL))
355 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/syscall/%.c
356 @($(LHEAD) $(LINT.c) $< $(LTAIL))
358 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/%.c
359 @($(LHEAD) $(LINT.c) $< $(LTAIL))
361 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/%.s
362 @($(LHEAD) $(LINT.s) $< $(LTAIL))
364 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/%.c
365 @($(LHEAD) $(LINT.c) $< $(LTAIL))
367 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/debugger/%.c
368 @($(LHEAD) $(LINT.c) $< $(LTAIL))
370 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/events/%.c
371 @($(LHEAD) $(LINT.c) $< $(LTAIL))
373 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/hardware/%.c
374 @($(LHEAD) $(LINT.c) $< $(LTAIL))
376 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/dispatcher/%.c
377 @($(LHEAD) $(LINT.c) $< $(LTAIL))
379 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/executer/%.c
380 @($(LHEAD) $(LINT.c) $< $(LTAIL))
382 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/parser/%.c
383 @($(LHEAD) $(LINT.c) $< $(LTAIL))
385 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/namespace/%.c
386 @($(LHEAD) $(LINT.c) $< $(LTAIL))
388 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/resources/%.c
389 @($(LHEAD) $(LINT.c) $< $(LTAIL))
391 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/tables/%.c
392 @($(LHEAD) $(LINT.c) $< $(LTAIL))
394 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/utilities/%.c
395 @($(LHEAD) $(LINT.c) $< $(LTAIL))
397 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/acpica/disassembler/%.c
398 @($(LHEAD) $(LINT.c) $< $(LTAIL))
400 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/agpgart/%.c
401 @($(LHEAD) $(LINT.c) $< $(LTAIL))
403 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/agpmaster/%.c
404 @($(LHEAD) $(LINT.c) $< $(LTAIL))
406 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/amd8111s/%.c
407 @($(LHEAD) $(LINT.c) $< $(LTAIL))
409 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/amr/%.c
410 @($(LHEAD) $(LINT.c) $< $(LTAIL))
412 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/scsi/adapters/arcmsr/%.c
413 @($(LHEAD) $(LINT.c) $< $(LTAIL))
415 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/drm/%.c
416 @($(LHEAD) $(LINT.c) $< $(LTAIL))
418 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/hotplug/pcicfg/%.c
419 @($(LHEAD) $(LINT.c) $< $(LTAIL))
421 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/hotplug/pci/%.c
422 @($(LHEAD) $(LINT.c) $< $(LTAIL))
424 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/intel_nb5000/%.c
425 @($(LHEAD) $(LINT.c) $< $(LTAIL))
427 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/intel_nhm/%.c
428 @($(LHEAD) $(LINT.c) $< $(LTAIL))
430 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/ipmi/%.c
431 @($(LHEAD) $(LINT.c) $< $(LTAIL))
433 $(LINTS_DIR)/%.ln: $(SRC)/common/mc/mc-amd/%.c
434 @($(LHEAD) $(LINT.c) $< $(LTAIL))
436 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/mc-amd/%.c
437 @($(LHEAD) $(LINT.c) $< $(LTAIL))
439 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/pci/%.c
440 @($(LHEAD) $(LINT.c) $< $(LTAIL))
442 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/pciex/%.c
443 @($(LHEAD) $(LINT.c) $< $(LTAIL))
445 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/controller/ata/%.c
446 @($(LHEAD) $(LINT.c) $< $(LTAIL))
448 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/dcdev/%.c
449 @($(LHEAD) $(LINT.c) $< $(LTAIL))
451 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/disk/%.c
452 @($(LHEAD) $(LINT.c) $< $(LTAIL))
454 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/drvobj/%.c
455 @($(LHEAD) $(LINT.c) $< $(LTAIL))
457 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dktp/hba/ghd/%.c
458 @($(LHEAD) $(LINT.c) $< $(LTAIL))
460 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/dnet/%.c
461 @($(LHEAD) $(LINT.c) $< $(LTAIL))
463 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/scsi/targets/%.c
464 @($(LHEAD) $(LINT.c) $< $(LTAIL))
466 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/vgatext/%.c
467 @($(LHEAD) $(LINT.c) $< $(LTAIL))
469 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/heci/%.c
470 @($(LHEAD) $(LINT.c) $< $(LTAIL))
472 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/vmxnet3s/%.c
473 @($(LHEAD) $(LINT.c) $< $(LTAIL))
475 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/scsi/adapters/pvscsi/%.c
476 @($(LHEAD) $(LINT.c) $< $(LTAIL))
478 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/os/%.c
479 @($(LHEAD) $(LINT.c) $< $(LTAIL))
481 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/pcbe/%.c
482 @($(LHEAD) $(LINT.c) $< $(LTAIL))
484 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/promif/%.c
485 @($(LHEAD) $(LINT.c) $< $(LTAIL))
487 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/syscall/%.c
488 @($(LHEAD) $(LINT.c) $< $(LTAIL))
490 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/os/%.c
491 @($(LHEAD) $(LINT.c) $< $(LTAIL))
493 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/kdi/%.c
494 @($(LHEAD) $(LINT.c) $< $(LTAIL))
496 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/kdi/%.s
497 @($(LHEAD) $(LINT.s) $< $(LTAIL))
499 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/kdi/$(SUBARCH_DIR)/%.s
500 @($(LHEAD) $(LINT.s) $< $(LTAIL))
502 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/nskern/%.s
503 @($(LHEAD) $(LINT.s) $< $(LTAIL))
508 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/krtld/%.c
509 @($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
511 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.c
512 @($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
514 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.s
515 @($(LHEAD) $(LINT.s) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
517 $(LINTS_DIR)/%.ln: $(SRC)/common/util/$(SUBARCH_DIR)/%.c
518 @($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
520 $(OBJS_DIR)/kobj.ln := CPPFLAGS += -D_DBOOT