xref: /titanic_44/usr/src/uts/i86xpv/Makefile.rules (revision 40cdc2e8babc6bb3ab847f6a129fc9eb76c5f4d5)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27#
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.
31#
32#	The following two-level ordering must be maintained in this file.
33#
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.
37#
38#	- Lines whose initial directory components are equal are sorted
39#	  alphabetically by the remaining components.
40#
41
42#
43#	We share many files with the i86pc implementation to reduce
44#	the amount of merge work
45#
46
47#
48#	Section 1a: C object build rules
49#
50$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/conf/%.c
51	$(COMPILE.c) -o $@ $<
52	$(CTFCONVERT_O)
53
54$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/cpu/generic_cpu/%.c
55	$(COMPILE.c) -o $@ $<
56	$(CTFCONVERT_O)
57
58$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/io/%.c
59	$(COMPILE.c) -o $@ $<
60	$(CTFCONVERT_O)
61
62$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/ioat/%.c
63	$(COMPILE.c) -o $@ $<
64	$(CTFCONVERT_O)
65
66$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pci/%.c
67	$(COMPILE.c) -o $@ $<
68	$(CTFCONVERT_O)
69
70$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pciex/%.c
71	$(COMPILE.c) -o $@ $<
72	$(CTFCONVERT_O)
73
74$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/io/psm/%.c
75	$(COMPILE.c) -o $@ $<
76	$(CTFCONVERT_O)
77
78$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
79	$(COMPILE.s) -o $@ $<
80
81$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
82	$(COMPILE.c) -o $@ $<
83	$(CTFCONVERT_O)
84
85$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/vm/%.c
86	$(COMPILE.c) -o $@ $<
87	$(CTFCONVERT_O)
88
89$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
90	$(COMPILE.c) -o $@ $<
91	$(CTFCONVERT_O)
92
93$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
94	$(COMPILE.c) -o $@ $<
95	$(CTFCONVERT_O)
96
97$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/gfx_private/%.c
98	$(COMPILE.c) -o $@ $<
99	$(CTFCONVERT_O)
100
101$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/xsvc/%.c
102	$(COMPILE.c) -o $@ $<
103	$(CTFCONVERT_O)
104
105#	We need this one to make sure we share dtrace_subr.c with i86pc
106#	Otherwise we pick up common/os/dtrace_subr.c instead :(
107#	Note that only the non-commented versions of this hack end up
108#	in the lint section below.
109
110$(OBJS_DIR)/dtrace_subr.o:	$(UTSBASE)/i86pc/os/dtrace_subr.c
111	$(COMPILE.c) -o $@ $(UTSBASE)/i86pc/os/dtrace_subr.c
112	$(CTFCONVERT_O)
113
114#
115$(OBJS_DIR)/%.o:		$(UTSBASE)/common/cpr/%.c
116	$(COMPILE.c) -o $@ $<
117	$(CTFCONVERT_O)
118
119$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/io/%.c
120	$(COMPILE.c) -o $@ $<
121	$(CTFCONVERT_O)
122
123$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
124	$(COMPILE.c) -o $@ $<
125	$(CTFCONVERT_O)
126
127$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/dtrace/%.c
128	$(COMPILE.c) -o $@ $<
129	$(CTFCONVERT_O)
130
131#
132#	Section 1b: Lint `object' build rules
133#
134$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/conf/%.c
135	@($(LHEAD) $(LINT.c) $< $(LTAIL))
136
137$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/io/%.c
138	@($(LHEAD) $(LINT.c) $< $(LTAIL))
139
140$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/io/psm/%.c
141	@($(LHEAD) $(LINT.c) $< $(LTAIL))
142
143$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/ml/%.s
144	@($(LHEAD) $(LINT.s) $< $(LTAIL))
145
146$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/os/%.c
147	@($(LHEAD) $(LINT.c) $< $(LTAIL))
148
149$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/vm/%.c
150	@($(LHEAD) $(LINT.c) $< $(LTAIL))
151
152$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/boot/%.c
153	@($(LHEAD) $(LINT.c) $< $(LTAIL))
154
155$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/boot/%.c
156	@($(LHEAD) $(LINT.c) $< $(LTAIL))
157
158$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/dtrace/%.c
159	@($(LHEAD) $(LINT.c) $< $(LTAIL))
160
161#	See note above.
162
163$(LINTS_DIR)/dtrace_subr.ln:	$(UTSBASE)/i86pc/os/dtrace_subr.c
164	@($(LHEAD) $(LINT.c) $(UTSBASE)/i86pc/os/dtrace_subr.c $(LTAIL))
165
166#
167# stuff for dboot
168#
169# This is different from i86pc - uses 64 bit compiler for 64 bit
170#
171# Note that we *don't* want to use the definitions that have been augmented
172# by various bits of the context of the kernel build environment; so we
173# start constructing flags and things afresh.
174
175DBOOT_OBJS_DIR= dboot/$(OBJS_DIR)
176
177DBOOT_XARCH_32 = $(i386_XARCH)
178DBOOT_XARCH_64 = $(amd64_XARCH)
179DBOOT_CFLAGS = $(DBOOT_XARCH_$(CLASS)) $(CERRWARN) -O
180
181DBOOT_AS_XARCH_32 = $(i386_AS_XARCH)
182DBOOT_AS_XARCH_64 = $(amd64_AS_XARCH)
183DBOOT_ASFLAGS = $(DBOOT_AS_XARCH_$(CLASS)) -P -D_ASM
184
185DBOOT_LINTFLAGS_i86xpv	= $(LINTFLAGS_i386_$(CLASS)) $(LINTTAGS_i386_$(CLASS))
186
187$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
188	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
189
190$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
191	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
192
193$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
194	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
195
196$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.c
197	$(CC) $(DBOOT_CFLAGS)  $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
198
199$(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/%.c
200	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
201
202$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
203	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
204
205$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/ml/%.s
206	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
207
208$(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/i386/%.s
209	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
210
211$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
212	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
213
214$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.s
215	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
216
217include $(UTSBASE)/i86pc/Makefile.rules
218
219DBOOT_DEFS += -D__xpv
220
221$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/cpr/%.c
222	@($(LHEAD) $(LINT.c) $< $(LTAIL))
223
224$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/ioat/%.c
225	@($(LHEAD) $(LINT.c) $< $(LTAIL))
226
227$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pci/%.c
228	@($(LHEAD) $(LINT.c) $< $(LTAIL))
229
230$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pciex/%.c
231	@($(LHEAD) $(LINT.c) $< $(LTAIL))
232
233$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/gfx_private/%.c
234	@($(LHEAD) $(LINT.c) $< $(LTAIL))
235
236$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/xsvc/%.c
237	@($(LHEAD) $(LINT.c) $< $(LTAIL))
238
239$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/io/%.c
240	@($(LHEAD) $(LINT.c) $< $(LTAIL))
241
242$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/os/%.c
243	@($(LHEAD) $(LINT.c) $< $(LTAIL))
244
245$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/intel/ia32/ml/%.s
246	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
247
248$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/os/%.c
249	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
250
251$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/os/%.c
252	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
253
254$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/ml/%.s
255	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
256
257$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/boot/%.c
258	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
259