xref: /titanic_51/usr/src/uts/sparc/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#
2235a5a358SJonathan Adams# 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#
6335a5a358SJonathan Adams#	We require sched/SDC because by the time vfs_mountroot() runs,
6435a5a358SJonathan Adams#	we can no longer load modules through OBP.
6535a5a358SJonathan Adams#
66fa9e4066SahrensMODSTUBS_DIR	 = $(OBJS_DIR)
6797322426SDarren J MoffatLDFLAGS		+= -dy -Nfs/specfs -Ncrypto/swrand -Nmisc/idmap \
68*45818ee1SMatthew Ahrens	-Nsched/SDC -Nmisc/sha2 -Nmisc/skein -Nmisc/edonr
69fa9e4066Sahrens
70fa9e4066SahrensINC_PATH	+= -I$(UTSBASE)/common/fs/zfs
71fa9e4066SahrensINC_PATH	+= -I$(SRC)/common
72fa9e4066SahrensINC_PATH	+= -I$(COMMONBASE)/zfs
73fa9e4066Sahrens
74fa9e4066SahrensC99MODE=	-xc99=%all
75fa9e4066SahrensC99LMODE=	-Xc99=%all
76fa9e4066Sahrens
77fa9e4066Sahrens#
78bb25c06cSjg# For now, disable these lint checks; maintainers should endeavor
79bb25c06cSjg# to investigate and remove these for maximum lint coverage.
80bb25c06cSjg# Please do not carry these forward to new Makefiles.
81bb25c06cSjg#
82bb25c06cSjgLINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
83bb25c06cSjgLINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
84bb25c06cSjgLINTTAGS	+= -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
85bb25c06cSjgLINTTAGS	+= -erroff=E_STATIC_UNUSED
86bb25c06cSjgLINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
87bb25c06cSjgLINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
88bb25c06cSjg
897014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-type-limits
907014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-switch
917014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-parentheses
927014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-variable
937014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-function
947014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-label
957014882cSRichard Lowe
96bb25c06cSjg#
97fa9e4066Sahrens#	Default build targets.
98fa9e4066Sahrens#
99fa9e4066Sahrens.KEEP_STATE:
100fa9e4066Sahrens
101fa9e4066Sahrensdef:		$(DEF_DEPS)
102fa9e4066Sahrens
103fa9e4066Sahrensall:		$(ALL_DEPS)
104fa9e4066Sahrens
105fa9e4066Sahrensclean:		$(CLEAN_DEPS)
106fa9e4066Sahrens
107fa9e4066Sahrensclobber:	$(CLOBBER_DEPS)
108fa9e4066Sahrens
109fa9e4066Sahrenslint:		$(LINT_DEPS)
110fa9e4066Sahrens
111fa9e4066Sahrensmodlintlib:	$(MODLINTLIB_DEPS)
112fa9e4066Sahrens
113fa9e4066Sahrensclean.lint:	$(CLEAN_LINT_DEPS)
114fa9e4066Sahrens
115fa9e4066Sahrensinstall:	$(INSTALL_DEPS)
116fa9e4066Sahrens
117fa9e4066Sahrens$(ROOTLINK):	$(ROOT_FS_DIR) $(ROOTMODULE)
118fa9e4066Sahrens	-$(RM) $@; ln $(ROOTMODULE) $@
119fa9e4066Sahrens
120fa9e4066Sahrens#
121fa9e4066Sahrens#	Include common targets.
122fa9e4066Sahrens#
123fa9e4066Sahrensinclude ../Makefile.targ
124