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]
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
28 # This Makefile defines the build rules for the directory uts/i86xpv
29 # and its children. These are the source files which are i86xpv
30 # "implementation architecture" dependent.
32 # 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.
43 # We share many files with the i86pc implementation to reduce
44 # the amount of merge work
48 # Section 1a: C object build rules
50 $(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/conf/%.c
54 $(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/cpu/generic_cpu/%.c
58 $(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/io/%.c
62 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/ioat/%.c
66 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pci/%.c
70 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pciex/%.c
74 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/pciex/hotplug/%.c
78 $(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/io/psm/%.c
82 $(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/ml/%.s
85 $(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/os/%.c
89 $(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/vm/%.c
93 $(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/boot/%.c
97 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c
101 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/gfx_private/%.c
102 $(COMPILE.c) -o $@ $<
105 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/xsvc/%.c
106 $(COMPILE.c) -o $@ $<
109 $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/pciex/%.c
110 $(COMPILE.c) -o $@ $<
113 # We need this one to make sure we share dtrace_subr.c with i86pc
114 # Otherwise we pick up common/os/dtrace_subr.c instead :(
115 # Note that only the non-commented versions of this hack end up
116 # in the lint section below.
118 $(OBJS_DIR)/dtrace_subr.o: $(UTSBASE)/i86pc/os/dtrace_subr.c
119 $(COMPILE.c) -o $@ $(UTSBASE)/i86pc/os/dtrace_subr.c
123 $(OBJS_DIR)/%.o: $(UTSBASE)/common/cpr/%.c
124 $(COMPILE.c) -o $@ $<
127 $(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/io/%.c
128 $(COMPILE.c) -o $@ $<
131 $(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/os/%.c
132 $(COMPILE.c) -o $@ $<
135 $(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/dtrace/%.c
136 $(COMPILE.c) -o $@ $<
140 # Section 1b: Lint `object' build rules
142 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/conf/%.c
143 @($(LHEAD) $(LINT.c) $< $(LTAIL))
145 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/io/%.c
146 @($(LHEAD) $(LINT.c) $< $(LTAIL))
148 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/io/psm/%.c
149 @($(LHEAD) $(LINT.c) $< $(LTAIL))
151 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/ml/%.s
152 @($(LHEAD) $(LINT.s) $< $(LTAIL))
154 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/os/%.c
155 @($(LHEAD) $(LINT.c) $< $(LTAIL))
157 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/vm/%.c
158 @($(LHEAD) $(LINT.c) $< $(LTAIL))
160 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/boot/%.c
161 @($(LHEAD) $(LINT.c) $< $(LTAIL))
163 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/boot/%.c
164 @($(LHEAD) $(LINT.c) $< $(LTAIL))
166 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/dtrace/%.c
167 @($(LHEAD) $(LINT.c) $< $(LTAIL))
171 $(LINTS_DIR)/dtrace_subr.ln: $(UTSBASE)/i86pc/os/dtrace_subr.c
172 @($(LHEAD) $(LINT.c) $(UTSBASE)/i86pc/os/dtrace_subr.c $(LTAIL))
177 # This is different from i86pc - uses 64 bit compiler for 64 bit
179 # Note that we *don't* want to use the definitions that have been augmented
180 # by various bits of the context of the kernel build environment; so we
181 # start constructing flags and things afresh.
183 DBOOT_OBJS_DIR= dboot/$(OBJS_DIR)
185 DBOOT_XARCH_32 = $(i386_XARCH)
186 DBOOT_XARCH_64 = $(amd64_XARCH)
187 DBOOT_CFLAGS = $(DBOOT_XARCH_$(CLASS)) $(C99MODE) $(CERRWARN) \
190 DBOOT_AS_XARCH_32 = $(i386_AS_XARCH)
191 DBOOT_AS_XARCH_64 = $(amd64_AS_XARCH)
192 DBOOT_ASFLAGS = $(DBOOT_AS_XARCH_$(CLASS)) -P -D_ASM
194 DBOOT_LINTFLAGS_i86xpv = $(LINTFLAGS_i386_$(CLASS)) $(LINTTAGS_i386_$(CLASS))
196 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/common/xen/os/%.c
197 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
199 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/common/font/%.c
200 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
202 $(DBOOT_OBJS_DIR)/%.o: $(DBOOT_OBJS_DIR)/%.c
203 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
205 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/boot/%.c
206 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
208 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c
209 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
211 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.c
212 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
214 $(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/%.c
215 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
217 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/os/%.c
218 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
220 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/ml/%.s
221 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
223 $(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/i386/%.s
224 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
226 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/ml/%.s
227 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
229 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.s
230 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
232 include $(UTSBASE)/i86pc/Makefile.rules
234 DBOOT_DEFS += -D__xpv
236 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/cpr/%.c
237 @($(LHEAD) $(LINT.c) $< $(LTAIL))
239 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/font/%.c
240 @($(LHEAD) $(LINT.c) $< $(LTAIL))
242 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/ioat/%.c
243 @($(LHEAD) $(LINT.c) $< $(LTAIL))
245 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/pci/%.c
246 @($(LHEAD) $(LINT.c) $< $(LTAIL))
248 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/pciex/%.c
249 @($(LHEAD) $(LINT.c) $< $(LTAIL))
251 $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/pciex/hotplug/%.c
252 @($(LHEAD) $(LINT.c) $< $(LTAIL))
254 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/gfx_private/%.c
255 @($(LHEAD) $(LINT.c) $< $(LTAIL))
257 $(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/xsvc/%.c
258 @($(LHEAD) $(LINT.c) $< $(LTAIL))
260 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/pciex/%.c
261 @($(LHEAD) $(LINT.c) $< $(LTAIL))
263 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/io/%.c
264 @($(LHEAD) $(LINT.c) $< $(LTAIL))
266 $(LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/os/%.c
267 @($(LHEAD) $(LINT.c) $< $(LTAIL))
269 $(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/ml/%.s
270 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
272 $(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/common/font/%.c
273 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
275 $(DBOOT_LINTS_DIR)/%.ln: $(DBOOT_LINTS_DIR)/%.c
276 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
278 $(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/os/%.c
279 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
281 $(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/os/%.c
282 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
284 $(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/ml/%.s
285 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
287 $(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/boot/%.c
288 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))