xref: /onnv-gate/usr/src/uts/i86pc/Makefile.i86pc.shared (revision 12825:e35468461453)
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# uts/i86pc/Makefile.i86pc
24#
25# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
26#
27#
28#	This makefile contains the common definitions for the i86pc unix
29#	and all i86pc implementation architecture dependent modules.
30#
31
32#
33#	Machine type (implementation architecture):
34#
35PLATFORM	 = i86pc
36
37#
38#	uname -m value
39#
40UNAME_M		= $(PLATFORM)
41
42#
43# Definitions for the platform-specific /platform directories.
44#
45# IMPLEMENTATIONS is used to designate i86pc machines which have
46# platform specific modules.  All code specific to a given implementation
47# resides in the appropriately named subdirectory.   This requires
48# these platforms to have their own Makefiles to define ROOT_PLAT_DIRS,
49# USR_PLAT_DIRS, etc.
50#
51IMPLEMENTATIONS	= i86hvm
52
53#
54#	Everybody needs to know how to build modstubs.o and to locate unix.o
55#
56UNIX_DIR	 = $(UTSBASE)/$(PLATFORM)/unix
57GENLIB_DIR	 = $(UTSBASE)/intel/genunix
58MODSTUBS_DIR	 = $(UNIX_DIR)
59DSF_DIR		 = $(UTSBASE)/$(PLATFORM)/genassym
60LINTS_DIR	 = $(OBJS_DIR)
61LINT_LIB_DIR	 = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
62GEN_LINT_LIB_DIR = $(UTSBASE)/intel/lint-libs/$(OBJS_DIR)
63
64LINT32_DIRS	 = $(LINT32_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%)
65LINT32_FILES	 = $(LINT32_DIRS:%=%/llib-l$(MODULE).ln)
66
67DTRACESTUBS_O	 = $(OBJS_DIR)/dtracestubs.o
68DTRACESTUBS	 = $(OBJS_DIR)/libdtracestubs.so
69
70SYM_MOD		= $(OBJS_DIR)/unix.sym
71
72UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
73MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
74GENLIB	 	 = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
75LINT_LIB	 = $(LINT_LIB_DIR)/llib-lunix.ln
76DBOOT_LINT_LIB	 = $(LINT_LIB_DIR)/llib-ldboot.ln
77GEN_LINT_LIB	 = $(GEN_LINT_LIB_DIR)/llib-lgenunix.ln
78
79#
80#	Include the makefiles which define build rule templates, the
81#	collection of files per module, and a few specific flags. Note
82#	that order is significant, just as with an include path. The
83#	first build rule template which matches the files name will be
84#	used. By including these in order from most machine dependent
85#	to most machine independent, we allow a machine dependent file
86#	to be used in preference over a machine independent version
87#	(Such as a machine specific optimization, which preserves the
88#	interfaces.)
89#
90include $(UTSTREE)/$(PLATFORM)/Makefile.files
91include $(UTSTREE)/intel/Makefile.files
92include $(UTSTREE)/common/Makefile.files
93
94#
95#	Include machine independent rules. Note that this does not imply
96#	that the resulting module from rules in Makefile.uts is	machine
97#	independent. Only that the build rules are machine independent.
98#
99include $(UTSBASE)/Makefile.uts
100
101#
102#	Define supported builds
103#
104DEF_BUILDS		= $(DEF_BUILDS64) $(DEF_BUILDS32)
105ALL_BUILDS		= $(ALL_BUILDS64) $(ALL_BUILDS32)
106
107#
108#	x86 or amd64 inline templates
109#
110INLINES_32		= $(UTSBASE)/intel/ia32/ml/ia32.il \
111			  $(UTSBASE)/$(PLATFORM)/ml/ia32.il
112INLINES_64		= $(UTSBASE)/intel/amd64/ml/amd64.il \
113			  $(UTSBASE)/$(PLATFORM)/ml/amd64.il
114INLINES			+= $(INLINES_$(CLASS))
115
116#
117#	kernel-specific optimizations; override default in Makefile.master
118#
119
120CFLAGS_XARCH_32		= $(i386_CFLAGS)
121CFLAGS_XARCH_64		= $(amd64_CFLAGS)
122CFLAGS_XARCH		= $(CFLAGS_XARCH_$(CLASS))
123
124COPTFLAG_32		= $(COPTFLAG)
125COPTFLAG_64		= $(COPTFLAG64)
126COPTIMIZE		= $(COPTFLAG_$(CLASS))
127
128CFLAGS			= $(CFLAGS_XARCH)
129CFLAGS			+= $(COPTIMIZE)
130CFLAGS			+= $(INLINES) -D_ASM_INLINES
131CFLAGS			+= $(CCMODE)
132CFLAGS			+= $(SPACEFLAG)
133CFLAGS			+= $(CCUNBOUND)
134CFLAGS			+= $(CFLAGS_uts)
135CFLAGS			+= -xstrconst
136
137ASFLAGS_XARCH_32	= $(i386_ASFLAGS)
138ASFLAGS_XARCH_64	= $(amd64_ASFLAGS)
139ASFLAGS_XARCH		= $(ASFLAGS_XARCH_$(CLASS))
140
141ASFLAGS			+= $(ASFLAGS_XARCH)
142
143AS_INC_PATH		+= -I$(DSF_DIR)/$(OBJS_DIR)
144
145#
146#	The following must be defined for all implementations:
147#
148#	MAPFILE:	ld mapfile for the build of kernel/unix.
149#	MODSTUBS:	Module stubs source file.
150#	GENASSYM_SRC:	genassym.c
151#
152MAPFILE		 = $(UTSBASE)/$(PLATFORM)/conf/Mapfile
153MODSTUBS	 = $(UTSBASE)/intel/ia32/ml/modstubs.s
154GENASSYM_SRC	 = $(UTSBASE)/$(PLATFORM)/ml/genassym.c
155OFFSETS_SRC	 = $(UTSBASE)/$(PLATFORM)/ml/offsets.in
156PLATFORM_OFFSETS_32	= $(UTSBASE)/$(PLATFORM)/ml/mach_offsets.in
157PLATFORM_OFFSETS_64	= $(UTSBASE)/intel/amd64/ml/mach_offsets.in
158PLATFORM_OFFSETS_SRC	= $(PLATFORM_OFFSETS_$(CLASS))
159KDI_OFFSETS_SRC	 = $(UTSBASE)/intel/kdi/kdi_offsets.in
160
161#
162#	Define the actual specific platforms
163#
164MACHINE_DEFS	 = -D$(PLATFORM) -D_MACHDEP
165
166#
167#	Software workarounds for hardware "features"
168#
169
170include	$(UTSBASE)/$(PLATFORM)/Makefile.workarounds
171
172#
173#	Debugging level
174#
175#	Special knowledge of which special debugging options effect which
176#	file is used to optimize the build if these flags are changed.
177#
178#	XXX: The above could possibly be done for more flags and files, but
179#	     is left as an experiment to the interested reader. Be forewarned,
180#	     that excessive use could lead to maintenance difficulties.
181#
182DEBUG_DEFS_OBJ32	=
183DEBUG_DEFS_DBG32	= -DDEBUG
184DEBUG_DEFS_OBJ64	=
185DEBUG_DEFS_DBG64	= -DDEBUG
186DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
187
188DEBUG_COND_OBJ32	:sh = echo \\043
189DEBUG_COND_DBG32	=
190DEBUG_COND_OBJ64	:sh = echo \\043
191DEBUG_COND_DBG64	=
192IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
193
194$(IF_DEBUG_OBJ)trap.o		:= DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE
195$(IF_DEBUG_OBJ)syscall_asm.o	:= DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
196$(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
197$(IF_DEBUG_OBJ)fast_trap_asm.o	:= DEBUG_DEFS += -DTRAPTRACE
198$(IF_DEBUG_OBJ)interrupt.o	:= DEBUG_DEFS += -DTRAPTRACE
199$(IF_DEBUG_OBJ)intr.o		:= DEBUG_DEFS += -DTRAPTRACE
200$(IF_DEBUG_OBJ)locore.o		:= DEBUG_DEFS += -DTRAPTRACE
201$(IF_DEBUG_OBJ)mp_startup.o	:= DEBUG_DEFS += -DTRAPTRACE
202$(IF_DEBUG_OBJ)machdep.o	:= DEBUG_DEFS += -DTRAPTRACE
203$(IF_DEBUG_OBJ)exception.o	:= DEBUG_DEFS += -DTRAPTRACE
204$(IF_DEBUG_OBJ)x_call.o		:= DEBUG_DEFS += -DTRAPTRACE
205$(IF_DEBUG_OBJ)mp_call.o	:= DEBUG_DEFS += -DTRAPTRACE
206$(IF_DEBUG_OBJ)cbe.o		:= DEBUG_DEFS += -DTRAPTRACE
207
208#
209#	Collect the preprocessor definitions to be associated with *all*
210#	files.
211#
212ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
213		   $(OPTION_DEFS)
214GENASSYM_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS) \
215			-_gcc=-fno-eliminate-unused-debug-symbols \
216			-_gcc=-fno-eliminate-unused-debug-types
217
218#
219# ----- TRANSITIONAL SECTION --------------------------------------------------
220#
221
222#
223#	Not everything which *should* be a module is a module yet. The
224#	following is a list of such objects which are currently part of
225#	the base kernel but should soon become kmods.
226#
227#	XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever
228#	     made into a module. If it is made MT safe before being made
229#	     into a module, it should be added to this list. It was in
230#	     this list pre ON-4.0.
231#
232#
233MACH_NOT_YET_KMODS	= $(AUTOCONF_OBJS)
234
235#
236# ----- END OF TRANSITIONAL SECTION -------------------------------------------
237#
238
239#
240#	The kernels modules which are "implementation architecture"
241#	specific for this machine are enumerated below. Note that most
242#	of these modules must exist (in one form or another) for each
243#	architecture.
244#
245#	Machine Specific Driver Modules (/kernel/drv)
246#	DRV_KMODS are built both 32-bit and 64-bit
247#	DRV_KMODS_32 are built only 32-bit
248#	DRV_KMODS_64 are built only 64-bit
249#
250DRV_KMODS	+= rootnex
251DRV_KMODS	+= isa
252DRV_KMODS	+= pcplusmp
253DRV_KMODS	+= apix
254DRV_KMODS	+= cpc
255DRV_KMODS	+= pci
256DRV_KMODS	+= npe
257DRV_KMODS	+= pci-ide
258DRV_KMODS	+= xsvc
259DRV_KMODS	+= tzmon
260DRV_KMODS	+= acpi_drv
261DRV_KMODS	+= acpinex
262DRV_KMODS	+= amd_iommu
263DRV_KMODS	+= dr
264DRV_KMODS	+= ioat
265DRV_KMODS	+= fipe
266
267DRV_KMODS	+= cpudrv
268
269
270#
271# Platform Power Modules
272#
273DRV_KMODS	+= ppm acpippm
274
275#
276#	CPU Modules
277#
278CPU_KMODS	+= amd_opteron
279CPU_KMODS	+= generic_cpu
280CPU_KMODS	+= authenticamd
281CPU_KMODS	+= genuineintel
282
283#
284# Don't build some of these for OpenSolaris, since they will be
285# replaced by binaries that are signed by Sun Release Engineering.
286#
287$(CLOSED_BUILD)CLOSED_CPU_KMODS	+= intel_nhmex
288
289#
290#	Exec Class Modules (/kernel/exec):
291#
292EXEC_KMODS	+=
293
294#
295#	Scheduling Class Modules (/kernel/sched):
296#
297SCHED_KMODS	+=
298
299#
300#	File System Modules (/kernel/fs):
301#
302FS_KMODS	+=
303
304#
305#	Streams Modules (/kernel/strmod):
306#
307STRMOD_KMODS	+=
308
309#
310#	'System' Modules (/kernel/sys):
311#
312SYS_KMODS	+=
313
314#
315#	'Misc' Modules (/kernel/misc):
316#
317MISC_KMODS	+= gfx_private pcie
318MISC_KMODS	+= acpidev
319MISC_KMODS	+= drmach_acpi
320
321#
322#	'Dacf' modules (/kernel/dacf)
323#
324DACF_KMODS	+= consconfig_dacf
325
326#
327#	'Mach' Modules (/kernel/mach):
328#
329MACH_KMODS     	+= uppc
330
331#
332#	CPR Misc Module.
333#
334MISC_KMODS	+= cpr
335