xref: /illumos-gate/usr/src/uts/i86xpv/Makefile.rules (revision 28ab0ca48b3e331cbbb231b1c8325f9f24f9af95)
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 2009 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)/intel/io/pciex/hotplug/%.c
75	$(COMPILE.c) -o $@ $<
76	$(CTFCONVERT_O)
77
78$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/io/psm/%.c
79	$(COMPILE.c) -o $@ $<
80	$(CTFCONVERT_O)
81
82$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
83	$(COMPILE.s) -o $@ $<
84
85$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
86	$(COMPILE.c) -o $@ $<
87	$(CTFCONVERT_O)
88
89$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/vm/%.c
90	$(COMPILE.c) -o $@ $<
91	$(CTFCONVERT_O)
92
93$(OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
94	$(COMPILE.c) -o $@ $<
95	$(CTFCONVERT_O)
96
97$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
98	$(COMPILE.c) -o $@ $<
99	$(CTFCONVERT_O)
100
101$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/gfx_private/%.c
102	$(COMPILE.c) -o $@ $<
103	$(CTFCONVERT_O)
104
105$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/xsvc/%.c
106	$(COMPILE.c) -o $@ $<
107	$(CTFCONVERT_O)
108
109$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/pciex/%.c
110	$(COMPILE.c) -o $@ $<
111	$(CTFCONVERT_O)
112
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
116$(OBJS_DIR)/dtrace_subr.o:	$(UTSBASE)/i86pc/os/dtrace_subr.c
117	$(COMPILE.c) -o $@ $(UTSBASE)/i86pc/os/dtrace_subr.c
118	$(CTFCONVERT_O)
119
120#
121$(OBJS_DIR)/%.o:		$(UTSBASE)/common/cpr/%.c
122	$(COMPILE.c) -o $@ $<
123	$(CTFCONVERT_O)
124
125$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/io/%.c
126	$(COMPILE.c) -o $@ $<
127	$(CTFCONVERT_O)
128
129$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
130	$(COMPILE.c) -o $@ $<
131	$(CTFCONVERT_O)
132
133$(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/dtrace/%.c
134	$(COMPILE.c) -o $@ $<
135	$(CTFCONVERT_O)
136#
137# stuff for dboot
138#
139# This is different from i86pc - uses 64 bit compiler for 64 bit
140#
141# Note that we *don't* want to use the definitions that have been augmented
142# by various bits of the context of the kernel build environment; so we
143# start constructing flags and things afresh.
144
145DBOOT_OBJS_DIR= dboot/$(OBJS_DIR)
146
147DBOOT_XARCH_32 = $(i386_XARCH)
148DBOOT_XARCH_64 = $(amd64_XARCH)
149DBOOT_CFLAGS = $(DBOOT_XARCH_$(CLASS)) $(CSTD) $(CERRWARN) \
150    $(CCNOAUTOINLINE) -O
151
152DBOOT_AS_XARCH_32 = $(i386_AS_XARCH)
153DBOOT_AS_XARCH_64 = $(amd64_AS_XARCH)
154DBOOT_ASFLAGS = $(DBOOT_AS_XARCH_$(CLASS)) -P -D_ASM
155
156$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
157	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
158
159$(DBOOT_OBJS_DIR)/%.o:		$(SRC)/common/font/%.c
160	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
161
162$(DBOOT_OBJS_DIR)/%.o:		$(DBOOT_OBJS_DIR)/%.c
163	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
164
165$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
166	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
167
168$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
169	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
170
171$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.c
172	$(CC) $(DBOOT_CFLAGS)  $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
173
174$(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/%.c
175	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
176
177$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
178	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
179
180$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/ml/%.s
181	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
182
183$(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/i386/%.s
184	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
185
186$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
187	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
188
189$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.s
190	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
191
192include $(UTSBASE)/i86pc/Makefile.rules
193
194DBOOT_DEFS += -D__xpv
195