Makefile revision 5db531e3faa94427746eae754b11770fd8416b6d
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# This makefile drives the production of the generic
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# unix kernel module.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# sparc implementation architecture dependent
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Path to the base of the uts directory tree (usually /usr/src/uts).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteUTSBASE = ../..
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Define the module and object file sets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteMODULE = genunix
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteGENUNIX = $(OBJS_DIR)/$(MODULE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteOBJECTS = $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(NOT_YET_KMODS:%=$(OBJS_DIR)/%)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINTS = $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(MODULE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortePLATFORM = sun4u
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLIBGEN = $(OBJS_DIR)/libgenunix.so
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLIBSTUBS = $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Include common rules.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinclude $(UTSBASE)/sparc/Makefile.sparc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Define targets
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteALL_TARGET = $(LIBGEN) $(GENUNIX)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINT_TARGET = $(MODULE).lint
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteINSTALL_TARGET = $(LIBGEN) $(GENUNIX) $(ROOTMODULE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Override defaults
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCLEANFILES += $(LIBSTUBS) $(LIBGEN)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteGEN_LINT_LIB =
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteBINARY =
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCLOBBERFILES += $(GENUNIX)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Non-patch genunix builds merge a version of the ip module called ipctf. This
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# is to ensure that the common network-related types are included in genunix and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# can thus be uniquified out of other modules. We don't want to do this for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# patch builds, since we can't guarantee that ip and genunix will be in the same
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# patch.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteIPCTF_TARGET = $(IPCTF)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte$(PATCH_BUILD)IPCTF_TARGET =
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# lint pass one enforcement
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCFLAGS += $(CCVERBOSE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCPPFLAGS += -I$(SRC)/common
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCPPFLAGS += -I$(SRC)/uts/common/fs/zfs
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteINC_PATH += -I$(UTSBASE)/sun4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# For now, disable these lint checks; maintainers should endeavor
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# to investigate and remove these for maximum lint coverage.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Please do not carry these forward to new Makefiles.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
LINTTAGS += -erroff=E_STATIC_UNUSED
LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
CERRWARN += -_gcc=-Wno-unused-label
CERRWARN += -_gcc=-Wno-unused-variable
CERRWARN += -_gcc=-Wno-unused-value
CERRWARN += -_gcc=-Wno-unused-function
CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-switch
CERRWARN += -_gcc=-Wno-type-limits
CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-clobbered
CERRWARN += -_gcc=-Wno-empty-body
#
# Ensure that lint sees 'struct cpu' containing a fully declared
# embedded 'struct machcpu'
#
LINTFLAGS += -D_MACHDEP -I../../sun4 -I../../$(PLATFORM) -I../../sfmmu
# Default build targets.
#
.KEEP_STATE:
.PARALLEL: $(LIBSTUBS)
def: $(DEF_DEPS)
all: $(ALL_DEPS)
clean: $(CLEAN_DEPS)
clobber: $(CLOBBER_DEPS)
lint: $(LINT_DEPS)
modlintlib: $(MODLINTLIB_DEPS)
clean.lint: $(CLEAN_LINT_DEPS)
install: $(INSTALL_DEPS)
install_h:
$(LIBGEN): $(GENUNIX) $(LIBSTUBS)
$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
$(IPCTF_TARGET) ipctf_target: FRC
@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
@pwd
$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
$(CTFMERGE_GENUNIX_MERGE)
$(POST_PROCESS)
$(OBJECTS): $(OBJS_DIR)
#
# Include common targets.
#
include $(UTSBASE)/sparc/Makefile.targ
#
# Include sun4u workarounds.
#
include $(UTSBASE)/sun4u/Makefile.workarounds
ALL_DEFS += $(WORKAROUND_DEFS)