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