xref: /illumos-gate/usr/src/uts/intel/Makefile.rules (revision dd23d762c65e503874085a3893fbd3df9688da30)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24# Copyright 2019 Joyent, Inc.
25# Copyright 2017 Nexenta Systems, Inc.
26# Copyright 2023 Oxide Computer Company
27#
28
29#
30#	This Makefile defines all file modules and build rules for the
31# directory uts/intel and its children. These are the source files which
32# are specific to the intel processor.
33#
34#	The following two-level ordering must be maintained in this file.
35#	  Lines are sorted first in order of decreasing specificity based on
36#	  the first directory component.  That is, sun4u rules come before
37#	  sparc rules come before common rules.
38#
39#	  Lines whose initial directory components are equal are sorted
40#	  alphabetically by the remaining components.
41
42#
43# Need a way to distinguish between the ia32 and amd64 subdirs.
44#
45SUBARCH_DIR = amd64
46
47#
48#	Section 1a: C object build rules
49#
50$(OBJS_DIR)/%.o:		$(SRC)/common/fs/%.c
51	$(COMPILE.c) -o $@ $<
52	$(CTFCONVERT_O)
53
54$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/power/%.c
55	$(COMPILE.c) -o $@ $<
56	$(CTFCONVERT_O)
57
58$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/brand/sn1/%.S
59	$(COMPILE.s) -o $@ $<
60
61$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/brand/solaris10/%.S
62	$(COMPILE.s) -o $@ $<
63
64$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/dtrace/%.c
65	$(COMPILE.c) -o $@ $<
66	$(CTFCONVERT_O)
67
68$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/dtrace/%.S
69	$(COMPILE.s) -o $@ $<
70
71$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/fs/proc/%.c
72	$(COMPILE.c) -o $@ $<
73	$(CTFCONVERT_O)
74
75$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/os/%.c
76	$(COMPILE.c) -o $@ $<
77	$(CTFCONVERT_O)
78
79$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/%.c
80	$(COMPILE.c) -o $@ $<
81	$(CTFCONVERT_O)
82
83$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/%.c
84	$(COMPILE.c) -o $@ $<
85	$(CTFCONVERT_O)
86
87$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/%.S
88	$(COMPILE.s) -o $@ $<
89
90$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/ml/%.S
91	$(COMPILE.s) -o $@ $<
92
93$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/events/%.c
94	$(COMPILE.c) -o $@ $<
95	$(CTFCONVERT_O)
96
97$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/hardware/%.c
98	$(COMPILE.c) -o $@ $<
99	$(CTFCONVERT_O)
100
101$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/dispatcher/%.c
102	$(COMPILE.c) -o $@ $<
103	$(CTFCONVERT_O)
104
105$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/executer/%.c
106	$(COMPILE.c) -o $@ $<
107	$(CTFCONVERT_O)
108
109$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/parser/%.c
110	$(COMPILE.c) -o $@ $<
111	$(CTFCONVERT_O)
112
113$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/namespace/%.c
114	$(COMPILE.c) -o $@ $<
115	$(CTFCONVERT_O)
116
117$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/resources/%.c
118	$(COMPILE.c) -o $@ $<
119	$(CTFCONVERT_O)
120
121$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/tables/%.c
122	$(COMPILE.c) -o $@ $<
123	$(CTFCONVERT_O)
124
125$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/utilities/%.c
126	$(COMPILE.c) -o $@ $<
127	$(CTFCONVERT_O)
128
129$(OBJS_DIR)/%.o:		$(SRC)/common/acpica/disassembler/%.c
130	$(COMPILE.c) -o $@ $<
131	$(CTFCONVERT_O)
132
133$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/amd8111s/%.c
134	$(COMPILE.c) -o $@ $<
135	$(CTFCONVERT_O)
136
137$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/amdnbtemp/%.c
138	$(COMPILE.c) -o $@ $<
139	$(CTFCONVERT_O)
140
141$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/amdzen/%.c
142	$(COMPILE.c) -o $@ $<
143	$(CTFCONVERT_O)
144
145$(OBJS_DIR)/%.o:		$(SRC)/common/mc/zen_umc/%.c
146	$(COMPILE.c) -o $@ $<
147	$(CTFCONVERT_O)
148
149$(OBJS_DIR)/%.o:		$(SRC)/common/amdzen/%.c
150	$(COMPILE.c) -o $@ $<
151	$(CTFCONVERT_O)
152
153$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/amr/%.c
154	$(COMPILE.c) -o $@ $<
155	$(CTFCONVERT_O)
156
157$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/coretemp/%.c
158	$(COMPILE.c) -o $@ $<
159	$(CTFCONVERT_O)
160
161$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/hotplug/pcicfg/%.c
162	$(COMPILE.c) -o $@ $<
163	$(CTFCONVERT_O)
164
165$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/imc/%.c
166	$(COMPILE.c) -o $@ $<
167	$(CTFCONVERT_O)
168
169$(OBJS_DIR)/%.o:		$(SRC)/common/mc/imc/%.c
170	$(COMPILE.c) -o $@ $<
171	$(CTFCONVERT_O)
172
173$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/ipmi/%.c
174	$(COMPILE.c) -o $@ $<
175	$(CTFCONVERT_O)
176
177$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/intel_nb5000/%.c
178	$(COMPILE.c) -o $@ $<
179	$(CTFCONVERT_O)
180
181$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/intel_nhm/%.c
182	$(COMPILE.c) -o $@ $<
183	$(CTFCONVERT_O)
184
185$(OBJS_DIR)/%.o:		$(SRC)/common/mc/mc-amd/%.c
186	$(COMPILE.c) -o $@ $<
187	$(CTFCONVERT_O)
188
189$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/mc-amd/%.c
190	$(COMPILE.c) -o $@ $<
191	$(CTFCONVERT_O)
192
193$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/pchtemp/%.c
194	$(COMPILE.c) -o $@ $<
195	$(CTFCONVERT_O)
196
197$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/pci/%.c
198	$(COMPILE.c) -o $@ $<
199	$(CTFCONVERT_O)
200
201$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/pciex/%.c
202	$(COMPILE.c) -o $@ $<
203	$(CTFCONVERT_O)
204
205$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/controller/ata/%.c
206	$(COMPILE.c) -o $@ $<
207	$(CTFCONVERT_O)
208
209$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/dcdev/%.c
210	$(COMPILE.c) -o $@ $<
211	$(CTFCONVERT_O)
212
213$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/disk/%.c
214	$(COMPILE.c) -o $@ $<
215	$(CTFCONVERT_O)
216
217$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/drvobj/%.c
218	$(COMPILE.c) -o $@ $<
219	$(CTFCONVERT_O)
220
221$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/hba/ghd/%.c
222	$(COMPILE.c) -o $@ $<
223	$(CTFCONVERT_O)
224
225$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dnet/%.c
226	$(COMPILE.c) -o $@ $<
227	$(CTFCONVERT_O)
228
229$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/scsi/adapters/arcmsr/%.c
230	$(COMPILE.c) -o $@ $<
231	$(CTFCONVERT_O)
232
233$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/vgatext/%.c
234	$(COMPILE.c) -o $@ $<
235	$(CTFCONVERT_O)
236
237$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/vmxnet3s/%.c
238	$(COMPILE.c) -o $@ $<
239	$(CTFCONVERT_O)
240
241$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/nskern/%.S
242	$(COMPILE.s) -o $@ $<
243
244$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/os/%.c
245	$(COMPILE.c) -o $@ $<
246	$(CTFCONVERT_O)
247
248$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/pcbe/%.c
249	$(COMPILE.c) -o $@ $<
250	$(CTFCONVERT_O)
251
252$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/promif/%.c
253	$(COMPILE.c) -o $@ $<
254	$(CTFCONVERT_O)
255
256$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/syscall/%.c
257	$(COMPILE.c) -o $@ $<
258	$(CTFCONVERT_O)
259
260$(OBJS_DIR)/%.o:		$(UTSBASE)/common/os/%.c
261	$(COMPILE.c) -o $@ $<
262	$(CTFCONVERT_O)
263
264$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/kdi/%.c
265	$(COMPILE.c) -o $@ $<
266	$(CTFCONVERT_O)
267
268$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/kdi/%.S
269	$(COMPILE.s) -o $@ $<
270
271$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/zfs/%.c
272	$(COMPILE.c) -o $@ $<
273	$(CTFCONVERT_O)
274
275$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/viona/%.c
276	$(COMPILE.c) -o $@ $<
277	$(CTFCONVERT_O)
278
279$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/vmm/%.c
280	$(COMPILE.c) -o $@ $<
281	$(CTFCONVERT_O)
282
283#
284# krtld compiled into unix
285#
286
287KRTLD_INC_PATH	= -I$(UTSBASE)/common/krtld -I$(UTSBASE)/intel/sys
288KRTLD_INC_PATH	+= -I$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld
289
290KRTLD_CPPFLAGS	= -D_KRTLD -DELF_TARGET_AMD64 -DMODDIR_SUFFIX=\"amd64\"
291
292$(OBJS_DIR)/%.o:	$(UTSBASE)/common/krtld/%.c
293	$(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
294	$(CTFCONVERT_O)
295
296$(OBJS_DIR)/%.o:	$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.c
297	$(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
298	$(CTFCONVERT_O)
299
300#
301# _DBOOT indicates that krtld is called from a dboot ELF section
302#
303$(OBJS_DIR)/kobj.o		:= CPPFLAGS += -D_DBOOT
304
305$(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/intel/ml/%.S
306	$(AS) $(ASFLAGS_XARCH_32) -D_ASM $(DBOOT_DEFS) $(DBOOT_AS_INCL) \
307	    $(DBOOT_ASFLAGS) -c -o $@ $<
308
309$(OBJS_DIR)/%.o:	$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.S
310	$(COMPILE.s) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
311
312$(OBJS_DIR)/%.o:	$(SRC)/common/util/$(SUBARCH_DIR)/%.c
313	$(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
314	$(CTFCONVERT_O)
315