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 (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 
  22 #
  23 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 
  27 #
  28 #       This makefile drives the production of the generic
  29 #       unix kernel module.
  30 #
  31 #       sparc implementation architecture dependent
  32 #
  33 
  34 #
  35 #       Path to the base of the uts directory tree (usually /usr/src/uts).
  36 #
  37 UTSBASE = ../..
  38 
  39 #
  40 #       Define the module and object file sets.
  41 #
  42 MODULE          = genunix
  43 GENUNIX         = $(OBJS_DIR)/$(MODULE)
  44 
  45 OBJECTS         = $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \
  46                   $(NOT_YET_KMODS:%=$(OBJS_DIR)/%)
  47 
  48 LINTS           = $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \
  49                   $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln)
  50 
  51 ROOTMODULE      = $(ROOT_PSM_KERN_DIR)/$(MODULE)
  52 
  53 PLATFORM        = sun4u
  54 LIBGEN          = $(OBJS_DIR)/libgenunix.so
  55 LIBSTUBS        = $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
  56 
  57 #
  58 #       Include common rules.
  59 #
  60 include $(UTSBASE)/sparc/Makefile.sparc
  61 
  62 #
  63 #       Define targets
  64 #
  65 ALL_TARGET      = $(LIBGEN)
  66 LINT_TARGET     = $(MODULE).lint
  67 INSTALL_TARGET  = $(GENUNIX) $(ROOTMODULE)
  68 
  69 #
  70 #       Override defaults
  71 #
  72 CLEANFILES      += $(LIBSTUBS) $(LIBGEN)
  73 
  74 LINT_LIB_DIR    = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
  75 LINT_LIB        = $(LINT_LIB_DIR)/llib-lunix.ln
  76 GEN_LINT_LIB    =
  77 
  78 BINARY          =
  79 
  80 CLOBBERFILES    += $(GENUNIX)
  81 
  82 # 
  83 # lint pass one enforcement 
  84 # 
  85 CFLAGS += $(CCVERBOSE)
  86 CPPFLAGS += -I$(SRC)/common
  87 CPPFLAGS += -I$(SRC)/uts/common/fs/zfs
  88 
  89 INC_PATH +=  -I$(UTSBASE)/sun4
  90 
  91 #
  92 # For now, disable these lint checks; maintainers should endeavor
  93 # to investigate and remove these for maximum lint coverage.
  94 # Please do not carry these forward to new Makefiles.
  95 #
  96 LINTTAGS        += -erroff=E_SUSPICIOUS_COMPARISON
  97 LINTTAGS        += -erroff=E_BAD_PTR_CAST_ALIGN
  98 LINTTAGS        += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
  99 LINTTAGS        += -erroff=E_STATIC_UNUSED
 100 LINTTAGS        += -erroff=E_PTRDIFF_OVERFLOW
 101 LINTTAGS        += -erroff=E_ASSIGN_NARROW_CONV
 102 
 103 CERRWARN        += -_gcc=-Wno-unused-label
 104 CERRWARN        += -_gcc=-Wno-unused-variable
 105 CERRWARN        += -_gcc=-Wno-unused-value
 106 CERRWARN        += -_gcc=-Wno-unused-function
 107 CERRWARN        += -_gcc=-Wno-parentheses
 108 CERRWARN        += -_gcc=-Wno-switch
 109 CERRWARN        += -_gcc=-Wno-type-limits
 110 CERRWARN        += -_gcc=-Wno-uninitialized
 111 CERRWARN        += -_gcc=-Wno-clobbered
 112 CERRWARN        += -_gcc=-Wno-empty-body
 113 
 114 #
 115 # Ensure that lint sees 'struct cpu' containing a fully declared
 116 # embedded 'struct machcpu'
 117 #
 118 LINTFLAGS       += -D_MACHDEP -I../../sun4 -I../../$(PLATFORM) -I../../sfmmu
 119 
 120 #       Default build targets.
 121 #
 122 .KEEP_STATE:
 123 
 124 .PARALLEL:      $(LIBSTUBS)
 125 
 126 def:            $(DEF_DEPS)
 127 
 128 all:            $(ALL_DEPS)
 129 
 130 clean:          $(CLEAN_DEPS)
 131 
 132 clobber:        $(CLOBBER_DEPS)
 133 
 134 lint:           $(LINT_DEPS)
 135 
 136 modlintlib:     $(MODLINTLIB_DEPS)
 137 
 138 clean.lint:     $(CLEAN_LINT_DEPS)
 139 
 140 install:        $(INSTALL_DEPS)
 141 
 142 install_h:
 143 
 144 
 145 $(LIBGEN):      $(GENUNIX) $(LIBSTUBS)
 146         $(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
 147 
 148 $(GENUNIX): $(OBJECTS)
 149         $(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
 150         $(CTFMERGE_MODULE)
 151         $(POST_PROCESS)
 152 
 153 $(OBJECTS): $(OBJS_DIR)
 154 
 155 #
 156 #       Include common targets.
 157 #
 158 include $(UTSBASE)/sparc/Makefile.targ
 159 
 160 #
 161 #       Include sun4u workarounds.
 162 #
 163 include $(UTSBASE)/sun4u/Makefile.workarounds
 164 
 165 ALL_DEFS +=     $(WORKAROUND_DEFS)