xref: /titanic_44/usr/src/uts/i86xpv/Makefile.rules (revision 6a3e8e8695d5c7d1d18c6800d676990d7f61a2a4)
1843e1988Sjohnlev#
2843e1988Sjohnlev# CDDL HEADER START
3843e1988Sjohnlev#
4843e1988Sjohnlev# The contents of this file are subject to the terms of the
5843e1988Sjohnlev# Common Development and Distribution License (the "License").
6843e1988Sjohnlev# You may not use this file except in compliance with the License.
7843e1988Sjohnlev#
8843e1988Sjohnlev# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9843e1988Sjohnlev# or http://www.opensolaris.org/os/licensing.
10843e1988Sjohnlev# See the License for the specific language governing permissions
11843e1988Sjohnlev# and limitations under the License.
12843e1988Sjohnlev#
13843e1988Sjohnlev# When distributing Covered Code, include this CDDL HEADER in each
14843e1988Sjohnlev# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15843e1988Sjohnlev# If applicable, add the following below this CDDL HEADER, with the
16843e1988Sjohnlev# fields enclosed by brackets "[]" replaced with your own identifying
17843e1988Sjohnlev# information: Portions Copyright [yyyy] [name of copyright owner]
18843e1988Sjohnlev#
19843e1988Sjohnlev# CDDL HEADER END
20843e1988Sjohnlev#
21843e1988Sjohnlev
22843e1988Sjohnlev#
2326947304SEvan Yan# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24843e1988Sjohnlev# Use is subject to license terms.
25843e1988Sjohnlev#
26843e1988Sjohnlev
27843e1988Sjohnlev#
28843e1988Sjohnlev#	This Makefile defines the build rules for the directory uts/i86xpv
29843e1988Sjohnlev#	and its children. These are the source files which are i86xpv
30843e1988Sjohnlev#	"implementation architecture" dependent.
31843e1988Sjohnlev#
32843e1988Sjohnlev#	The following two-level ordering must be maintained in this file.
33843e1988Sjohnlev#
34843e1988Sjohnlev#	- Lines are sorted first in order of decreasing specificity based on
35843e1988Sjohnlev#	  the first directory component.  That is, sun4u rules come before
36843e1988Sjohnlev#	  sparc rules come before common rules.
37843e1988Sjohnlev#
38843e1988Sjohnlev#	- Lines whose initial directory components are equal are sorted
39843e1988Sjohnlev#	  alphabetically by the remaining components.
40843e1988Sjohnlev#
41843e1988Sjohnlev
42843e1988Sjohnlev#
43843e1988Sjohnlev#	We share many files with the i86pc implementation to reduce
44843e1988Sjohnlev#	the amount of merge work
45843e1988Sjohnlev#
46843e1988Sjohnlev
47843e1988Sjohnlev#
48843e1988Sjohnlev#	Section 1a: C object build rules
49843e1988Sjohnlev#
50843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/conf/%.c
51843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
52843e1988Sjohnlev	$(CTFCONVERT_O)
53843e1988Sjohnlev
54e4b86885SCheng Sean Ye$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/cpu/generic_cpu/%.c
55e4b86885SCheng Sean Ye	$(COMPILE.c) -o $@ $<
56e4b86885SCheng Sean Ye	$(CTFCONVERT_O)
57e4b86885SCheng Sean Ye
58843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/io/%.c
59843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
60843e1988Sjohnlev	$(CTFCONVERT_O)
61843e1988Sjohnlev
6217169044Sbrutus$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/ioat/%.c
6317169044Sbrutus	$(COMPILE.c) -o $@ $<
6417169044Sbrutus	$(CTFCONVERT_O)
6517169044Sbrutus
66843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pci/%.c
67843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
68843e1988Sjohnlev	$(CTFCONVERT_O)
69843e1988Sjohnlev
70843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pciex/%.c
71843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
72843e1988Sjohnlev	$(CTFCONVERT_O)
73843e1988Sjohnlev
7426947304SEvan Yan$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/pciex/hotplug/%.c
7526947304SEvan Yan	$(COMPILE.c) -o $@ $<
7626947304SEvan Yan	$(CTFCONVERT_O)
7726947304SEvan Yan
78843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/io/psm/%.c
79843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
80843e1988Sjohnlev	$(CTFCONVERT_O)
81843e1988Sjohnlev
82843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
83843e1988Sjohnlev	$(COMPILE.s) -o $@ $<
84843e1988Sjohnlev
85843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
86843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
87843e1988Sjohnlev	$(CTFCONVERT_O)
88843e1988Sjohnlev
89843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/vm/%.c
90843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
91843e1988Sjohnlev	$(CTFCONVERT_O)
92843e1988Sjohnlev
93843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
94843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
95843e1988Sjohnlev	$(CTFCONVERT_O)
96843e1988Sjohnlev
97843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
98843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
99843e1988Sjohnlev	$(CTFCONVERT_O)
100843e1988Sjohnlev
101843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/gfx_private/%.c
102843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
103843e1988Sjohnlev	$(CTFCONVERT_O)
104843e1988Sjohnlev
105843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/xsvc/%.c
106843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
107843e1988Sjohnlev	$(CTFCONVERT_O)
108843e1988Sjohnlev
109c0da6274SZhi-Jun Robin Fu$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/pciex/%.c
110c0da6274SZhi-Jun Robin Fu	$(COMPILE.c) -o $@ $<
111c0da6274SZhi-Jun Robin Fu	$(CTFCONVERT_O)
112c0da6274SZhi-Jun Robin Fu
113843e1988Sjohnlev#	We need this one to make sure we share dtrace_subr.c with i86pc
114843e1988Sjohnlev#	Otherwise we pick up common/os/dtrace_subr.c instead :(
115843e1988Sjohnlev#	Note that only the non-commented versions of this hack end up
116843e1988Sjohnlev#	in the lint section below.
117843e1988Sjohnlev
118843e1988Sjohnlev$(OBJS_DIR)/dtrace_subr.o:	$(UTSBASE)/i86pc/os/dtrace_subr.c
119843e1988Sjohnlev	$(COMPILE.c) -o $@ $(UTSBASE)/i86pc/os/dtrace_subr.c
120843e1988Sjohnlev	$(CTFCONVERT_O)
121843e1988Sjohnlev
122843e1988Sjohnlev#
123843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/common/cpr/%.c
124843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
125843e1988Sjohnlev	$(CTFCONVERT_O)
126843e1988Sjohnlev
127843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/io/%.c
128843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
129843e1988Sjohnlev	$(CTFCONVERT_O)
130843e1988Sjohnlev
131843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
132843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
133843e1988Sjohnlev	$(CTFCONVERT_O)
134843e1988Sjohnlev
135c7158ae9Stariq$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/dtrace/%.c
136c7158ae9Stariq	$(COMPILE.c) -o $@ $<
137c7158ae9Stariq	$(CTFCONVERT_O)
138c7158ae9Stariq
139843e1988Sjohnlev#
140843e1988Sjohnlev#	Section 1b: Lint `object' build rules
141843e1988Sjohnlev#
142843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/conf/%.c
143843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
144843e1988Sjohnlev
145843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/io/%.c
146843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
147843e1988Sjohnlev
148843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/io/psm/%.c
149843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
150843e1988Sjohnlev
151843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/ml/%.s
152843e1988Sjohnlev	@($(LHEAD) $(LINT.s) $< $(LTAIL))
153843e1988Sjohnlev
154843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/os/%.c
155843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
156843e1988Sjohnlev
157843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/vm/%.c
158843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
159843e1988Sjohnlev
160843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/boot/%.c
161843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
162843e1988Sjohnlev
163843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/boot/%.c
164843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
165843e1988Sjohnlev
166c7158ae9Stariq$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/dtrace/%.c
167c7158ae9Stariq	@($(LHEAD) $(LINT.c) $< $(LTAIL))
168c7158ae9Stariq
169843e1988Sjohnlev#	See note above.
170843e1988Sjohnlev
171843e1988Sjohnlev$(LINTS_DIR)/dtrace_subr.ln:	$(UTSBASE)/i86pc/os/dtrace_subr.c
172843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $(UTSBASE)/i86pc/os/dtrace_subr.c $(LTAIL))
173843e1988Sjohnlev
174843e1988Sjohnlev#
175843e1988Sjohnlev# stuff for dboot
176843e1988Sjohnlev#
177843e1988Sjohnlev# This is different from i86pc - uses 64 bit compiler for 64 bit
178843e1988Sjohnlev#
179843e1988Sjohnlev# Note that we *don't* want to use the definitions that have been augmented
180843e1988Sjohnlev# by various bits of the context of the kernel build environment; so we
181843e1988Sjohnlev# start constructing flags and things afresh.
182843e1988Sjohnlev
183843e1988SjohnlevDBOOT_OBJS_DIR= dboot/$(OBJS_DIR)
184843e1988Sjohnlev
185843e1988SjohnlevDBOOT_XARCH_32 = $(i386_XARCH)
186843e1988SjohnlevDBOOT_XARCH_64 = $(amd64_XARCH)
187*6a3e8e86SRichard LoweDBOOT_CFLAGS = $(DBOOT_XARCH_$(CLASS)) $(CERRWARN) $(CCNOAUTOINLINE) -O
188843e1988Sjohnlev
189843e1988SjohnlevDBOOT_AS_XARCH_32 = $(i386_AS_XARCH)
190843e1988SjohnlevDBOOT_AS_XARCH_64 = $(amd64_AS_XARCH)
191843e1988SjohnlevDBOOT_ASFLAGS = $(DBOOT_AS_XARCH_$(CLASS)) -P -D_ASM
192843e1988Sjohnlev
193843e1988SjohnlevDBOOT_LINTFLAGS_i86xpv	= $(LINTFLAGS_i386_$(CLASS)) $(LINTTAGS_i386_$(CLASS))
194843e1988Sjohnlev
195551bc2a6Smrj$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
196551bc2a6Smrj	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
197551bc2a6Smrj
198843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
199843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
200843e1988Sjohnlev
201843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
202843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
203843e1988Sjohnlev
204843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.c
205843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS)  $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
206843e1988Sjohnlev
207843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/%.c
208843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
209843e1988Sjohnlev
210843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
211843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
212843e1988Sjohnlev
213551bc2a6Smrj$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/ml/%.s
214551bc2a6Smrj	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
215551bc2a6Smrj
216843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/i386/%.s
217843e1988Sjohnlev	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
218843e1988Sjohnlev
219843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
220843e1988Sjohnlev	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
221843e1988Sjohnlev
222843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.s
223843e1988Sjohnlev	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
224843e1988Sjohnlev
225843e1988Sjohnlevinclude $(UTSBASE)/i86pc/Makefile.rules
226843e1988Sjohnlev
227843e1988SjohnlevDBOOT_DEFS += -D__xpv
228843e1988Sjohnlev
229843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/cpr/%.c
230843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
231843e1988Sjohnlev
23217169044Sbrutus$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/ioat/%.c
23317169044Sbrutus	@($(LHEAD) $(LINT.c) $< $(LTAIL))
23417169044Sbrutus
235843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pci/%.c
236843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
237843e1988Sjohnlev
238843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pciex/%.c
239843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
240843e1988Sjohnlev
24126947304SEvan Yan$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/pciex/hotplug/%.c
24226947304SEvan Yan	@($(LHEAD) $(LINT.c) $< $(LTAIL))
24326947304SEvan Yan
244843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/gfx_private/%.c
245843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
246843e1988Sjohnlev
247843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/xsvc/%.c
248843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
249843e1988Sjohnlev
250c0da6274SZhi-Jun Robin Fu$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/pciex/%.c
251c0da6274SZhi-Jun Robin Fu	@($(LHEAD) $(LINT.c) $< $(LTAIL))
252c0da6274SZhi-Jun Robin Fu
253843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/io/%.c
254843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
255843e1988Sjohnlev
256843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/os/%.c
257843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
258843e1988Sjohnlev
259551bc2a6Smrj$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/intel/ia32/ml/%.s
260551bc2a6Smrj	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
261551bc2a6Smrj
262551bc2a6Smrj$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/os/%.c
263551bc2a6Smrj	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
264551bc2a6Smrj
265843e1988Sjohnlev$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/os/%.c
266843e1988Sjohnlev	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
267843e1988Sjohnlev
268843e1988Sjohnlev$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/ml/%.s
269843e1988Sjohnlev	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
270843e1988Sjohnlev
271843e1988Sjohnlev$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/boot/%.c
272843e1988Sjohnlev	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
273