Makefile revision 11389:dd00b884e84f
1254885Sdumbbell# 2254885Sdumbbell# CDDL HEADER START 3254885Sdumbbell# 4254885Sdumbbell# The contents of this file are subject to the terms of the 5254885Sdumbbell# Common Development and Distribution License (the "License"). 6254885Sdumbbell# You may not use this file except in compliance with the License. 7254885Sdumbbell# 8254885Sdumbbell# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9254885Sdumbbell# or http://www.opensolaris.org/os/licensing. 10254885Sdumbbell# See the License for the specific language governing permissions 11254885Sdumbbell# and limitations under the License. 12254885Sdumbbell# 13254885Sdumbbell# When distributing Covered Code, include this CDDL HEADER in each 14254885Sdumbbell# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15254885Sdumbbell# If applicable, add the following below this CDDL HEADER, with the 16254885Sdumbbell# fields enclosed by brackets "[]" replaced with your own identifying 17254885Sdumbbell# information: Portions Copyright [yyyy] [name of copyright owner] 18254885Sdumbbell# 19254885Sdumbbell# CDDL HEADER END 20254885Sdumbbell# 21254885Sdumbbell 22254885Sdumbbell# 23254885Sdumbbell# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24254885Sdumbbell# Use is subject to license terms. 25254885Sdumbbell# 26254885Sdumbbell# 27254885Sdumbbell# This makefile drives the production of the generic 28254885Sdumbbell# unix kernel module. 29254885Sdumbbell# 30254885Sdumbbell# sparc implementation architecture dependent 31254885Sdumbbell# 32254885Sdumbbell 33254885Sdumbbell# 34254885Sdumbbell# Path to the base of the uts directory tree (usually /usr/src/uts). 35254885Sdumbbell# 36254885SdumbbellUTSBASE = ../.. 37254885Sdumbbell 38254885Sdumbbell# 39# Define the module and object file sets. 40# 41MODULE = genunix 42GENUNIX = $(OBJS_DIR)/$(MODULE) 43 44OBJECTS = $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \ 45 $(NOT_YET_KMODS:%=$(OBJS_DIR)/%) 46 47LINTS = $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 48 $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) 49 50ROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(MODULE) 51 52PLATFORM = sun4v 53LIBGEN = $(OBJS_DIR)/libgenunix.so 54LIBSTUBS = $(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# 63LINTFLAGSUPPRESS = $(POUND_SIGN) 64 65# 66# Include common rules. 67# 68include $(UTSBASE)/sparc/Makefile.sparc 69 70# 71# Define targets 72# 73ALL_TARGET = $(LIBGEN) 74LINT_TARGET = $(MODULE).lint 75INSTALL_TARGET = $(GENUNIX) $(ROOTMODULE) 76 77# 78# Override defaults 79# 80CLEANFILES += $(LIBSTUBS) $(LIBGEN) 81 82LINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR) 83LINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln 84GEN_LINT_LIB = 85 86BINARY = 87 88CLOBBERFILES += $(GENUNIX) 89 90# 91# Non-patch genunix builds merge a version of the ip module called ipctf. This 92# is to ensure that the common network-related types are included in genunix and 93# can thus be uniquified out of other modules. We don't want to do this for 94# patch builds, since we can't guarantee that ip and genunix will be in the same 95# patch. 96# 97IPCTF_TARGET = $(IPCTF) 98$(PATCH_BUILD)IPCTF_TARGET = 99 100# 101# lint pass one enforcement 102# 103CFLAGS += $(CCVERBOSE) 104CPPFLAGS += -I$(SRC)/common 105CPPFLAGS += -I$(SRC)/uts/common/fs/zfs 106 107INC_PATH += -I$(UTSBASE)/sun4 108 109# 110# For now, disable these lint checks; maintainers should endeavor 111# to investigate and remove these for maximum lint coverage. 112# Please do not carry these forward to new Makefiles. 113# 114LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON 115LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 116LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 117LINTTAGS += -erroff=E_STATIC_UNUSED 118LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW 119LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 120 121# Ensure that lint sees 'struct cpu' containing a fully declared 122# embedded 'struct machcpu'. 123# 124LINTFLAGS += -D_MACHDEP -I../../sun4 -I../../$(PLATFORM) -I../../sfmmu 125 126# 127# Default build targets. 128# 129.KEEP_STATE: 130 131.PARALLEL: $(LIBSTUBS) 132 133def: $(DEF_DEPS) 134 135all: $(ALL_DEPS) 136 137clean: $(CLEAN_DEPS) 138 139clobber: $(CLOBBER_DEPS) 140 141lint: $(LINT_DEPS) 142 143modlintlib: $(MODLINTLIB_DEPS) 144 145clean.lint: $(CLEAN_LINT_DEPS) 146 147install: $(INSTALL_DEPS) 148 149$(LIBGEN): $(GENUNIX) $(LIBSTUBS) 150 $(BUILD.SO) $(GENUNIX) $(LIBSTUBS) 151 152$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS) 153 @pwd 154 $(LD) -r $(LDFLAGS) -o $@ $(OBJECTS) 155 $(CTFMERGE_GENUNIX_MERGE) 156 $(POST_PROCESS) 157 158$(OBJECTS): $(OBJS_DIR) 159 160# 161# Include common targets. 162# 163include $(UTSBASE)/sparc/Makefile.targ 164 165# 166# Include workarounds. 167# 168include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds 169 170ALL_DEFS += $(WORKAROUND_DEFS) 171