xref: /titanic_44/usr/src/uts/i86xpv/Makefile.rules (revision c7158ae983f5a04c4a998f468ecefba6d23ba721)
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#
23*c7158ae9Stariq# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24843e1988Sjohnlev# Use is subject to license terms.
25843e1988Sjohnlev#
26843e1988Sjohnlev# ident	"%Z%%M%	%I%	%E% SMI"
27843e1988Sjohnlev#
28843e1988Sjohnlev
29843e1988Sjohnlev#
30843e1988Sjohnlev#	This Makefile defines the build rules for the directory uts/i86xpv
31843e1988Sjohnlev#	and its children. These are the source files which are i86xpv
32843e1988Sjohnlev#	"implementation architecture" dependent.
33843e1988Sjohnlev#
34843e1988Sjohnlev#	The following two-level ordering must be maintained in this file.
35843e1988Sjohnlev#
36843e1988Sjohnlev#	- Lines are sorted first in order of decreasing specificity based on
37843e1988Sjohnlev#	  the first directory component.  That is, sun4u rules come before
38843e1988Sjohnlev#	  sparc rules come before common rules.
39843e1988Sjohnlev#
40843e1988Sjohnlev#	- Lines whose initial directory components are equal are sorted
41843e1988Sjohnlev#	  alphabetically by the remaining components.
42843e1988Sjohnlev#
43843e1988Sjohnlev
44843e1988Sjohnlev#
45843e1988Sjohnlev#	We share many files with the i86pc implementation to reduce
46843e1988Sjohnlev#	the amount of merge work
47843e1988Sjohnlev#
48843e1988Sjohnlev
49843e1988Sjohnlev#
50843e1988Sjohnlev#	Section 1a: C object build rules
51843e1988Sjohnlev#
52843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/conf/%.c
53843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
54843e1988Sjohnlev	$(CTFCONVERT_O)
55843e1988Sjohnlev
56843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/io/%.c
57843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
58843e1988Sjohnlev	$(CTFCONVERT_O)
59843e1988Sjohnlev
60843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pci/%.c
61843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
62843e1988Sjohnlev	$(CTFCONVERT_O)
63843e1988Sjohnlev
64843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pciex/%.c
65843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
66843e1988Sjohnlev	$(CTFCONVERT_O)
67843e1988Sjohnlev
68843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/io/psm/%.c
69843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
70843e1988Sjohnlev	$(CTFCONVERT_O)
71843e1988Sjohnlev
72843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
73843e1988Sjohnlev	$(COMPILE.s) -o $@ $<
74843e1988Sjohnlev
75843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
76843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
77843e1988Sjohnlev	$(CTFCONVERT_O)
78843e1988Sjohnlev
79843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/vm/%.c
80843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
81843e1988Sjohnlev	$(CTFCONVERT_O)
82843e1988Sjohnlev
83843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
84843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
85843e1988Sjohnlev	$(CTFCONVERT_O)
86843e1988Sjohnlev
87843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
88843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
89843e1988Sjohnlev	$(CTFCONVERT_O)
90843e1988Sjohnlev
91843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/gfx_private/%.c
92843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
93843e1988Sjohnlev	$(CTFCONVERT_O)
94843e1988Sjohnlev
95843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/xsvc/%.c
96843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
97843e1988Sjohnlev	$(CTFCONVERT_O)
98843e1988Sjohnlev
99843e1988Sjohnlev#	We need this one to make sure we share dtrace_subr.c with i86pc
100843e1988Sjohnlev#	Otherwise we pick up common/os/dtrace_subr.c instead :(
101843e1988Sjohnlev#	Note that only the non-commented versions of this hack end up
102843e1988Sjohnlev#	in the lint section below.
103843e1988Sjohnlev
104843e1988Sjohnlev$(OBJS_DIR)/dtrace_subr.o:	$(UTSBASE)/i86pc/os/dtrace_subr.c
105843e1988Sjohnlev	$(COMPILE.c) -o $@ $(UTSBASE)/i86pc/os/dtrace_subr.c
106843e1988Sjohnlev	$(CTFCONVERT_O)
107843e1988Sjohnlev
108843e1988Sjohnlev#
109843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/common/cpr/%.c
110843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
111843e1988Sjohnlev	$(CTFCONVERT_O)
112843e1988Sjohnlev
113843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/io/%.c
114843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
115843e1988Sjohnlev	$(CTFCONVERT_O)
116843e1988Sjohnlev
117843e1988Sjohnlev$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
118843e1988Sjohnlev	$(COMPILE.c) -o $@ $<
119843e1988Sjohnlev	$(CTFCONVERT_O)
120843e1988Sjohnlev
121*c7158ae9Stariq$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/dtrace/%.c
122*c7158ae9Stariq	$(COMPILE.c) -o $@ $<
123*c7158ae9Stariq	$(CTFCONVERT_O)
124*c7158ae9Stariq
125843e1988Sjohnlev#
126843e1988Sjohnlev#	Section 1b: Lint `object' build rules
127843e1988Sjohnlev#
128843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/conf/%.c
129843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
130843e1988Sjohnlev
131843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/io/%.c
132843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
133843e1988Sjohnlev
134843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/io/psm/%.c
135843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
136843e1988Sjohnlev
137843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/ml/%.s
138843e1988Sjohnlev	@($(LHEAD) $(LINT.s) $< $(LTAIL))
139843e1988Sjohnlev
140843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/os/%.c
141843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
142843e1988Sjohnlev
143843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/vm/%.c
144843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
145843e1988Sjohnlev
146843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/boot/%.c
147843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
148843e1988Sjohnlev
149843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/boot/%.c
150843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
151843e1988Sjohnlev
152*c7158ae9Stariq$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/dtrace/%.c
153*c7158ae9Stariq	@($(LHEAD) $(LINT.c) $< $(LTAIL))
154*c7158ae9Stariq
155843e1988Sjohnlev#	See note above.
156843e1988Sjohnlev
157843e1988Sjohnlev$(LINTS_DIR)/dtrace_subr.ln:	$(UTSBASE)/i86pc/os/dtrace_subr.c
158843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $(UTSBASE)/i86pc/os/dtrace_subr.c $(LTAIL))
159843e1988Sjohnlev
160843e1988Sjohnlev#
161843e1988Sjohnlev# stuff for dboot
162843e1988Sjohnlev#
163843e1988Sjohnlev# This is different from i86pc - uses 64 bit compiler for 64 bit
164843e1988Sjohnlev#
165843e1988Sjohnlev# Note that we *don't* want to use the definitions that have been augmented
166843e1988Sjohnlev# by various bits of the context of the kernel build environment; so we
167843e1988Sjohnlev# start constructing flags and things afresh.
168843e1988Sjohnlev
169843e1988SjohnlevDBOOT_OBJS_DIR= dboot/$(OBJS_DIR)
170843e1988Sjohnlev
171843e1988SjohnlevDBOOT_XARCH_32 = $(i386_XARCH)
172843e1988SjohnlevDBOOT_XARCH_64 = $(amd64_XARCH)
173843e1988SjohnlevDBOOT_CFLAGS = $(DBOOT_XARCH_$(CLASS)) $(CERRWARN) -O
174843e1988Sjohnlev
175843e1988SjohnlevDBOOT_AS_XARCH_32 = $(i386_AS_XARCH)
176843e1988SjohnlevDBOOT_AS_XARCH_64 = $(amd64_AS_XARCH)
177843e1988SjohnlevDBOOT_ASFLAGS = $(DBOOT_AS_XARCH_$(CLASS)) -P -D_ASM
178843e1988Sjohnlev
179843e1988SjohnlevDBOOT_LINTFLAGS_i86xpv	= $(LINTFLAGS_i386_$(CLASS)) $(LINTTAGS_i386_$(CLASS))
180843e1988Sjohnlev
181551bc2a6Smrj$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
182551bc2a6Smrj	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
183551bc2a6Smrj
184843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
185843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
186843e1988Sjohnlev
187843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
188843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
189843e1988Sjohnlev
190843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.c
191843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS)  $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
192843e1988Sjohnlev
193843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/%.c
194843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
195843e1988Sjohnlev
196843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
197843e1988Sjohnlev	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
198843e1988Sjohnlev
199551bc2a6Smrj$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/ml/%.s
200551bc2a6Smrj	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
201551bc2a6Smrj
202843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/i386/%.s
203843e1988Sjohnlev	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
204843e1988Sjohnlev
205843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
206843e1988Sjohnlev	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
207843e1988Sjohnlev
208843e1988Sjohnlev$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.s
209843e1988Sjohnlev	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
210843e1988Sjohnlev
211843e1988Sjohnlevinclude $(UTSBASE)/i86pc/Makefile.rules
212843e1988Sjohnlev
213843e1988SjohnlevDBOOT_DEFS += -D__xpv
214843e1988Sjohnlev
215843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/cpr/%.c
216843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
217843e1988Sjohnlev
218843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pci/%.c
219843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
220843e1988Sjohnlev
221843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pciex/%.c
222843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
223843e1988Sjohnlev
224843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/gfx_private/%.c
225843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
226843e1988Sjohnlev
227843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/xsvc/%.c
228843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
229843e1988Sjohnlev
230843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/io/%.c
231843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
232843e1988Sjohnlev
233843e1988Sjohnlev$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/os/%.c
234843e1988Sjohnlev	@($(LHEAD) $(LINT.c) $< $(LTAIL))
235843e1988Sjohnlev
236551bc2a6Smrj$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/intel/ia32/ml/%.s
237551bc2a6Smrj	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
238551bc2a6Smrj
239551bc2a6Smrj$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/os/%.c
240551bc2a6Smrj	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
241551bc2a6Smrj
242843e1988Sjohnlev$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/os/%.c
243843e1988Sjohnlev	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
244843e1988Sjohnlev
245843e1988Sjohnlev$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/ml/%.s
246843e1988Sjohnlev	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
247843e1988Sjohnlev
248843e1988Sjohnlev$(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/boot/%.c
249843e1988Sjohnlev	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
250