1fa9e4066Sahrens# 2fa9e4066Sahrens# CDDL HEADER START 3fa9e4066Sahrens# 4fa9e4066Sahrens# The contents of this file are subject to the terms of the 5bb25c06cSjg# Common Development and Distribution License (the "License"). 6bb25c06cSjg# You may not use this file except in compliance with the License. 7fa9e4066Sahrens# 8fa9e4066Sahrens# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9fa9e4066Sahrens# or http://www.opensolaris.org/os/licensing. 10fa9e4066Sahrens# See the License for the specific language governing permissions 11fa9e4066Sahrens# and limitations under the License. 12fa9e4066Sahrens# 13fa9e4066Sahrens# When distributing Covered Code, include this CDDL HEADER in each 14fa9e4066Sahrens# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15fa9e4066Sahrens# If applicable, add the following below this CDDL HEADER, with the 16fa9e4066Sahrens# fields enclosed by brackets "[]" replaced with your own identifying 17fa9e4066Sahrens# information: Portions Copyright [yyyy] [name of copyright owner] 18fa9e4066Sahrens# 19fa9e4066Sahrens# CDDL HEADER END 20fa9e4066Sahrens# 21fa9e4066Sahrens# 2235a5a358SJonathan Adams# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23fa9e4066Sahrens# Use is subject to license terms. 24fa9e4066Sahrens# 25fa9e4066Sahrens# This makefile drives the production of the zfs file system 26fa9e4066Sahrens# kernel module. 27fa9e4066Sahrens 28fa9e4066Sahrens# 29fa9e4066Sahrens# Path to the base of the uts directory tree (usually /usr/src/uts). 30fa9e4066Sahrens# 31fa9e4066SahrensUTSBASE = ../.. 32fa9e4066Sahrens 33fa9e4066SahrensARCHDIR:sh = cd ..; basename `pwd` 34fa9e4066Sahrens 35fa9e4066Sahrens# 36fa9e4066Sahrens# Define the module and object file sets. 37fa9e4066Sahrens# 38fa9e4066SahrensMODULE = zfs 39fa9e4066SahrensOBJECTS = $(ZFS_OBJS:%=$(OBJS_DIR)/%) 40fa9e4066SahrensLINTS = $(ZFS_OBJS:%.o=$(LINTS_DIR)/%.ln) 41fa9e4066SahrensROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) 42fa9e4066SahrensROOTLINK = $(ROOT_FS_DIR)/$(MODULE) 43fa9e4066SahrensCONF_SRCDIR = $(UTSBASE)/common/fs/zfs 44fa9e4066Sahrens 45fa9e4066Sahrens# 46fa9e4066Sahrens# Include common rules. 47fa9e4066Sahrens# 48fa9e4066Sahrensinclude ../Makefile.$(ARCHDIR) 49fa9e4066Sahrens 50fa9e4066Sahrens# 51fa9e4066Sahrens# Define targets 52fa9e4066Sahrens# 53fa9e4066SahrensALL_TARGET = $(BINARY) $(SRC_CONFILE) 54fa9e4066SahrensLINT_TARGET = $(MODULE).lint 55fa9e4066SahrensINSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOTLINK) $(ROOT_CONFFILE) 56fa9e4066Sahrens 57fa9e4066Sahrens# 58fa9e4066Sahrens# Overrides and depends_on 59fa9e4066Sahrens# 6035a5a358SJonathan Adams# We require sched/SDC because by the time vfs_mountroot() runs, 6135a5a358SJonathan Adams# we can no longer load modules through OBP. 6235a5a358SJonathan Adams# 63fa9e4066SahrensMODSTUBS_DIR = $(OBJS_DIR) 6497322426SDarren J MoffatLDFLAGS += -dy -Nfs/specfs -Ncrypto/swrand -Nmisc/idmap \ 6597322426SDarren J Moffat -Nsched/SDC -Nmisc/sha2 66fa9e4066Sahrens 67fa9e4066SahrensINC_PATH += -I$(UTSBASE)/common/fs/zfs 68fa9e4066SahrensINC_PATH += -I$(SRC)/common 69fa9e4066SahrensINC_PATH += -I$(COMMONBASE)/zfs 70fa9e4066Sahrens 71fa9e4066SahrensC99MODE= -xc99=%all 72fa9e4066SahrensC99LMODE= -Xc99=%all 73fa9e4066Sahrens 74fa9e4066Sahrens# 75bb25c06cSjg# For now, disable these lint checks; maintainers should endeavor 76bb25c06cSjg# to investigate and remove these for maximum lint coverage. 77bb25c06cSjg# Please do not carry these forward to new Makefiles. 78bb25c06cSjg# 79bb25c06cSjgLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON 80bb25c06cSjgLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 81bb25c06cSjgLINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 82bb25c06cSjgLINTTAGS += -erroff=E_STATIC_UNUSED 83bb25c06cSjgLINTTAGS += -erroff=E_PTRDIFF_OVERFLOW 84bb25c06cSjgLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 85bb25c06cSjg 86*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-type-limits 87*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-switch 88*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 89*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable 90*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function 91*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-label 92*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized 93*7014882cSRichard Lowe 94bb25c06cSjg# 95fa9e4066Sahrens# Default build targets. 96fa9e4066Sahrens# 97fa9e4066Sahrens.KEEP_STATE: 98fa9e4066Sahrens 99fa9e4066Sahrensdef: $(DEF_DEPS) 100fa9e4066Sahrens 101fa9e4066Sahrensall: $(ALL_DEPS) 102fa9e4066Sahrens 103fa9e4066Sahrensclean: $(CLEAN_DEPS) 104fa9e4066Sahrens 105fa9e4066Sahrensclobber: $(CLOBBER_DEPS) 106fa9e4066Sahrens 107fa9e4066Sahrenslint: $(LINT_DEPS) 108fa9e4066Sahrens 109fa9e4066Sahrensmodlintlib: $(MODLINTLIB_DEPS) 110fa9e4066Sahrens 111fa9e4066Sahrensclean.lint: $(CLEAN_LINT_DEPS) 112fa9e4066Sahrens 113fa9e4066Sahrensinstall: $(INSTALL_DEPS) 114fa9e4066Sahrens 115fa9e4066Sahrens$(ROOTLINK): $(ROOT_FS_DIR) $(ROOTMODULE) 116fa9e4066Sahrens -$(RM) $@; ln $(ROOTMODULE) $@ 117fa9e4066Sahrens 118fa9e4066Sahrens# 119fa9e4066Sahrens# Include common targets. 120fa9e4066Sahrens# 121fa9e4066Sahrensinclude ../Makefile.targ 122