Merge commit 'cb41b9c565d4eec9e1f06e24d429696f59f2f07d'
[unleashed.git] / usr / src / uts / i86pc / Makefile.i86pc
blobeb328779a78737fabe2f4e2153a592d80a432c96
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
23 # uts/i86pc/Makefile.i86pc
25 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
26 # Copyright (c) 2013 Andrew Stormont.  All rights reserved.
29 #       This makefile contains the common definitions for the i86pc unix
30 #       and all i86pc implementation architecture dependent modules.
34 #       Machine type (implementation architecture):
36 PLATFORM         = i86pc
39 #       uname -m value
41 UNAME_M         = $(PLATFORM)
44 #       Everybody needs to know how to build modstubs.o and to locate unix.o
46 UNIX_DIR         = $(UTSBASE)/$(PLATFORM)/unix
47 GENLIB_DIR       = $(UTSBASE)/intel/genunix
48 MODSTUBS_DIR     = $(UNIX_DIR)
49 DSF_DIR          = $(UTSBASE)/$(PLATFORM)/genassym
51 DTRACESTUBS_O    = $(OBJS_DIR)/dtracestubs.o
52 DTRACESTUBS      = $(OBJS_DIR)/libdtracestubs.so
54 SYM_MOD         = $(OBJS_DIR)/unix.sym
56 UNIX_O           = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
57 MODSTUBS_O       = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
58 GENLIB           = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
61 #       Include the makefiles which define build rule templates, the
62 #       collection of files per module, and a few specific flags. Note
63 #       that order is significant, just as with an include path. The
64 #       first build rule template which matches the files name will be
65 #       used. By including these in order from most machine dependent
66 #       to most machine independent, we allow a machine dependent file
67 #       to be used in preference over a machine independent version
68 #       (Such as a machine specific optimization, which preserves the
69 #       interfaces.)
71 include $(UTSBASE)/$(PLATFORM)/Makefile.files
72 include $(UTSBASE)/intel/Makefile.files
73 include $(UTSBASE)/common/Makefile.files
76 #       Include machine independent rules. Note that this does not imply
77 #       that the resulting module from rules in Makefile.uts is machine
78 #       independent. Only that the build rules are machine independent.
80 include $(UTSBASE)/Makefile.uts
83 #       Define supported builds
85 DEF_BUILDS              = $(DEF_BUILDS64)
86 ALL_BUILDS              = $(ALL_BUILDS64)
89 #       kernel-specific optimizations; override default in Makefile.master
92 CFLAGS_XARCH_32         = $(i386_CFLAGS)
93 CFLAGS_XARCH_64         = $(amd64_CFLAGS)
94 CFLAGS_XARCH            = $(CFLAGS_XARCH_$(CLASS))
96 COPTFLAG_32             = $(COPTFLAG)
97 COPTFLAG_64             = $(COPTFLAG64)
98 COPTIMIZE               = $(COPTFLAG_$(CLASS))
100 CFLAGS                  = $(CFLAGS_XARCH)
101 CFLAGS                  += $(COPTIMIZE)
102 CFLAGS                  += -D_ASM_INLINES
103 CFLAGS                  += $(CFLAGS_uts)
105 ASFLAGS_XARCH_32        = $(i386_ASFLAGS)
106 ASFLAGS_XARCH_64        = $(amd64_ASFLAGS)
107 ASFLAGS_XARCH           = $(ASFLAGS_XARCH_$(CLASS))
109 ASFLAGS                 += $(ASFLAGS_XARCH)
111 AS_INC_PATH             += -I$(DSF_DIR)/$(OBJS_DIR)
114 #       The following must be defined for all implementations:
116 #       MAPFILE:        ld mapfile for the build of kernel/unix.
117 #       MODSTUBS:       Module stubs source file.
118 #       GENASSYM_SRC:   genassym.c
120 MAPFILE          = $(SRCTOP)/arch/x86/kernel/platform/i86pc/mapfile-$(CLASS)
121 MODSTUBS         = $(SRCTOP)/arch/x86/kernel/ml/modstubs.s
122 GENASSYM_SRC     = $(UTSBASE)/$(PLATFORM)/ml/genassym.c
123 OFFSETS_SRC      = $(SRCTOP)/arch/x86/kernel/offsets.in
124 PLATFORM_OFFSETS_SRC    = $(SRCTOP)/arch/x86/kernel/mach_offsets_$(CLASS).in
125 KDI_OFFSETS_SRC  = $(SRCTOP)/arch/x86/kernel/kdi/offsets.in
128 #       Define the actual specific platforms
130 MACHINE_DEFS     = -D$(PLATFORM) -D_MACHDEP
133 #       Software workarounds for hardware "features"
136 include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
139 #       Debugging level
141 #       Special knowledge of which special debugging options effect which
142 #       file is used to optimize the build if these flags are changed.
144 #       XXX: The above could possibly be done for more flags and files, but
145 #            is left as an experiment to the interested reader. Be forewarned,
146 #            that excessive use could lead to maintenance difficulties.
148 DEBUG_DEFS_OBJ32        =
149 DEBUG_DEFS_DBG32        = -DDEBUG
150 DEBUG_DEFS_OBJ64        =
151 DEBUG_DEFS_DBG64        = -DDEBUG
152 DEBUG_DEFS              = $(DEBUG_DEFS_$(BUILD_TYPE))
154 DEBUG_COND_OBJ32        = $(POUND_SIGN)
155 DEBUG_COND_DBG32        =
156 DEBUG_COND_OBJ64        = $(POUND_SIGN)
157 DEBUG_COND_DBG64        =
158 IF_DEBUG_OBJ            = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
160 $(IF_DEBUG_OBJ)trap.o           := DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE
161 $(IF_DEBUG_OBJ)syscall_asm.o    := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
162 $(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
163 $(IF_DEBUG_OBJ)fast_trap_asm.o  := DEBUG_DEFS += -DTRAPTRACE
164 $(IF_DEBUG_OBJ)interrupt.o      := DEBUG_DEFS += -DTRAPTRACE
165 $(IF_DEBUG_OBJ)intr.o           := DEBUG_DEFS += -DTRAPTRACE
166 $(IF_DEBUG_OBJ)locore.o         := DEBUG_DEFS += -DTRAPTRACE
167 $(IF_DEBUG_OBJ)mp_startup.o     := DEBUG_DEFS += -DTRAPTRACE
168 $(IF_DEBUG_OBJ)machdep.o        := DEBUG_DEFS += -DTRAPTRACE
169 $(IF_DEBUG_OBJ)exception.o      := DEBUG_DEFS += -DTRAPTRACE
170 $(IF_DEBUG_OBJ)x_call.o         := DEBUG_DEFS += -DTRAPTRACE
171 $(IF_DEBUG_OBJ)mp_call.o        := DEBUG_DEFS += -DTRAPTRACE
172 $(IF_DEBUG_OBJ)cbe.o            := DEBUG_DEFS += -DTRAPTRACE
175 #       Collect the preprocessor definitions to be associated with *all*
176 #       files.
178 ALL_DEFS         = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
179                    $(OPTION_DEFS)
180 GENASSYM_DEFS    = $(MACHINE_DEFS) $(OPTION_DEFS) \
181                         -fno-eliminate-unused-debug-symbols \
182                         -fno-eliminate-unused-debug-types
185 # ----- TRANSITIONAL SECTION --------------------------------------------------
189 #       Not everything which *should* be a module is a module yet. The
190 #       following is a list of such objects which are currently part of
191 #       the base kernel but should soon become kmods.
193 #       XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever
194 #            made into a module. If it is made MT safe before being made
195 #            into a module, it should be added to this list. It was in
196 #            this list pre ON-4.0.
199 MACH_NOT_YET_KMODS      = $(AUTOCONF_OBJS)
202 # ----- END OF TRANSITIONAL SECTION -------------------------------------------
206 #       The kernels modules which are "implementation architecture"
207 #       specific for this machine are enumerated below. Note that most
208 #       of these modules must exist (in one form or another) for each
209 #       architecture.
211 #       Machine Specific Driver Modules (/kernel/drv)
212 #       DRV_KMODS are built both 32-bit and 64-bit
213 #       DRV_KMODS_32 are built only 32-bit
214 #       DRV_KMODS_64 are built only 64-bit
216 DRV_KMODS       += rootnex
217 DRV_KMODS       += isa
218 DRV_KMODS       += pcplusmp
219 DRV_KMODS       += apix
220 DRV_KMODS       += cpc
221 DRV_KMODS       += pci
222 DRV_KMODS       += npe
223 DRV_KMODS       += pci-ide
224 DRV_KMODS       += xsvc
225 DRV_KMODS       += tzmon
226 DRV_KMODS       += acpi_drv 
227 DRV_KMODS       += acpinex
228 DRV_KMODS       += amd_iommu
229 DRV_KMODS       += dr
230 DRV_KMODS       += ioat
231 DRV_KMODS       += fipe
233 DRV_KMODS       += cpudrv
237 # Platform Power Modules
239 DRV_KMODS       += ppm acpippm
242 #       CPU Modules
244 CPU_KMODS       += amd_opteron
245 CPU_KMODS       += generic_cpu
246 CPU_KMODS       += authenticamd
247 CPU_KMODS       += genuineintel
250 #       Exec Class Modules (/kernel/exec):
252 EXEC_KMODS      +=
255 #       File System Modules (/kernel/fs):
257 FS_KMODS        +=
260 #       Streams Modules (/kernel/strmod):
262 STRMOD_KMODS    +=
265 #       'System' Modules (/kernel/sys):
267 SYS_KMODS       +=
270 #       'Misc' Modules (/kernel/misc):
272 MISC_KMODS      += gfx_private pcie
273 MISC_KMODS      += acpidev
274 MISC_KMODS      += drmach_acpi
277 #       'Dacf' modules (/kernel/dacf)
279 DACF_KMODS      += consconfig_dacf
282 #       'Mach' Modules (/kernel/mach):
284 MACH_KMODS      += uppc
287 #       CPR Misc Module.
289 MISC_KMODS      += cpr