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 # This makefile drives the production of the generic 28 # unix kernel module. 29 # 30 # sparc implementation architecture dependent 31 # 32 33 # 34 # Path to the base of the uts directory tree (usually /usr/src/uts). 35 # 36 UTSBASE = ../.. 37 38 # 39 # Define the module and object file sets. 40 # 41 MODULE = genunix 42 GENUNIX = $(OBJS_DIR)/$(MODULE) 43 44 OBJECTS = $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \ 45 $(NOT_YET_KMODS:%=$(OBJS_DIR)/%) 46 47 LINTS = $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 48 $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) 49 50 ROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(MODULE) 51 52 PLATFORM = sun4v 53 LIBGEN = $(OBJS_DIR)/libgenunix.so 54 LIBSTUBS = $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%) 55 56 # LINTFLAGS will be set to include definitions so that the cpu_t 57 # structure is expanded. However this could be set to look at the 58 # sun4u version which is not correct for sun4v. Therefore we only 59 # want to use the LINTFLAGS modification in this Makefile and so 60 # suppress the usage of the LINTFLAGS setting in the Makefile.sparc 61 # file. 62 # 63 LINTFLAGSUPPRESS = $(POUND_SIGN) 64 65 # 66 # Include common rules. 67 # 68 include $(UTSBASE)/sparc/Makefile.sparc 69 70 # 71 # Define targets 72 # 73 ALL_TARGET = $(LIBGEN) 74 LINT_TARGET = $(MODULE).lint 75 INSTALL_TARGET = $(GENUNIX) $(ROOTMODULE) 76 77 # 78 # Override defaults 79 # 80 CLEANFILES += $(LIBSTUBS) $(LIBGEN) 81 82 LINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR) 83 LINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln 84 GEN_LINT_LIB = 85 86 BINARY = 87 88 CLOBBERFILES += $(GENUNIX) 89 90 # 91 # lint pass one enforcement 92 # 93 CFLAGS += $(CCVERBOSE) 94 CPPFLAGS += -I$(SRC)/common 95 CPPFLAGS += -I$(SRC)/uts/common/fs/zfs 96 97 INC_PATH += -I$(UTSBASE)/sun4 98 99 # 100 # For now, disable these lint checks; maintainers should endeavor 101 # to investigate and remove these for maximum lint coverage. 102 # Please do not carry these forward to new Makefiles. 103 # 104 LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON 105 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 106 LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 107 LINTTAGS += -erroff=E_STATIC_UNUSED 108 LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW 109 LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 110 111 CERRWARN += -_gcc=-Wno-unused-label 112 CERRWARN += -_gcc=-Wno-unused-variable 113 CERRWARN += -_gcc=-Wno-unused-value 114 CERRWARN += -_gcc=-Wno-unused-function 115 CERRWARN += -_gcc=-Wno-parentheses 116 CERRWARN += -_gcc=-Wno-switch 117 CERRWARN += -_gcc=-Wno-type-limits 118 CERRWARN += -_gcc=-Wno-uninitialized 119 CERRWARN += -_gcc=-Wno-clobbered 120 CERRWARN += -_gcc=-Wno-empty-body 121 122 123 # Ensure that lint sees 'struct cpu' containing a fully declared 124 # embedded 'struct machcpu'. 125 # 126 LINTFLAGS += -D_MACHDEP -I../../sun4 -I../../$(PLATFORM) -I../../sfmmu 127 128 # 129 # Default build targets. 130 # 131 .KEEP_STATE: 132 133 .PARALLEL: $(LIBSTUBS) 134 135 def: $(DEF_DEPS) 136 137 all: $(ALL_DEPS) 138 139 clean: $(CLEAN_DEPS) 140 141 clobber: $(CLOBBER_DEPS) 142 143 lint: $(LINT_DEPS) 144 145 modlintlib: $(MODLINTLIB_DEPS) 146 147 clean.lint: $(CLEAN_LINT_DEPS) 148 149 install: $(INSTALL_DEPS) 150 151 $(LIBGEN): $(GENUNIX) $(LIBSTUBS) 152 $(BUILD.SO) $(GENUNIX) $(LIBSTUBS) 153 154 $(GENUNIX): $(OBJECTS) 155 @pwd 156 $(LD) -r $(LDFLAGS) -o $@ $(OBJECTS) 157 $(CTFMERGE_MODULE) 158 $(POST_PROCESS) 159 160 $(OBJECTS): $(OBJS_DIR) 161 162 # 163 # Include common targets. 164 # 165 include $(UTSBASE)/sparc/Makefile.targ 166 167 # 168 # Include workarounds. 169 # 170 include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds 171 172 ALL_DEFS += $(WORKAROUND_DEFS)