xref: /illumos-gate/usr/src/uts/intel/nsmb/Makefile (revision 2a1fd0ffe121888d44fdec321c25b53dcfaa9118)
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# uts/intel/nsmb/Makefile
23#
24# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# Copyright (c) 2018, Joyent, Inc.
28
29#
30#	intel architecture dependent
31#
32
33#
34#	Path to the base of the uts directory tree (usually /usr/src/uts).
35#
36UTSBASE	= ../..
37
38#
39#	Define the module and object file sets.
40#
41MODULE		= nsmb
42OBJECTS		= $(NSMB_OBJS:%=$(OBJS_DIR)/%)
43LINTS		= $(NSMB_OBJS:%.o=$(LINTS_DIR)/%.ln)
44ROOTMODULE	= $(USR_DRV_DIR)/$(MODULE)
45CONF_SRCDIR	= $(UTSBASE)/common/fs/smbclnt/netsmb
46OFFSETS_SRC	= $(CONF_SRCDIR)/offsets.in
47IOC_CHECK_H	= $(OBJS_DIR)/ioc_check.h
48
49#
50#	Include common rules.
51#
52include $(UTSBASE)/intel/Makefile.intel
53
54#
55#	Define targets
56#
57ALL_TARGET	= $(ALL_TARGET_$(OBJS_DIR))
58LINT_TARGET	= $(MODULE).lint
59INSTALL_TARGET	= $(INSTALL_TARGET_$(OBJS_DIR))
60
61#
62#	Overrides.
63#
64#	We need some unusual overrides here so we'll
65#	build ioc_check.h for both 32-bit/64-bit,
66#	but only build 64-bit binaries.
67#
68
69# Build 32-bit also...
70DEF_BUILDS	= $(DEF_BUILDS64) $(DEF_BUILDS32)
71ALL_BUILDS	= $(ALL_BUILDS64) $(ALL_BUILDS32)
72# ... but don't build any 32-bit objects
73ALL_TARGET_debug32	= $(IOC_CHECK_H)
74ALL_TARGET_debug64	= $(BINARY) $(SRC_CONFILE)
75ALL_TARGET_obj32	= $(IOC_CHECK_H)
76ALL_TARGET_obj64	= $(BINARY) $(SRC_CONFILE)
77# ... and remove -xcg92 (not supported by cw)
78CFLAGS_32=
79# ... same deal for install targets
80INSTALL_TARGET_debug32	= $(IOC_CHECK_H)
81INSTALL_TARGET_debug64	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
82INSTALL_TARGET_obj32	= $(IOC_CHECK_H)
83INSTALL_TARGET_obj64	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
84
85#
86# Now the normal overrides...
87#
88MODSTUBS_DIR	= $(OBJS_DIR)
89$(MODSTUBS_O)	:= AS_CPPFLAGS += -DNSMB_MODULE
90CLEANFILES	+= $(MODSTUBS_O) $(IOC_CHECK_H)
91CERRWARN	+= -erroff=E_STATEMENT_NOT_REACHED
92INC_PATH	+= -I$(UTSBASE)/common/fs/smbclnt
93LDFLAGS         += -dy -Ncrypto/md4 -Ncrypto/md5 -Nmisc/tlimod
94
95# Until CR 4994570 is fixed...
96LINTTAGS	+= -erroff=E_BAD_FORMAT_ARG_TYPE2
97
98# The mb_put/md_get functions are intentionally used with and without
99# return value checks, so filter those out like LGREP.2 does.
100LGREP.nsmb =	egrep -v ' ignored: (mb_init|mb_put|md_get)'
101LTAIL	+=	2>&1 | $(LGREP.2) | $(LGREP.nsmb) || true
102
103# same for smatch
104SMOFF += all_func_returns
105
106# needs work
107SMOFF += signed,deref_check
108
109#
110#	Default build targets.
111#
112.KEEP_STATE:
113
114def:		$(DEF_DEPS)
115
116all:		$(ALL_DEPS)
117
118clean:		$(CLEAN_DEPS)
119
120clobber:	$(CLOBBER_DEPS)
121
122lint:		$(LINT_DEPS)
123
124modlintlib:	$(MODLINTLIB_DEPS)
125
126clean.lint:	$(CLEAN_LINT_DEPS)
127
128install:	$(INSTALL_DEPS)
129
130#
131# Create ioc_check.h and compare with the saved
132# ioc_check.ref to ensure 32/64-bit invariance.
133#
134$(OBJECTS) : $(IOC_CHECK_H)
135$(IOC_CHECK_H): $(OFFSETS_SRC)
136	$(OFFSETS_CREATE) <$(OFFSETS_SRC) >$@.tmp
137	cmp -s ioc_check.ref $@.tmp && \
138	  mv -f $@.tmp $@
139
140#
141#	Include common targets.
142#
143include $(UTSBASE)/intel/Makefile.targ
144