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, Version 1.0 only 6# (the "License"). You may not use this file except in compliance 7# with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22# 23# uts/i86pc/Makefile.i86pc 24# 25# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 26# Use is subject to license terms. 27# 28# ident "%Z%%M% %I% %E% SMI" 29# 30# This makefile contains the common definitions for the i86pc unix 31# and all i86pc implementation architecture dependent modules. 32# 33 34# 35# Machine type (implementation architecture): 36# 37PLATFORM = i86pc 38 39# 40# Everybody needs to know how to build modstubs.o and to locate unix.o 41# 42UNIX_DIR = $(UTSBASE)/$(PLATFORM)/unix 43GENLIB_DIR = $(UTSBASE)/intel/genunix 44MODSTUBS_DIR = $(UNIX_DIR) 45DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym 46LINTS_DIR = $(OBJS_DIR) 47LINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR) 48GEN_LINT_LIB_DIR = $(UTSBASE)/intel/lint-libs/$(OBJS_DIR) 49 50DTRACESTUBS_O = $(OBJS_DIR)/dtracestubs.o 51DTRACESTUBS = $(OBJS_DIR)/libdtracestubs.so 52 53SYM_MOD = $(OBJS_DIR)/unix.sym 54 55UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o 56MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o 57GENLIB = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so 58LINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln 59GEN_LINT_LIB = $(GEN_LINT_LIB_DIR)/llib-lgenunix.ln 60 61# 62# Include the makefiles which define build rule templates, the 63# collection of files per module, and a few specific flags. Note 64# that order is significant, just as with an include path. The 65# first build rule template which matches the files name will be 66# used. By including these in order from most machine dependent 67# to most machine independent, we allow a machine dependent file 68# to be used in preference over a machine independent version 69# (Such as a machine specific optimization, which preserves the 70# interfaces.) 71# 72include $(UTSBASE)/$(PLATFORM)/Makefile.files 73include $(UTSBASE)/intel/Makefile.files 74include $(UTSBASE)/common/Makefile.files 75 76# 77# Include machine independent rules. Note that this does not imply 78# that the resulting module from rules in Makefile.uts is machine 79# independent. Only that the build rules are machine independent. 80# 81include $(UTSBASE)/Makefile.uts 82 83# 84# Define supported builds 85# 86DEF_BUILDS = $(DEF_BUILDS64) $(DEF_BUILDS32) 87ALL_BUILDS = $(ALL_BUILDS64) $(ALL_BUILDS32) 88 89# 90# x86 or amd64 inline templates 91# 92INLINES_32 = $(UTSBASE)/intel/ia32/ml/ia32.il 93INLINES_64 = $(UTSBASE)/intel/amd64/ml/amd64.il 94INLINES += $(INLINES_$(CLASS)) 95 96# 97# kernel-specific optimizations; override default in Makefile.master 98# 99 100CFLAGS_XARCH_32 = $(i386_CFLAGS) 101CFLAGS_XARCH_64 = $(amd64_CFLAGS) 102CFLAGS_XARCH = $(CFLAGS_XARCH_$(CLASS)) 103 104COPTFLAG_32 = $(COPTFLAG) 105COPTFLAG_64 = $(COPTFLAG64) 106COPTIMIZE = $(COPTFLAG_$(CLASS)) 107 108CFLAGS = $(CFLAGS_XARCH) 109CFLAGS += $(COPTIMIZE) 110CFLAGS += $(INLINES) -D_ASM_INLINES 111CFLAGS += $(CCMODE) 112CFLAGS += $(SPACEFLAG) 113CFLAGS += $(CCUNBOUND) 114CFLAGS += $(CFLAGS_uts) 115 116ASFLAGS_XARCH_32 = $(i386_ASFLAGS) 117ASFLAGS_XARCH_64 = $(amd64_ASFLAGS) 118ASFLAGS_XARCH = $(ASFLAGS_XARCH_$(CLASS)) 119 120ASFLAGS += $(ASFLAGS_XARCH) 121 122AS_INC_PATH += -I$(DSF_DIR)/$(OBJS_DIR) 123 124# 125# The following must be defined for all implementations: 126# 127# MAPFILE: ld mapfile for the build of kernel/unix. 128# MODSTUBS: Module stubs source file. 129# GENASSYM_SRC: genassym.c 130# 131MAPFILE = $(UTSBASE)/$(PLATFORM)/conf/Mapfile 132MODSTUBS = $(UTSBASE)/intel/ia32/ml/modstubs.s 133GENASSYM_SRC = $(UTSBASE)/$(PLATFORM)/ml/genassym.c 134OFFSETS_SRC = $(UTSBASE)/$(PLATFORM)/ml/offsets.in 135PLATFORM_OFFSETS_32 = $(UTSBASE)/$(PLATFORM)/ml/mach_offsets.in 136PLATFORM_OFFSETS_64 = $(UTSBASE)/intel/amd64/ml/mach_offsets.in 137PLATFORM_OFFSETS_SRC = $(PLATFORM_OFFSETS_$(CLASS)) 138 139# 140# Define the actual specific platforms 141# 142MACHINE_DEFS = -D$(PLATFORM) -D_MACHDEP 143 144# 145# Software workarounds for hardware "features" 146# 147 148include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds 149 150# 151# Simulator flag 152# 153i386_SIMULATOR = -D_SIMULATOR_SUPPORT 154amd64_SIMULATOR = -D_SIMULATOR_SUPPORT 155 156SIMULATOR = $($(MACH)_SIMULATOR) 157 158# 159# Debugging level 160# 161# Special knowledge of which special debugging options effect which 162# file is used to optimize the build if these flags are changed. 163# 164# XXX: The above could possibly be done for more flags and files, but 165# is left as an experiment to the interested reader. Be forewarned, 166# that excessive use could lead to maintenance difficulties. 167# 168DEBUG_DEFS_OBJ32 = 169DEBUG_DEFS_DBG32 = -DDEBUG 170DEBUG_DEFS_DBG32 += $(SIMULATOR) 171DEBUG_DEFS_OBJ64 = 172DEBUG_DEFS_DBG64 = -DDEBUG 173DEBUG_DEFS_DBG64 += $(SIMULATOR) 174DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE)) 175 176DEBUG_COND_OBJ32 :sh = echo \\043 177DEBUG_COND_DBG32 = 178DEBUG_COND_OBJ64 :sh = echo \\043 179DEBUG_COND_DBG64 = 180IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/ 181 182$(IF_DEBUG_OBJ)trap.o := DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE 183$(IF_DEBUG_OBJ)syscall_asm.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE 184$(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE 185$(IF_DEBUG_OBJ)fast_trap_asm.o := DEBUG_DEFS += -DTRAPTRACE 186$(IF_DEBUG_OBJ)interrupt.o := DEBUG_DEFS += -DTRAPTRACE 187$(IF_DEBUG_OBJ)locore.o := DEBUG_DEFS += -DTRAPTRACE 188$(IF_DEBUG_OBJ)mp_startup.o := DEBUG_DEFS += -DTRAPTRACE 189$(IF_DEBUG_OBJ)machdep.o := DEBUG_DEFS += -DTRAPTRACE 190$(IF_DEBUG_OBJ)exception.o := DEBUG_DEFS += -DTRAPTRACE 191 192# 193# Build `options'. These are historical and the need for these 194# was removed by the module technology. 195# 196OPTION_DEFS = -DC2_AUDIT 197 198# 199# Collect the preprocessor definitions to be associated with *all* 200# files. 201# 202ALL_DEFS = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \ 203 $(OPTION_DEFS) 204GENASSYM_DEFS = $(MACHINE_DEFS) $(OPTION_DEFS) \ 205 -_gcc=-fno-eliminate-unused-debug-symbols \ 206 -_gcc=-fno-eliminate-unused-debug-types 207 208# 209# ----- TRANSITIONAL SECTION -------------------------------------------------- 210# 211 212# 213# Not everything which *should* be a module is a module yet. The 214# following is a list of such objects which are currently part of 215# the base kernel but should soon become kmods. 216# 217# XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever 218# made into a module. If it is made MT safe before being made 219# into a module, it should be added to this list. It was in 220# this list pre ON-4.0. 221# 222# 223MACH_NOT_YET_KMODS = $(AUTOCONF_OBJS) 224 225# 226# ----- END OF TRANSITIONAL SECTION ------------------------------------------- 227# 228 229# 230# The kernels modules which are "implementation architecture" 231# specific for this machine are enumerated below. Note that most 232# of these modules must exist (in one form or another) for each 233# architecture. 234# 235# Machine Specific Driver Modules (/kernel/drv) 236# DRV_KMODS are built both 32-bit and 64-bit 237# DRV_KMODS_32 are built only 32-bit 238# DRV_KMODS_64 are built only 64-bit 239# 240# XXX: How many of these are really machine specific? 241# 242DRV_KMODS += rootnex 243DRV_KMODS += isa 244DRV_KMODS += pci 245DRV_KMODS += pcic 246 247DRV_KMODS_32 += bscv 248DRV_KMODS_32 += bscbus 249DRV_KMODS_32 += chs 250DRV_KMODS += elxl 251DRV_KMODS += fd 252DRV_KMODS += fdc 253DRV_KMODS += kb8042 254DRV_KMODS += pci-ide 255DRV_KMODS += pcn 256DRV_KMODS_32 += ncrs 257DRV_KMODS_32 += sbpro 258DRV_KMODS += audiovia823x 259DRV_KMODS += audio810 260DRV_KMODS += audioens 261 262DRV_KMODS += ata 263DRV_KMODS_32 += dnet 264DRV_KMODS += iprb 265DRV_KMODS += bmc 266DRV_KMODS += logi 267DRV_KMODS_32 += mscsi 268DRV_KMODS_32 += msm 269DRV_KMODS += pcplusmp 270DRV_KMODS += rtls 271DRV_KMODS += agpgart 272DRV_KMODS += agptarget 273DRV_KMODS += amd64_gart 274 275DRV_KMODS += cpc 276 277# 278# Exec Class Modules (/kernel/exec): 279# 280EXEC_KMODS += 281 282# 283# Scheduling Class Modules (/kernel/sched): 284# 285SCHED_KMODS += 286 287# 288# File System Modules (/kernel/fs): 289# 290FS_KMODS += 291 292# 293# Streams Modules (/kernel/strmod): 294# 295STRMOD_KMODS += vuid2ps2 296STRMOD_KMODS += vuid3ps2 297STRMOD_KMODS += vuidm3p 298STRMOD_KMODS += vuidm4p 299STRMOD_KMODS += vuidm5p 300 301# 302# 'System' Modules (/kernel/sys): 303# 304SYS_KMODS += 305 306# 307# 'Misc' Modules (/kernel/misc): 308# 309MISC_KMODS += pci_autoconfig bootdev acpica 310 311# 312# 'Mach' Modules (/kernel/mach): 313# 314MACH_KMODS += uppc 315 316# 317# Modules excluded from the product: 318# 319XMODS += spwr 320