xref: /illumos-gate/usr/src/uts/intel/zfs/Makefile (revision b3403853e80914bd0aade9b5b605da4878078173)
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		+= -dy -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
74C99LMODE=	-Xc99=%all
75
76#
77# For now, disable these warnings; maintainers should endeavor
78# to investigate and remove these for maximum coverage.
79# Please do not carry these forward to new Makefiles.
80#
81
82CERRWARN	+= -_gcc=-Wno-type-limits
83CERRWARN	+= -_gcc=-Wno-switch
84CERRWARN	+= -_gcc=-Wno-parentheses
85CERRWARN	+= -_gcc=-Wno-unused-variable
86CERRWARN	+= -_gcc=-Wno-unused-function
87CERRWARN	+= -_gcc=-Wno-unused-label
88
89# needs work
90SMOFF += all_func_returns,indenting
91$(OBJS_DIR)/llex.o := SMOFF += index_overflow
92$(OBJS_DIR)/metaslab.o := SMOFF += no_if_block
93$(OBJS_DIR)/zfs_vnops.o := SMOFF += signed
94# needs work
95$(OBJS_DIR)/zvol.o := SMOFF += deref_check,signed
96
97# false positive
98$(OBJS_DIR)/zfs_ctldir.o := SMOFF += strcpy_overflow
99
100#
101#	Default build targets.
102#
103.KEEP_STATE:
104
105def:		$(DEF_DEPS)
106
107all:		$(ALL_DEPS)
108
109clean:		$(CLEAN_DEPS)
110
111clobber:	$(CLOBBER_DEPS)
112
113install:	$(INSTALL_DEPS)
114
115$(ROOTLINK):	$(ROOT_FS_DIR) $(ROOTMODULE)
116	-$(RM) $@; ln $(ROOTMODULE) $@
117
118#
119#	Include common targets.
120#
121include ../Makefile.targ
122