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# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# This makefile drives the production of the zfs file system 26# kernel module. 27# 28# Copyright 2013 Saso Kiselkov. All rights reserved. 29# 30# Copyright (c) 2016 by Delphix. All rights reserved. 31# 32# Copyright 2019 Joyent, Inc. 33 34# 35# Path to the base of the uts directory tree (usually /usr/src/uts). 36# 37UTSBASE = ../.. 38 39ARCHDIR:sh = cd ..; basename `pwd` 40 41# 42# Define the module and object file sets. 43# 44MODULE = zfs 45OBJECTS = $(ZFS_OBJS:%=$(OBJS_DIR)/%) $(LUA_OBJS:%=$(OBJS_DIR)/%) 46ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) 47ROOTLINK = $(ROOT_FS_DIR)/$(MODULE) 48CONF_SRCDIR = $(UTSBASE)/common/fs/zfs 49 50# 51# Include common rules. 52# 53include ../Makefile.$(ARCHDIR) 54 55# 56# Define targets 57# 58ALL_TARGET = $(BINARY) $(SRC_CONFILE) 59INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOTLINK) $(ROOT_CONFFILE) 60 61# 62# Overrides and depends_on 63# 64MODSTUBS_DIR = $(OBJS_DIR) 65LDFLAGS += -Nfs/specfs -Ncrypto/swrand -Nmisc/idmap -Nmisc/sha2 \ 66 -Nmisc/skein -Nmisc/edonr 67 68INC_PATH += -I$(UTSBASE)/common/fs/zfs 69INC_PATH += -I$(UTSBASE)/common/fs/zfs/lua 70INC_PATH += -I$(SRC)/common 71INC_PATH += -I$(COMMONBASE)/zfs 72INC_PATH += -I$(UTSBASE)/i86pc 73 74# 75# For now, disable these warnings; maintainers should endeavor 76# to investigate and remove these for maximum coverage. 77# Please do not carry these forward to new Makefiles. 78# 79 80CERRWARN += -_gcc=-Wno-type-limits 81CERRWARN += -_gcc=-Wno-switch 82CERRWARN += -_gcc=-Wno-parentheses 83CERRWARN += -_gcc=-Wno-unused-variable 84CERRWARN += -_gcc=-Wno-unused-function 85CERRWARN += -_gcc=-Wno-unused-label 86 87# needs work 88SMOFF += all_func_returns,indenting 89$(OBJS_DIR)/llex.o := SMOFF += index_overflow 90$(OBJS_DIR)/metaslab.o := SMOFF += no_if_block 91$(OBJS_DIR)/zfs_vnops.o := SMOFF += signed 92# needs work 93$(OBJS_DIR)/zvol.o := SMOFF += deref_check,signed 94 95# false positive 96$(OBJS_DIR)/zfs_ctldir.o := SMOFF += strcpy_overflow 97 98# 99# Default build targets. 100# 101.KEEP_STATE: 102 103def: $(DEF_DEPS) 104 105all: $(ALL_DEPS) 106 107clean: $(CLEAN_DEPS) 108 109clobber: $(CLOBBER_DEPS) 110 111install: $(INSTALL_DEPS) 112 113$(ROOTLINK): $(ROOT_FS_DIR) $(ROOTMODULE) 114 -$(RM) $@; ln $(ROOTMODULE) $@ 115 116# 117# Include common targets. 118# 119include ../Makefile.targ 120