Print this page
4266 remove Makefile*.shared nonsense in uts
@@ -1,5 +1,6 @@
+#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
@@ -17,14 +18,312 @@
#
# CDDL HEADER END
#
#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# uts/i86pc/Makefile.i86pc
+#
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013 Andrew Stormont. All rights reserved.
+#
+#
+# This makefile contains the common definitions for the i86pc unix
+# and all i86pc implementation architecture dependent modules.
+#
+
+#
+# Machine type (implementation architecture):
+#
+PLATFORM = i86pc
+
+#
+# uname -m value
+#
+UNAME_M = $(PLATFORM)
+
+#
+# Definitions for the platform-specific /platform directories.
+#
+# IMPLEMENTATIONS is used to designate i86pc machines which have
+# platform specific modules. All code specific to a given implementation
+# resides in the appropriately named subdirectory. This requires
+# these platforms to have their own Makefiles to define ROOT_PLAT_DIRS,
+# USR_PLAT_DIRS, etc.
+#
+IMPLEMENTATIONS = i86hvm
+
+#
+# Everybody needs to know how to build modstubs.o and to locate unix.o
+#
+UNIX_DIR = $(UTSBASE)/$(PLATFORM)/unix
+GENLIB_DIR = $(UTSBASE)/intel/genunix
+MODSTUBS_DIR = $(UNIX_DIR)
+DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym
+LINTS_DIR = $(OBJS_DIR)
+LINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
+GEN_LINT_LIB_DIR = $(UTSBASE)/intel/lint-libs/$(OBJS_DIR)
+
+LINT32_DIRS = $(LINT32_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%)
+LINT32_FILES = $(LINT32_DIRS:%=%/llib-l$(MODULE).ln)
+
+DTRACESTUBS_O = $(OBJS_DIR)/dtracestubs.o
+DTRACESTUBS = $(OBJS_DIR)/libdtracestubs.so
+
+SYM_MOD = $(OBJS_DIR)/unix.sym
+
+UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
+MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
+GENLIB = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
+LINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln
+DBOOT_LINT_LIB = $(LINT_LIB_DIR)/llib-ldboot.ln
+GEN_LINT_LIB = $(GEN_LINT_LIB_DIR)/llib-lgenunix.ln
+
+#
+# Include the makefiles which define build rule templates, the
+# collection of files per module, and a few specific flags. Note
+# that order is significant, just as with an include path. The
+# first build rule template which matches the files name will be
+# used. By including these in order from most machine dependent
+# to most machine independent, we allow a machine dependent file
+# to be used in preference over a machine independent version
+# (Such as a machine specific optimization, which preserves the
+# interfaces.)
+#
+include $(UTSBASE)/$(PLATFORM)/Makefile.files
+include $(UTSBASE)/intel/Makefile.files
+include $(UTSBASE)/common/Makefile.files
+
+#
+# Include machine independent rules. Note that this does not imply
+# that the resulting module from rules in Makefile.uts is machine
+# independent. Only that the build rules are machine independent.
+#
+include $(UTSBASE)/Makefile.uts
+
+#
+# Define supported builds
+#
+DEF_BUILDS = $(DEF_BUILDS64) $(DEF_BUILDS32)
+ALL_BUILDS = $(ALL_BUILDS64) $(ALL_BUILDS32)
+
+#
+# x86 or amd64 inline templates
+#
+INLINES_32 = $(UTSBASE)/intel/ia32/ml/ia32.il \
+ $(UTSBASE)/$(PLATFORM)/ml/ia32.il
+INLINES_64 = $(UTSBASE)/intel/amd64/ml/amd64.il \
+ $(UTSBASE)/$(PLATFORM)/ml/amd64.il
+INLINES += $(INLINES_$(CLASS))
+
+#
+# kernel-specific optimizations; override default in Makefile.master
+#
+
+CFLAGS_XARCH_32 = $(i386_CFLAGS)
+CFLAGS_XARCH_64 = $(amd64_CFLAGS)
+CFLAGS_XARCH = $(CFLAGS_XARCH_$(CLASS))
+
+COPTFLAG_32 = $(COPTFLAG)
+COPTFLAG_64 = $(COPTFLAG64)
+COPTIMIZE = $(COPTFLAG_$(CLASS))
+
+CFLAGS = $(CFLAGS_XARCH)
+CFLAGS += $(COPTIMIZE)
+CFLAGS += $(INLINES) -D_ASM_INLINES
+CFLAGS += $(CCMODE)
+CFLAGS += $(SPACEFLAG)
+CFLAGS += $(CCUNBOUND)
+CFLAGS += $(CFLAGS_uts)
+CFLAGS += -xstrconst
+
+ASFLAGS_XARCH_32 = $(i386_ASFLAGS)
+ASFLAGS_XARCH_64 = $(amd64_ASFLAGS)
+ASFLAGS_XARCH = $(ASFLAGS_XARCH_$(CLASS))
+
+ASFLAGS += $(ASFLAGS_XARCH)
+
+AS_INC_PATH += -I$(DSF_DIR)/$(OBJS_DIR)
+
+#
+# The following must be defined for all implementations:
+#
+# MAPFILE: ld mapfile for the build of kernel/unix.
+# MODSTUBS: Module stubs source file.
+# GENASSYM_SRC: genassym.c
+#
+MAPFILE = $(UTSBASE)/$(PLATFORM)/conf/Mapfile
+MODSTUBS = $(UTSBASE)/intel/ia32/ml/modstubs.s
+GENASSYM_SRC = $(UTSBASE)/$(PLATFORM)/ml/genassym.c
+OFFSETS_SRC = $(UTSBASE)/$(PLATFORM)/ml/offsets.in
+PLATFORM_OFFSETS_32 = $(UTSBASE)/$(PLATFORM)/ml/mach_offsets.in
+PLATFORM_OFFSETS_64 = $(UTSBASE)/intel/amd64/ml/mach_offsets.in
+PLATFORM_OFFSETS_SRC = $(PLATFORM_OFFSETS_$(CLASS))
+KDI_OFFSETS_SRC = $(UTSBASE)/intel/kdi/kdi_offsets.in
+
+#
+# Define the actual specific platforms
+#
+MACHINE_DEFS = -D$(PLATFORM) -D_MACHDEP
+
+#
+# Software workarounds for hardware "features"
+#
+
+include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
+
+#
+# Debugging level
+#
+# Special knowledge of which special debugging options effect which
+# file is used to optimize the build if these flags are changed.
+#
+# XXX: The above could possibly be done for more flags and files, but
+# is left as an experiment to the interested reader. Be forewarned,
+# that excessive use could lead to maintenance difficulties.
+#
+DEBUG_DEFS_OBJ32 =
+DEBUG_DEFS_DBG32 = -DDEBUG
+DEBUG_DEFS_OBJ64 =
+DEBUG_DEFS_DBG64 = -DDEBUG
+DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE))
+
+DEBUG_COND_OBJ32 = $(POUND_SIGN)
+DEBUG_COND_DBG32 =
+DEBUG_COND_OBJ64 = $(POUND_SIGN)
+DEBUG_COND_DBG64 =
+IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
+
+$(IF_DEBUG_OBJ)trap.o := DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE
+$(IF_DEBUG_OBJ)syscall_asm.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
+$(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
+$(IF_DEBUG_OBJ)fast_trap_asm.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)interrupt.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)intr.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)locore.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)mp_startup.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)machdep.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)exception.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)x_call.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)mp_call.o := DEBUG_DEFS += -DTRAPTRACE
+$(IF_DEBUG_OBJ)cbe.o := DEBUG_DEFS += -DTRAPTRACE
+
+#
+# Collect the preprocessor definitions to be associated with *all*
+# files.
+#
+ALL_DEFS = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
+ $(OPTION_DEFS)
+GENASSYM_DEFS = $(MACHINE_DEFS) $(OPTION_DEFS) \
+ -_gcc=-fno-eliminate-unused-debug-symbols \
+ -_gcc=-fno-eliminate-unused-debug-types
+
+#
+# ----- TRANSITIONAL SECTION --------------------------------------------------
+#
+
+#
+# Not everything which *should* be a module is a module yet. The
+# following is a list of such objects which are currently part of
+# the base kernel but should soon become kmods.
#
-# ident "%Z%%M% %I% %E% SMI"
+# XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever
+# made into a module. If it is made MT safe before being made
+# into a module, it should be added to this list. It was in
+# this list pre ON-4.0.
#
+#
+MACH_NOT_YET_KMODS = $(AUTOCONF_OBJS)
+
+#
+# ----- END OF TRANSITIONAL SECTION -------------------------------------------
+#
+
+#
+# The kernels modules which are "implementation architecture"
+# specific for this machine are enumerated below. Note that most
+# of these modules must exist (in one form or another) for each
+# architecture.
+#
+# Machine Specific Driver Modules (/kernel/drv)
+# DRV_KMODS are built both 32-bit and 64-bit
+# DRV_KMODS_32 are built only 32-bit
+# DRV_KMODS_64 are built only 64-bit
+#
+DRV_KMODS += rootnex
+DRV_KMODS += isa
+DRV_KMODS += pcplusmp
+DRV_KMODS += apix
+DRV_KMODS += cpc
+DRV_KMODS += pci
+DRV_KMODS += npe
+DRV_KMODS += pci-ide
+DRV_KMODS += xsvc
+DRV_KMODS += tzmon
+DRV_KMODS += acpi_drv
+DRV_KMODS += acpinex
+DRV_KMODS += amd_iommu
+DRV_KMODS += dr
+DRV_KMODS += ioat
+DRV_KMODS += fipe
+
+DRV_KMODS += cpudrv
-UTSTREE=$(UTSBASE)
-include $(UTSBASE)/i86pc/Makefile.i86pc.shared
+#
+# Platform Power Modules
+#
+DRV_KMODS += ppm acpippm
+
+#
+# CPU Modules
+#
+CPU_KMODS += amd_opteron
+CPU_KMODS += generic_cpu
+CPU_KMODS += authenticamd
+CPU_KMODS += genuineintel
+
+#
+# Exec Class Modules (/kernel/exec):
+#
+EXEC_KMODS +=
+
+#
+# Scheduling Class Modules (/kernel/sched):
+#
+SCHED_KMODS +=
+
+#
+# File System Modules (/kernel/fs):
+#
+FS_KMODS +=
+
+#
+# Streams Modules (/kernel/strmod):
+#
+STRMOD_KMODS +=
+
+#
+# 'System' Modules (/kernel/sys):
+#
+SYS_KMODS +=
+
+#
+# 'Misc' Modules (/kernel/misc):
+#
+MISC_KMODS += gfx_private pcie
+MISC_KMODS += acpidev
+MISC_KMODS += drmach_acpi
+
+#
+# 'Dacf' modules (/kernel/dacf)
+#
+DACF_KMODS += consconfig_dacf
+
+#
+# 'Mach' Modules (/kernel/mach):
+#
+MACH_KMODS += uppc
+
+#
+# CPR Misc Module.
+#
+MISC_KMODS += cpr