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