xref: /illumos-gate/usr/src/uts/intel/zfs/Makefile (revision da59b86634f0fe3ed09807da97d108e580ece778)
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#
64LDFLAGS		+= -Nfs/specfs -Ncrypto/swrand -Nmisc/idmap -Nmisc/sha2 \
65	-Nmisc/skein -Nmisc/edonr
66
67INC_PATH	+= -I$(UTSBASE)/common/fs/zfs
68INC_PATH	+= -I$(UTSBASE)/common/fs/zfs/lua
69INC_PATH	+= -I$(SRC)/common
70INC_PATH	+= -I$(COMMONBASE)/zfs
71INC_PATH	+= -I$(UTSBASE)/i86pc
72
73#
74# For now, disable these warnings; maintainers should endeavor
75# to investigate and remove these for maximum coverage.
76# Please do not carry these forward to new Makefiles.
77#
78
79CERRWARN	+= -_gcc=-Wno-type-limits
80CERRWARN	+= -_gcc=-Wno-switch
81CERRWARN	+= -_gcc=-Wno-parentheses
82CERRWARN	+= -_gcc=-Wno-unused-variable
83CERRWARN	+= -_gcc=-Wno-unused-function
84CERRWARN	+= -_gcc=-Wno-unused-label
85
86# needs work
87SMOFF += all_func_returns,indenting
88$(OBJS_DIR)/llex.o := SMOFF += index_overflow
89$(OBJS_DIR)/metaslab.o := SMOFF += no_if_block
90$(OBJS_DIR)/zfs_vnops.o := SMOFF += signed
91# needs work
92$(OBJS_DIR)/zvol.o := SMOFF += deref_check,signed
93
94# false positive
95$(OBJS_DIR)/zfs_ctldir.o := SMOFF += strcpy_overflow
96
97#
98#	Default build targets.
99#
100.KEEP_STATE:
101
102def:		$(DEF_DEPS)
103
104all:		$(ALL_DEPS)
105
106clean:		$(CLEAN_DEPS)
107
108clobber:	$(CLOBBER_DEPS)
109
110install:	$(INSTALL_DEPS)
111
112$(ROOTLINK):	$(ROOT_FS_DIR) $(ROOTMODULE)
113	-$(RM) $@; ln $(ROOTMODULE) $@
114
115#
116#	Include common targets.
117#
118include ../Makefile.targ
119