# # 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) 1991, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011 Bayard G. Bell. All rights reserved. # Copyright (c) 2011,2017 by Delphix. All rights reserved. # Copyright (c) 2013 Andrew Stormont. All rights reserved. # Copyright 2016 Hans Rosenfeld # Copyright 2019 Joyent, Inc. # Copyright 2021 Oxide Computer Company # # Hammerhead: Include guard to prevent duplicate variable definitions when # this file is included through multiple Makefile chains ifndef _MAKEFILE_UTS _MAKEFILE_UTS = 1 # # This Makefile contains the common targets and definitions for # all kernels. It is to be included in the Makefiles for specific # implementation architectures and processor architecture dependent # modules: i.e.: all driving kernel Makefiles. # # Include global definitions: # include $(SRC)/Makefile.master # # No text domain in the kernel. # DTEXTDOM = # # Keep references to $(SRC)/common relative. COMMONBASE= $(UTSBASE)/../common # # Setup build-specific vars # To add a build type: # add name to ALL_BUILDS32 & ALL_BUILDS64 # set CLASS_name and OBJ_DIR_name # add targets to Makefile.targ # # # DEF_BUILDS is for def, sischeck, and install # ALL_BUILDS is for everything else (all, clean, ...) # # The NOT_RELEASE_BUILD noise is to maintain compatibility with the # gatekeeper's nightly build script. # DEF_BUILDS32 = obj32 DEF_BUILDS64 = obj64 DEF_BUILDSONLY64 = obj64 $(NOT_RELEASE_BUILD)DEF_BUILDS32 = debug32 $(NOT_RELEASE_BUILD)DEF_BUILDS64 = debug64 $(NOT_RELEASE_BUILD)DEF_BUILDSONLY64 = debug64 ALL_BUILDS32 = obj32 debug32 ALL_BUILDS64 = obj64 debug64 ALL_BUILDSONLY64 = obj64 debug64 # # Build class (32b or 64b) # CLASS_OBJ32 = 32 CLASS_DBG32 = 32 CLASS_OBJ64 = 64 CLASS_DBG64 = 64 CLASS = $(CLASS_$(BUILD_TYPE)) # # Build subdirectory # OBJS_DIR_OBJ32 = obj32 OBJS_DIR_DBG32 = debug32 OBJS_DIR_OBJ64 = obj64 OBJS_DIR_DBG64 = debug64 OBJS_DIR = $(OBJS_DIR_$(BUILD_TYPE)) # # Create defaults so empty rules don't # confuse make # CLASS_ = 64 OBJS_DIR_ = debug64 # # Build tools # CC_sparc_32 = $(sparc_CC) CC_sparc_64 = $(sparcv9_CC) CC_i386_32 = $(i386_CC) CC_i386_64 = $(amd64_CC) CC_amd64_64 = $(amd64_CC) CC = $(CC_$(MACH)_$(CLASS)) AS_sparc_32 = $(sparc_AS) AS_sparc_64 = $(sparcv9_AS) AS_i386_32 = $(i386_AS) AS_i386_64 = $(amd64_AS) AS_amd64_64 = $(amd64_AS) AS = $(AS_$(MACH)_$(CLASS)) # Hammerhead: Use illumos native linker (sunld) for kernel modules. # GNU ld doesn't support -z noreloc, -ztype=kmod, or proper # ELFOSABI_SOLARIS marking required for kernel modules. # # On Hammerhead (self-hosted), /usr/bin/ld is GNU ld — the illumos linker # is installed as /usr/bin/sunld. On OI, /usr/bin/ld IS the illumos linker. # Auto-detect: prefer /usr/bin/sunld if it exists, else fall back to $(SUNLD). # This ensures kernel modules always link with the illumos linker even if # the environment file wasn't sourced (e.g. manual incremental builds). # # Clear LD_ALTEXEC for kernel linker invocations. # # On self-hosted Hammerhead, LD_ALTEXEC is set to gnu-ld-wrapper by # env/hammerhead.sh so that user-space gcc/collect2 routes through # GNU ld with flag translation. The kernel must use sunld directly — # the wrapper silently drops LOAD_SEGMENT mapfiles, which produces a # unix kernel whose dboot segment (and multiboot header) lands outside # the first 32 KB of the file. # # `unexport LD_ALTEXEC` does not reliably prevent recipe subshells from # inheriting the variable. Embedding `env LD_ALTEXEC=` in UTS_LD breaks # nested shell assignments (BUILD_CC's `LD_ALTEXEC=$(LD) $(GCC) …` # parses the extra `env` as a second env var). Use a wrapper script # (single-token path, safe in nested assignments) that unsets # LD_ALTEXEC before exec'ing sunld. unexport LD_ALTEXEC UTS_LD := $(SRC)/tools/scripts/sunld-kernel.sh # # Hammerhead: disable STRIP_STABS for all kernel modules. # # /usr/bin/strip is GNU strip (binutils) on Hammerhead. For illumos # kernel objects it: # 1. Reorders PT_LOAD segments by load address. This breaks unix — # the dboot segment (with the multiboot1/multiboot2 headers) moves # past the 32 KB window mbh_patch/loader scan. # 2. Zeroes out sh_link on non-standard sections. illumos kernel # modules link .dynamic -> .strtab (not .dynstr). GNU strip doesn't # recognize this, leaving sh_link=0, which makes krtld fail with # "get_dynamic: , sh_link not a string table for section N". # # Skip STRIP_STABS in POST_PROCESS for kernel builds. Modules keep their # symtabs; proto grows modestly (unix ~12 MB vs ~2.5 MB stripped) but # boot works and `mdb` retains kernel symbols. The other POST_PROCESS # steps (mcs -d, CTF processing, ELF signing) still run. STRIP_STABS = : LD_sparc_32 = $(UTS_LD) LD_sparc_64 = $(UTS_LD) LD_i386_32 = $(UTS_LD) LD_i386_64 = $(UTS_LD) LD_amd64_64 = $(UTS_LD) LD = $(LD_$(MACH)_$(CLASS)) # Override ZNORELOC for illumos ld native syntax (Makefile.master # sets it to -Wl,-znoreloc for GNU ld used in user-space) ZNORELOC = -z noreloc MODEL_32 = ilp32 MODEL_64 = lp64 MODEL = $(MODEL_$(CLASS)) # # Build the compile/assemble lines: # EXTRA_OPTIONS = AS_DEFS = -D_ASM ALWAYS_DEFS_32 = -D_KERNEL -D_SYSCALL32 -D_DDI_STRICT ALWAYS_DEFS_64 = -D_KERNEL -D_SYSCALL32 -D_SYSCALL32_IMPL -D_ELF64 \ -D_DDI_STRICT # # XX64 This should be defined by the compiler! # ALWAYS_DEFS_64 += -Dsun -D__sun -D__SVR4 ALWAYS_DEFS = $(ALWAYS_DEFS_$(CLASS)) # # CPPFLAGS is deliberatly set with a "=" and not a "+=". For the kernel # the header include path should not look for header files outside of # the kernel code. This "=" removes the search path built in # Makefile.master inside CPPFLAGS. Ditto for AS_CPPFLAGS. # CPPFLAGS = $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) \ $(INCLUDE_PATH) $(EXTRA_OPTIONS) AS_CPPFLAGS = $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) $(AS_DEFS) \ $(AS_INC_PATH) $(EXTRA_OPTIONS) # # Make it (relatively) easy to share compilation options between # all kernel implementations. # # Override the default, the kernel is squeaky clean # Hammerhead: Converted from Sun Studio to GCC flags # -errtags=yes -> -fdiagnostics-show-option (show which warning) # -errwarn=%all -> -Werror (warnings are errors) CERRWARN = -Wall -Wextra -Werror -fdiagnostics-show-option CERRWARN += -Wno-missing-braces CERRWARN += -Wno-sign-compare CERRWARN += -Wno-unused-parameter CERRWARN += -Wno-missing-field-initializers CERRWARN += -Wno-unused-but-set-variable CERRWARN += -Wno-main CERRWARN += $(CCWARNINLINE) CNOWARN_UNINIT = -Wno-maybe-uninitialized # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in # -nd builds $(RELEASE_BUILD)CERRWARN += -Wno-unused $(RELEASE_BUILD)CERRWARN += -Wno-empty-body CERRWARN += include $(SRC)/Makefile.smatch # # Ensure that the standard function prologue remains at the very start # of a function, so DTrace fbt will instrument the right place. # CFLAGS_uts_i386 += -fno-shrink-wrap # # retpoline support # CFLAGS_uts_i386 += -mindirect-branch=thunk-extern CFLAGS_uts_i386 += -mindirect-branch-register CSTD = $(CSTD_GNU99) CFLAGS_uts = CFLAGS_uts += $(STAND_FLAGS_$(CLASS)) CFLAGS_uts += $(CCVERBOSE) CFLAGS_uts += $(XAOPT) CFLAGS_uts += $(CTF_FLAGS_$(CLASS)) CFLAGS_uts += $(CERRWARN) CFLAGS_uts += $(CCNOAUTOINLINE) CFLAGS_uts += $(CCNOREORDER) CFLAGS_uts += $(CCNOAGGRESSIVELOOPS) CFLAGS_uts += $(CCINLINESIZE) CFLAGS_uts += $(EXTRA_CFLAGS) CFLAGS_uts += $(CSOURCEDEBUGFLAGS) CFLAGS_uts += $(CUSERFLAGS) CFLAGS_uts += $(CFLAGS_uts_$(MACH)) CFLAGS_uts += -fno-asynchronous-unwind-tables ASFLAGS_uts= $(CFLAGS_uts) # # Declare that $(OBJECTS) can be compiled in parallel. The DUMMY target # is for those instances where OBJECTS is empty (to avoid an # unconditional .PARALLEL). .PARALLEL: $(OBJECTS) DUMMY # # Expanded dependencies # DEF_DEPS = $(DEF_BUILDS:%=def.%) ALL_DEPS = $(ALL_BUILDS:%=all.%) CLEAN_DEPS = $(ALL_BUILDS:%=clean.%) CLOBBER_DEPS = $(ALL_BUILDS:%=clobber.%) INSTALL_DEPS = $(DEF_BUILDS:%=install.%) SYM_DEPS = $(SYM_BUILDS:%=symcheck.%) SISCHECK_DEPS = $(DEF_BUILDS:%=sischeck.%) SISCLEAN_DEPS = $(ALL_BUILDS:%=sisclean.%) # # Default module name # BINARY = $(OBJS_DIR)/$(MODULE) # # Default cleanup definitions # CLEANFILES = $(OBJECTS) CLOBBERFILES = $(BINARY) $(CLEANFILES) # # Installation constants: # # FILEMODE is the mode given to the kernel modules # CFILEMODE is the mode given to the '.conf' files # FILEMODE = 755 DIRMODE = 755 CFILEMODE = 644 # # Special Installation Macros for the installation of '.conf' files. # # These are unique because they are not installed from the current # working directory. # # Sigh. Apparently at some time in the past there was a confusion on # whether the name is SRC_CONFFILE or SRC_CONFILE. Consistency with the # other names would indicate SRC_CONFFILE, but the voting is >180 Makefiles # with SRC_CONFILE and about 11 with SRC_CONFFILE. Software development # isn't a popularity contest, though, and so my inclination is to define # both names for now and incrementally convert to SRC_CONFFILE to be consistent # with the other names. # CONFFILE = $(MODULE).conf SRC_CONFFILE = $(CONF_SRCDIR)/$(CONFFILE) SRC_CONFILE = $(SRC_CONFFILE) ROOT_CONFFILE_32 = $(ROOTMODULE).conf # Hammerhead: With flat layout (no SUBDIR64), conf file path is same as 32-bit ROOT_CONFFILE_64 = $(ROOTMODULE).conf ROOT_CONFFILE = $(ROOT_CONFFILE_$(CLASS)) INS.conffile= \ $(RM) $@; $(INS) -s -m $(CFILEMODE) -f $(@D) $(SRC_CONFFILE) # # By default, instead of $VERSION, we use $(UTS_LABEL), which is by # default set to $RELEASE aka "5.11". # # $VERSION changes when the git HEAD changes, leading to annoying merge # uniquification conflicts when doing partial builds during development. # The information from $VERSION is available via "buildversion" anyway. # CTFCVTFLAGS = -X -l "$(UTS_LABEL)" CTFMRGFLAGS += -l "$(UTS_LABEL)" # # The CTF merge of child kernel modules is performed against one of the genunix # modules. For Intel builds, all modules will be used with a single genunix: # the one built in intel/genunix. For SPARC builds, a given # module may be # used with one of a number of genunix files, depending on what platform the # module is deployed on. We merge against the sun4u genunix to optimize for # the common case. We also merge against the ip driver since networking is # typically loaded and types defined therein are shared between many modules. # CTFMERGE_GUDIR_sparc = sun4u CTFMERGE_GUDIR_i386 = intel # Hammerhead: amd64 also uses intel directory for genunix CTFMERGE_GUDIR_amd64 = intel CTFMERGE_GUDIR = $(CTFMERGE_GUDIR_$(MACH)) CTFMERGE_GENUNIX = \ $(UTSBASE)/$(CTFMERGE_GUDIR)/genunix/$(OBJS_DIR)/genunix # # Used to uniquify a non-genunix module against genunix. # # For the ease of developers dropping modules onto possibly unrelated systems, # you can set NO_GENUNIX_UNIQUIFY= in the environment to skip uniquifying # against genunix. # # NO_GENUNIX_UNIQUIFY=$(POUND_SIGN) CTFMERGE_GENUNIX_DFLAG=-d $(CTFMERGE_GENUNIX) $(NO_GENUNIX_UNIQUIFY)CTFMERGE_GENUNIX_DFLAG= CTFMERGE_UNIQUIFY_AGAINST_GENUNIX = \ $(CTFMERGE) $(CTFMRGFLAGS) $(CTFMERGE_GENUNIX_DFLAG) \ -o $@ $(OBJECTS) $(CTFEXTRAOBJS) # # Used to merge the genunix module. # CTFMERGE_GENUNIX_MERGE = \ $(CTFMERGE) $(CTFMRGFLAGS) -o $@ \ $(OBJECTS) $(CTFEXTRAOBJS) $(IPCTF_TARGET) # # We ctfmerge the ip objects into genunix to maximize the number of common types # found there, thus maximizing the effectiveness of uniquification. We don't # want the genunix build to have to know about the individual ip objects, so we # put them in an archive. The genunix ctfmerge then includes this archive. # IPCTF = $(IPDRV_DIR)/$(OBJS_DIR)/ipctf.a # # Rule for building fake shared libraries used for symbol resolution # when building other modules. -znoreloc is needed here to avoid # tripping over code that isn't really suitable for shared libraries. # BUILD.SO = \ $(LD) -o $@ $(GSHARED) $(ZNORELOC) -h $(SONAME) # # SONAME defaults for common fake shared libraries. # Hammerhead: GNU Make syntax with guards for empty variables # ifneq ($(LIBGEN),) $(LIBGEN): SONAME = $(MODULE) endif ifneq ($(PLATLIB),) $(PLATLIB): SONAME = misc/platmod endif ifneq ($(CPULIB),) $(CPULIB): SONAME = 'cpu/$$CPU' endif ifneq ($(DTRACESTUBS),) $(DTRACESTUBS): SONAME = dtracestubs endif # # Installation directories # # # Hammerhead: Flat kernel module layout. # All modules install directly into /kernel// — no amd64 subdir. # SUBDIR64 is empty so _32 and _64 paths are identical. # SUBDIR64 = ROOT_MOD_DIR = $(ROOT)/kernel ROOT_KERN_DIR_32 = $(ROOT_MOD_DIR) ROOT_BRAND_DIR_32 = $(ROOT_MOD_DIR)/brand ROOT_DRV_DIR_32 = $(ROOT_MOD_DIR)/drv ROOT_DTRACE_DIR_32 = $(ROOT_MOD_DIR)/dtrace ROOT_EXEC_DIR_32 = $(ROOT_MOD_DIR)/exec ROOT_FS_DIR_32 = $(ROOT_MOD_DIR)/fs ROOT_SCHED_DIR_32 = $(ROOT_MOD_DIR)/sched ROOT_SOCK_DIR_32 = $(ROOT_MOD_DIR)/socketmod ROOT_STRMOD_DIR_32 = $(ROOT_MOD_DIR)/strmod ROOT_IPP_DIR_32 = $(ROOT_MOD_DIR)/ipp ROOT_SYS_DIR_32 = $(ROOT_MOD_DIR)/sys ROOT_MISC_DIR_32 = $(ROOT_MOD_DIR)/misc ROOT_KGSS_DIR_32 = $(ROOT_MOD_DIR)/misc/kgss ROOT_SCSI_VHCI_DIR_32 = $(ROOT_MOD_DIR)/misc/scsi_vhci ROOT_PMCS_FW_DIR_32 = $(ROOT_MOD_DIR)/misc/pmcs ROOT_QLC_FW_DIR_32 = $(ROOT_MOD_DIR)/misc/qlc ROOT_EMLXS_FW_DIR_32 = $(ROOT_MOD_DIR)/misc/emlxs ROOT_NLMISC_DIR_32 = $(ROOT_MOD_DIR)/misc ROOT_MACH_DIR_32 = $(ROOT_MOD_DIR)/mach ROOT_CPU_DIR_32 = $(ROOT_MOD_DIR)/cpu ROOT_TOD_DIR_32 = $(ROOT_MOD_DIR)/tod ROOT_FONT_DIR_32 = $(ROOT_MOD_DIR)/fonts ROOT_DACF_DIR_32 = $(ROOT_MOD_DIR)/dacf ROOT_CRYPTO_DIR_32 = $(ROOT_MOD_DIR)/crypto ROOT_MAC_DIR_32 = $(ROOT_MOD_DIR)/mac ROOT_CC_DIR_32 = $(ROOT_MOD_DIR)/cc ROOT_OVERLAY_DIR_32 = $(ROOT_MOD_DIR)/overlay ROOT_KICONV_DIR_32 = $(ROOT_MOD_DIR)/kiconv # Hammerhead: _64 paths are identical to _32 (flat layout) ROOT_KERN_DIR_64 = $(ROOT_MOD_DIR) ROOT_BRAND_DIR_64 = $(ROOT_MOD_DIR)/brand ROOT_DRV_DIR_64 = $(ROOT_MOD_DIR)/drv ROOT_DTRACE_DIR_64 = $(ROOT_MOD_DIR)/dtrace ROOT_EXEC_DIR_64 = $(ROOT_MOD_DIR)/exec ROOT_FS_DIR_64 = $(ROOT_MOD_DIR)/fs ROOT_SCHED_DIR_64 = $(ROOT_MOD_DIR)/sched ROOT_SOCK_DIR_64 = $(ROOT_MOD_DIR)/socketmod ROOT_STRMOD_DIR_64 = $(ROOT_MOD_DIR)/strmod ROOT_IPP_DIR_64 = $(ROOT_MOD_DIR)/ipp ROOT_SYS_DIR_64 = $(ROOT_MOD_DIR)/sys ROOT_MISC_DIR_64 = $(ROOT_MOD_DIR)/misc ROOT_KGSS_DIR_64 = $(ROOT_MOD_DIR)/misc/kgss ROOT_SCSI_VHCI_DIR_64 = $(ROOT_MOD_DIR)/misc/scsi_vhci ROOT_PMCS_FW_DIR_64 = $(ROOT_MOD_DIR)/misc/pmcs ROOT_QLC_FW_DIR_64 = $(ROOT_MOD_DIR)/misc/qlc ROOT_EMLXS_FW_DIR_64 = $(ROOT_MOD_DIR)/misc/emlxs ROOT_NLMISC_DIR_64 = $(ROOT_MOD_DIR)/misc ROOT_MACH_DIR_64 = $(ROOT_MOD_DIR)/mach ROOT_CPU_DIR_64 = $(ROOT_MOD_DIR)/cpu ROOT_TOD_DIR_64 = $(ROOT_MOD_DIR)/tod ROOT_FONT_DIR_64 = $(ROOT_MOD_DIR)/fonts ROOT_DACF_DIR_64 = $(ROOT_MOD_DIR)/dacf ROOT_CRYPTO_DIR_64 = $(ROOT_MOD_DIR)/crypto ROOT_MAC_DIR_64 = $(ROOT_MOD_DIR)/mac ROOT_CC_DIR_64 = $(ROOT_MOD_DIR)/cc ROOT_OVERLAY_DIR_64 = $(ROOT_MOD_DIR)/overlay ROOT_KICONV_DIR_64 = $(ROOT_MOD_DIR)/kiconv ROOT_KERN_DIR = $(ROOT_KERN_DIR_$(CLASS)) ROOT_BRAND_DIR = $(ROOT_BRAND_DIR_$(CLASS)) ROOT_DRV_DIR = $(ROOT_DRV_DIR_$(CLASS)) ROOT_DTRACE_DIR = $(ROOT_DTRACE_DIR_$(CLASS)) ROOT_EXEC_DIR = $(ROOT_EXEC_DIR_$(CLASS)) ROOT_FS_DIR = $(ROOT_FS_DIR_$(CLASS)) ROOT_SCHED_DIR = $(ROOT_SCHED_DIR_$(CLASS)) ROOT_SOCK_DIR = $(ROOT_SOCK_DIR_$(CLASS)) ROOT_STRMOD_DIR = $(ROOT_STRMOD_DIR_$(CLASS)) ROOT_IPP_DIR = $(ROOT_IPP_DIR_$(CLASS)) ROOT_SYS_DIR = $(ROOT_SYS_DIR_$(CLASS)) ROOT_MISC_DIR = $(ROOT_MISC_DIR_$(CLASS)) ROOT_KGSS_DIR = $(ROOT_KGSS_DIR_$(CLASS)) ROOT_SCSI_VHCI_DIR = $(ROOT_SCSI_VHCI_DIR_$(CLASS)) ROOT_PMCS_FW_DIR = $(ROOT_PMCS_FW_DIR_$(CLASS)) ROOT_QLC_FW_DIR = $(ROOT_QLC_FW_DIR_$(CLASS)) ROOT_EMLXS_FW_DIR = $(ROOT_EMLXS_FW_DIR_$(CLASS)) ROOT_NLMISC_DIR = $(ROOT_NLMISC_DIR_$(CLASS)) ROOT_MACH_DIR = $(ROOT_MACH_DIR_$(CLASS)) ROOT_CPU_DIR = $(ROOT_CPU_DIR_$(CLASS)) ROOT_TOD_DIR = $(ROOT_TOD_DIR_$(CLASS)) ROOT_FONT_DIR = $(ROOT_FONT_DIR_$(CLASS)) ROOT_DACF_DIR = $(ROOT_DACF_DIR_$(CLASS)) ROOT_CRYPTO_DIR = $(ROOT_CRYPTO_DIR_$(CLASS)) ROOT_MAC_DIR = $(ROOT_MAC_DIR_$(CLASS)) ROOT_CC_DIR = $(ROOT_CC_DIR_$(CLASS)) ROOT_OVERLAY_DIR = $(ROOT_OVERLAY_DIR_$(CLASS)) ROOT_KICONV_DIR = $(ROOT_KICONV_DIR_$(CLASS)) ROOT_FIRMWARE_DIR = $(ROOT_MOD_DIR)/firmware ROOT_MOD_DIRS_32 = $(ROOT_BRAND_DIR_32) $(ROOT_DRV_DIR_32) ROOT_MOD_DIRS_32 = $(ROOT_BRAND_DIR_32) $(ROOT_DRV_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_EXEC_DIR_32) $(ROOT_DTRACE_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_FS_DIR_32) $(ROOT_SCHED_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_STRMOD_DIR_32) $(ROOT_SYS_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_IPP_DIR_32) $(ROOT_SOCK_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_MISC_DIR_32) $(ROOT_MACH_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_KGSS_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_SCSI_VHCI_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_PMCS_FW_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_QLC_FW_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_EMLXS_FW_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_CPU_DIR_32) $(ROOT_FONT_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_TOD_DIR_32) $(ROOT_DACF_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_CRYPTO_DIR_32) $(ROOT_MAC_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_CC_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_OVERLAY_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_KICONV_DIR_32) ROOT_MOD_DIRS_32 += $(ROOT_FIRMWARE_DIR) # Hammerhead: No /usr/kernel/ — all modules install to /kernel/ # USR_MOD_DIR redirects to ROOT_MOD_DIR for any remaining references USR_MOD_DIR = $(ROOT_MOD_DIR) USR_DRV_DIR_32 = $(ROOT_DRV_DIR_32) USR_EXEC_DIR_32 = $(ROOT_EXEC_DIR_32) USR_FS_DIR_32 = $(ROOT_FS_DIR_32) USR_SCHED_DIR_32 = $(ROOT_SCHED_DIR_32) USR_SOCK_DIR_32 = $(ROOT_SOCK_DIR_32) USR_STRMOD_DIR_32 = $(ROOT_STRMOD_DIR_32) USR_SYS_DIR_32 = $(ROOT_SYS_DIR_32) USR_MISC_DIR_32 = $(ROOT_MISC_DIR_32) USR_KTEST_DIR_32 = $(ROOT_MOD_DIR)/misc/ktest USR_DACF_DIR_32 = $(ROOT_DACF_DIR_32) USR_PCBE_DIR_32 = $(ROOT_MOD_DIR)/pcbe USR_DTRACE_DIR_32 = $(ROOT_DTRACE_DIR_32) USR_BRAND_DIR_32 = $(ROOT_BRAND_DIR_32) USR_DRV_DIR_64 = $(ROOT_DRV_DIR_64) USR_EXEC_DIR_64 = $(ROOT_EXEC_DIR_64) USR_FS_DIR_64 = $(ROOT_FS_DIR_64) USR_SCHED_DIR_64 = $(ROOT_SCHED_DIR_64) USR_SOCK_DIR_64 = $(ROOT_SOCK_DIR_64) USR_STRMOD_DIR_64 = $(ROOT_STRMOD_DIR_64) USR_SYS_DIR_64 = $(ROOT_SYS_DIR_64) USR_MISC_DIR_64 = $(ROOT_MISC_DIR_64) USR_KTEST_DIR_64 = $(ROOT_MOD_DIR)/misc/ktest USR_DACF_DIR_64 = $(ROOT_DACF_DIR_64) USR_PCBE_DIR_64 = $(ROOT_MOD_DIR)/pcbe USR_DTRACE_DIR_64 = $(ROOT_DTRACE_DIR_64) USR_BRAND_DIR_64 = $(ROOT_BRAND_DIR_64) USR_DRV_DIR = $(USR_DRV_DIR_$(CLASS)) USR_EXEC_DIR = $(USR_EXEC_DIR_$(CLASS)) USR_FS_DIR = $(USR_FS_DIR_$(CLASS)) USR_SCHED_DIR = $(USR_SCHED_DIR_$(CLASS)) USR_SOCK_DIR = $(USR_SOCK_DIR_$(CLASS)) USR_STRMOD_DIR = $(USR_STRMOD_DIR_$(CLASS)) USR_SYS_DIR = $(USR_SYS_DIR_$(CLASS)) USR_MISC_DIR = $(USR_MISC_DIR_$(CLASS)) USR_KTEST_DIR = $(USR_KTEST_DIR_$(CLASS)) USR_DACF_DIR = $(USR_DACF_DIR_$(CLASS)) USR_PCBE_DIR = $(USR_PCBE_DIR_$(CLASS)) USR_DTRACE_DIR = $(USR_DTRACE_DIR_$(CLASS)) USR_BRAND_DIR = $(USR_BRAND_DIR_$(CLASS)) USR_MOD_DIRS_32 = $(USR_KTEST_DIR_32) USR_MOD_DIRS_32 += $(USR_PCBE_DIR_32) # # # include $(SRC)/Makefile.psm # # The "-r" on the remove may be considered temporary, but is required # while the replacement of the SUNW,SPARCstation-10,SX directory by # a symbolic link is being propagated. # INS.slink1= $(RM) -r $@; $(SYMLINK) $(PLATFORM) $@ INS.slink2= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/$(@F) $@ INS.slink3= $(RM) -r $@; $(SYMLINK) $(IMPLEMENTED_PLATFORM) $@ INS.slink4= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/include $@ INS.slink5= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/sbin $@ INS.slink6= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@ INS.slink7= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/$(@F) $@ ROOT_PLAT_LINKS = $(PLAT_LINKS:%=$(ROOT_PLAT_DIR)/%) ROOT_PLAT_LINKS_2 = $(PLAT_LINKS_2:%=$(ROOT_PLAT_DIR)/%) USR_PLAT_LINKS = $(PLAT_LINKS:%=$(USR_PLAT_DIR)/%) USR_PLAT_LINKS_2 = $(PLAT_LINKS_2:%=$(USR_PLAT_DIR)/%) # # Collection of all relevant, delivered kernel modules. # # Note that we insist on building genunix first, because everything else # uniquifies against it. When doing a 'make' from usr/src/uts/, we'll enter # the platform directories first. These will cd into the corresponding genunix # directory and build it. So genunix /shouldn't/ get rebuilt when we get to # building all the kernel modules. However, due to an as-yet-unexplained # problem with dependencies, sometimes it does get rebuilt, which then messes # up the other modules. So we always force the issue here rather than try to # build genunix in parallel with everything else. # PARALLEL_KMODS = $(DRV_KMODS) $(EXEC_KMODS) $(FS_KMODS) $(SCHED_KMODS) \ $(TOD_KMODS) $(STRMOD_KMODS) $(SYS_KMODS) $(MISC_KMODS) \ $(NLMISC_KMODS) $(MACH_KMODS) $(CPU_KMODS) $(GSS_KMODS) \ $(MMU_KMODS) $(DACF_KMODS) $(EXPORT_KMODS) $(IPP_KMODS) \ $(CRYPTO_KMODS) $(PCBE_KMODS) \ $(DRV_KMODS_$(CLASS)) $(MISC_KMODS_$(CLASS)) $(MAC_KMODS) \ $(BRAND_KMODS) $(KICONV_KMODS) $(CC_KMODS) $(OVERLAY_KMODS) \ $(SOCKET_KMODS) KMODS = $(GENUNIX_KMODS) $(PARALLEL_KMODS) $(PARALLEL_KMODS): $(GENUNIX_KMODS) # # Files to be compiled with -xa, to generate basic block execution # count data. # # There are several ways to compile parts of the kernel for kcov: # 1) Add targets to BB_FILES here or in other Makefiles # (they must in the form of $(OBJS_DIR)/target.o) # 2) setenv BB_FILES '$(XXX_OBJS:%=$(OBJS_DIR)/%)' # 3) setenv BB_FILES '$(OBJECTS)' # # Do NOT setenv CFLAGS -xa, as that will cause infinite recursion # in unix_bb.o # BB_FILES = # Hammerhead: GNU Make syntax with guard for empty variable ifneq ($(BB_FILES),) $(BB_FILES): XAOPT = -xa endif # # The idea here is for unix_bb.o to be in all kernels except the # kernel which actually gets shipped to customers. In practice, # $(RELEASE_BUILD) is on for a number of the late beta and fcs builds. # # Hammerhead: GNU Make conditional (was dmake prefix syntax) ifneq ($(NOT_RELEASE_BUILD),$(POUND_SIGN)) $(OBJS_DIR)/unix_bb.o: CPPFLAGS += -DKCOV endif # # Do not let unix_bb.o get compiled with -xa! # $(OBJS_DIR)/unix_bb.o : XAOPT = # # Privilege files # PRIVS_AWK = $(SRC)/uts/common/os/privs.awk PRIVS_DEF = $(SRC)/uts/common/os/priv_defs # # USB device data # USBDEVS_AWK = $(SRC)/uts/common/io/usb/usbdevs2h.awk USBDEVS_DATA = $(SRC)/uts/common/io/usb/usbdevs endif # _MAKEFILE_UTS