xref: /illumos-gate/usr/src/uts/intel/nsmb/Makefile (revision e3ae4b35c024af1196582063ecee3ab79367227d)
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)/%)
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)/intel/Makefile.intel
52
53#
54#	Define targets
55#
56ALL_TARGET	= $(ALL_TARGET_$(OBJS_DIR))
57INSTALL_TARGET	= $(INSTALL_TARGET_$(OBJS_DIR))
58
59#
60#	Overrides.
61#
62#	We need some unusual overrides here so we'll
63#	build ioc_check.h for both 32-bit/64-bit,
64#	but only build 64-bit binaries.
65#
66
67# Build 32-bit also...
68DEF_BUILDS	= $(DEF_BUILDS64) $(DEF_BUILDS32)
69ALL_BUILDS	= $(ALL_BUILDS64) $(ALL_BUILDS32)
70# ... but don't build any 32-bit objects
71ALL_TARGET_debug32	= $(IOC_CHECK_H)
72ALL_TARGET_debug64	= $(BINARY) $(SRC_CONFILE)
73ALL_TARGET_obj32	= $(IOC_CHECK_H)
74ALL_TARGET_obj64	= $(BINARY) $(SRC_CONFILE)
75# ... and remove -xcg92 (not supported by cw)
76CFLAGS_32=
77# ... same deal for install targets
78INSTALL_TARGET_debug32	= $(IOC_CHECK_H)
79INSTALL_TARGET_debug64	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
80INSTALL_TARGET_obj32	= $(IOC_CHECK_H)
81INSTALL_TARGET_obj64	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
82
83#
84# Now the normal overrides...
85#
86MODSTUBS_DIR	= $(OBJS_DIR)
87$(MODSTUBS_O)	:= AS_CPPFLAGS += -DNSMB_MODULE
88CLEANFILES	+= $(MODSTUBS_O) $(IOC_CHECK_H)
89INC_PATH	+= -I$(UTSBASE)/common/fs/smbclnt
90LDFLAGS         += -Ncrypto/md4 -Ncrypto/md5 -Nmisc/tlimod
91
92#
93# For now, disable these warnings; maintainers should endeavor
94# to investigate and remove these for maximum coverage.
95# Please do not carry these forward to new Makefiles.
96#
97
98# The mb_put/md_get functions are intentionally used with and without
99# return value checks, so filter those.
100SMOFF += all_func_returns
101
102# needs work
103SMOFF += signed,deref_check
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
118install:	$(INSTALL_DEPS)
119
120#
121# Create ioc_check.h and compare with the saved
122# ioc_check.ref to ensure 32/64-bit invariance.
123#
124$(OBJECTS) : $(IOC_CHECK_H)
125$(IOC_CHECK_H): $(OFFSETS_SRC)
126	$(OFFSETS_CREATE) <$(OFFSETS_SRC) >$@.tmp
127	cmp -s ioc_check.ref $@.tmp && \
128	  mv -f $@.tmp $@
129
130#
131#	Include common targets.
132#
133include $(UTSBASE)/intel/Makefile.targ
134