# 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. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013 Andrew Stormont. All rights reserved. # Copyright (c) 2015, Joyent, Inc. All rights reserved. # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # Copyright 2016 Gary Mills # # This makefile contains the common definitions for all sparc # implementation architecture independent modules. # # # Define supported builds # DEF_BUILDS = $(DEF_BUILDS64) ALL_BUILDS = $(ALL_BUILDS64) # # Everybody needs to know how to build modstubs.o and to locate unix.o. # Note that unix.o must currently be selected from among the possible # "implementation architectures". Note further, that unix.o is only # used as an optional error check for undefines so (theoretically) # any "implementation architectures" could be used. We choose sun4u # because it is the reference port. # UNIX_DIR = $(UTSBASE)/sun4u/unix GENLIB_DIR = $(UTSBASE)/sun4u/genunix IPDRV_DIR = $(UTSBASE)/sparc/ip MODSTUBS_DIR = $(UNIX_DIR) DSF_DIR = $(UNIX_DIR) LINTS_DIR = $(OBJS_DIR) LINT_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR) UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o GENLIB = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/libgenunix.so LINT_LIB = # was llib-lunix.ln GEN_LINT_LIB = # was llib-lgenunix.ln LINT32_DIRS = $(LINT32_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%) LINT32_FILES = $(LINT32_DIRS:%=%/llib-l$(MODULE).ln) LINT64_DIRS = $(LINT64_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%) LINT64_FILES = $(LINT64_DIRS:%=%/llib-l$(MODULE).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)/sparc/Makefile.files include $(UTSBASE)/sparc/v9/Makefile.files include $(UTSBASE)/sun/Makefile.files include $(UTSBASE)/common/Makefile.files # # ----- 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 # genunix but which might someday become kmods. This must be # defined before we include Makefile.uts, or else genunix's build # won't be as parallel as we might like. # NOT_YET_KMODS = $(OLDPTY_OBJS) $(PTY_OBJS) $(VCONS_CONF_OBJS) $(MOD_OBJS) # # ----- END OF TRANSITIONAL SECTION ------------------------------------------- # # 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 # # machine specific optimization, override default in Makefile.master # XARCH_32 = -xarch=v8 XARCH_64 = -m64 XARCH = $(XARCH_$(CLASS)) COPTIMIZE_32 = -xO3 COPTIMIZE_64 = -xO3 COPTIMIZE = $(COPTIMIZE_$(CLASS)) CCMODE = -Xa CFLAGS_32 = -xcg92 CFLAGS_64 = -xchip=ultra $(CCABS32) $(CCREGSYM) CFLAGS = $(CFLAGS_$(CLASS)) CFLAGS += $(XARCH) CFLAGS += $(COPTIMIZE) CFLAGS += $(EXTRA_CFLAGS) CFLAGS += $(XAOPT) CFLAGS += $(INLINES) -D_ASM_INLINES CFLAGS += $(CCMODE) CFLAGS += $(SPACEFLAG) CFLAGS += $(CERRWARN) CFLAGS += $(CTF_FLAGS_$(CLASS)) CFLAGS += $(C99MODE) CFLAGS += $(CCUNBOUND) CFLAGS += $(CCSTATICSYM) CFLAGS += $(CC32BITCALLERS) CFLAGS += $(CCNOAUTOINLINE) CFLAGS += $(IROPTFLAG) CFLAGS += $(CGLOBALSTATIC) CFLAGS += -xregs=no%float CFLAGS += -xstrconst CFLAGS += $(CSOURCEDEBUGFLAGS) CFLAGS += $(CUSERFLAGS) ASFLAGS += $(XARCH) LINT_DEFS_32 = LINT_DEFS_64 = -m64 LINT_DEFS += $(LINT_DEFS_$(CLASS)) # # The following must be defined for all implementations: # # MODSTUBS: Module stubs source file. # MODSTUBS = $(UTSBASE)/sparc/ml/modstubs.s # # Define the actual specific platforms - obviously none. # MACHINE_DEFS = # # 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)syscall.o := DEBUG_DEFS += -DSYSCALLTRACE $(IF_DEBUG_OBJ)clock.o := DEBUG_DEFS += -DKSLICE=1 # Comment these out if you don't want dispatcher lock statistics. # $(IF_DEBUG_OBJ)disp_lock.o := DEBUG_DEFS += -DDISP_LOCK_STATS # # Collect the preprocessor definitions to be associated with *all* # files. # ALL_DEFS = $(MACHINE_DEFS) $(DEBUG_DEFS) $(OPTION_DEFS) # # # 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. # # Common Drivers (usually pseudo drivers) (/kernel/drv): # DRV_KMODS += foo # # 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 += # # 'User' Modules (/kernel/misc): # MISC_KMODS += # # Software Cryptographic Providers (/kernel/crypto): # CRYPTO_KMODS += # # IP Policy Modules (/kernel/ipp): # IPP_KMODS += # # 'Dacf' modules (/kernel/dacf) DACF_KMODS += # # Modules eXcluded from the product: # XMODS += # # 'Dacf' Modules (/kernel/dacf): # DACF_KMODS += # # MAC-Type Plugin Modules (/kernel/mac) # MAC_KMODS += # # socketmod (kernel/socketmod) # SOCKET_KMODS += # # kiconv modules (/kernel/kiconv): # KICONV_KMODS +=