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# 2297322426SDarren J Moffat# 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. 2745818ee1SMatthew Ahrens# 2845818ee1SMatthew Ahrens# Copyright 2013 Saso Kiselkov. All rights reserved. 2945818ee1SMatthew Ahrens# 30dfc11533SChris Williamson# Copyright (c) 2016 by Delphix. All rights reserved. 31dfc11533SChris Williamson# 32455e370cSJohn Levon# Copyright 2019 Joyent, Inc. 33fa9e4066Sahrens 34fa9e4066Sahrens# 35fa9e4066Sahrens# Path to the base of the uts directory tree (usually /usr/src/uts). 36fa9e4066Sahrens# 37fa9e4066SahrensUTSBASE = ../.. 38fa9e4066Sahrens 39fa9e4066SahrensARCHDIR:sh = cd ..; basename `pwd` 40fa9e4066Sahrens 41fa9e4066Sahrens# 42fa9e4066Sahrens# Define the module and object file sets. 43fa9e4066Sahrens# 44fa9e4066SahrensMODULE = zfs 45dfc11533SChris WilliamsonOBJECTS = $(ZFS_OBJS:%=$(OBJS_DIR)/%) $(LUA_OBJS:%=$(OBJS_DIR)/%) 46fa9e4066SahrensROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) 47fa9e4066SahrensROOTLINK = $(ROOT_FS_DIR)/$(MODULE) 48fa9e4066SahrensCONF_SRCDIR = $(UTSBASE)/common/fs/zfs 49fa9e4066Sahrens 50fa9e4066Sahrens# 51fa9e4066Sahrens# Include common rules. 52fa9e4066Sahrens# 53fa9e4066Sahrensinclude ../Makefile.$(ARCHDIR) 54fa9e4066Sahrens 55fa9e4066Sahrens# 56fa9e4066Sahrens# Define targets 57fa9e4066Sahrens# 58fa9e4066SahrensALL_TARGET = $(BINARY) $(SRC_CONFILE) 59fa9e4066SahrensINSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOTLINK) $(ROOT_CONFFILE) 60fa9e4066Sahrens 61fa9e4066Sahrens# 62fa9e4066Sahrens# Overrides and depends_on 63fa9e4066Sahrens# 64*82d0151aSRichard LoweLDFLAGS += -Nfs/specfs -Ncrypto/swrand -Nmisc/idmap -Nmisc/sha2 \ 6545818ee1SMatthew Ahrens -Nmisc/skein -Nmisc/edonr 66fa9e4066Sahrens 67fa9e4066SahrensINC_PATH += -I$(UTSBASE)/common/fs/zfs 68dfc11533SChris WilliamsonINC_PATH += -I$(UTSBASE)/common/fs/zfs/lua 69fa9e4066SahrensINC_PATH += -I$(SRC)/common 70fa9e4066SahrensINC_PATH += -I$(COMMONBASE)/zfs 71455e370cSJohn LevonINC_PATH += -I$(UTSBASE)/i86pc 72fa9e4066Sahrens 73fa9e4066Sahrens# 740aaef2f5SRichard Lowe# For now, disable these warnings; maintainers should endeavor 750aaef2f5SRichard Lowe# to investigate and remove these for maximum coverage. 76bb25c06cSjg# Please do not carry these forward to new Makefiles. 77bb25c06cSjg# 78bb25c06cSjg 797014882cSRichard LoweCERRWARN += -_gcc=-Wno-type-limits 807014882cSRichard LoweCERRWARN += -_gcc=-Wno-switch 817014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 827014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable 837014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function 847014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-label 857014882cSRichard Lowe 86b6b206fcSJohn Levon# needs work 87b6b206fcSJohn LevonSMOFF += all_func_returns,indenting 88b6b206fcSJohn Levon$(OBJS_DIR)/llex.o := SMOFF += index_overflow 89b6b206fcSJohn Levon$(OBJS_DIR)/metaslab.o := SMOFF += no_if_block 90b6b206fcSJohn Levon$(OBJS_DIR)/zfs_vnops.o := SMOFF += signed 91b6b206fcSJohn Levon# needs work 92b6b206fcSJohn Levon$(OBJS_DIR)/zvol.o := SMOFF += deref_check,signed 93b6b206fcSJohn Levon 94c85f09ccSJohn Levon# false positive 95b6b206fcSJohn Levon$(OBJS_DIR)/zfs_ctldir.o := SMOFF += strcpy_overflow 96b6b206fcSJohn Levon 97bb25c06cSjg# 98fa9e4066Sahrens# Default build targets. 99fa9e4066Sahrens# 100fa9e4066Sahrens.KEEP_STATE: 101fa9e4066Sahrens 102fa9e4066Sahrensdef: $(DEF_DEPS) 103fa9e4066Sahrens 104fa9e4066Sahrensall: $(ALL_DEPS) 105fa9e4066Sahrens 106fa9e4066Sahrensclean: $(CLEAN_DEPS) 107fa9e4066Sahrens 108fa9e4066Sahrensclobber: $(CLOBBER_DEPS) 109fa9e4066Sahrens 110fa9e4066Sahrensinstall: $(INSTALL_DEPS) 111fa9e4066Sahrens 112fa9e4066Sahrens$(ROOTLINK): $(ROOT_FS_DIR) $(ROOTMODULE) 113fa9e4066Sahrens -$(RM) $@; ln $(ROOTMODULE) $@ 114fa9e4066Sahrens 115fa9e4066Sahrens# 116fa9e4066Sahrens# Include common targets. 117fa9e4066Sahrens# 118fa9e4066Sahrensinclude ../Makefile.targ 119