xref: /titanic_51/usr/src/uts/intel/zfs/Makefile (revision 45818ee124adeaaf947698996b4f4c722afc6d1f)
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.
27*45818ee1SMatthew Ahrens#
28*45818ee1SMatthew Ahrens# Copyright 2013 Saso Kiselkov. All rights reserved.
29*45818ee1SMatthew Ahrens#
30fa9e4066Sahrens
31fa9e4066Sahrens#
32fa9e4066Sahrens#	Path to the base of the uts directory tree (usually /usr/src/uts).
33fa9e4066Sahrens#
34fa9e4066SahrensUTSBASE	= ../..
35fa9e4066Sahrens
36fa9e4066SahrensARCHDIR:sh = cd ..; basename `pwd`
37fa9e4066Sahrens
38fa9e4066Sahrens#
39fa9e4066Sahrens#	Define the module and object file sets.
40fa9e4066Sahrens#
41fa9e4066SahrensMODULE		= zfs
42fa9e4066SahrensOBJECTS		= $(ZFS_OBJS:%=$(OBJS_DIR)/%)
43fa9e4066SahrensLINTS		= $(ZFS_OBJS:%.o=$(LINTS_DIR)/%.ln)
44fa9e4066SahrensROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
45fa9e4066SahrensROOTLINK	= $(ROOT_FS_DIR)/$(MODULE)
46fa9e4066SahrensCONF_SRCDIR	= $(UTSBASE)/common/fs/zfs
47fa9e4066Sahrens
48fa9e4066Sahrens#
49fa9e4066Sahrens#	Include common rules.
50fa9e4066Sahrens#
51fa9e4066Sahrensinclude ../Makefile.$(ARCHDIR)
52fa9e4066Sahrens
53fa9e4066Sahrens#
54fa9e4066Sahrens#	Define targets
55fa9e4066Sahrens#
56fa9e4066SahrensALL_TARGET	= $(BINARY) $(SRC_CONFILE)
57fa9e4066SahrensLINT_TARGET	= $(MODULE).lint
58fa9e4066SahrensINSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOTLINK) $(ROOT_CONFFILE)
59fa9e4066Sahrens
60fa9e4066Sahrens#
61fa9e4066Sahrens#	Overrides and depends_on
62fa9e4066Sahrens#
63fa9e4066SahrensMODSTUBS_DIR	 = $(OBJS_DIR)
64*45818ee1SMatthew AhrensLDFLAGS		+= -dy -Nfs/specfs -Ncrypto/swrand -Nmisc/idmap -Nmisc/sha2 \
65*45818ee1SMatthew Ahrens	-Nmisc/skein -Nmisc/edonr
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
867014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-type-limits
877014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-switch
887014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-parentheses
897014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-variable
907014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-function
917014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-label
927014882cSRichard Lowe
93bb25c06cSjg#
94fa9e4066Sahrens#	Default build targets.
95fa9e4066Sahrens#
96fa9e4066Sahrens.KEEP_STATE:
97fa9e4066Sahrens
98fa9e4066Sahrensdef:		$(DEF_DEPS)
99fa9e4066Sahrens
100fa9e4066Sahrensall:		$(ALL_DEPS)
101fa9e4066Sahrens
102fa9e4066Sahrensclean:		$(CLEAN_DEPS)
103fa9e4066Sahrens
104fa9e4066Sahrensclobber:	$(CLOBBER_DEPS)
105fa9e4066Sahrens
106fa9e4066Sahrenslint:		$(LINT_DEPS)
107fa9e4066Sahrens
108fa9e4066Sahrensmodlintlib:	$(MODLINTLIB_DEPS)
109fa9e4066Sahrens
110fa9e4066Sahrensclean.lint:	$(CLEAN_LINT_DEPS)
111fa9e4066Sahrens
112fa9e4066Sahrensinstall:	$(INSTALL_DEPS)
113fa9e4066Sahrens
114fa9e4066Sahrens$(ROOTLINK):	$(ROOT_FS_DIR) $(ROOTMODULE)
115fa9e4066Sahrens	-$(RM) $@; ln $(ROOTMODULE) $@
116fa9e4066Sahrens
117fa9e4066Sahrens#
118fa9e4066Sahrens#	Include common targets.
119fa9e4066Sahrens#
120fa9e4066Sahrensinclude ../Makefile.targ
121