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