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# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# Copyright 2017 Nexenta Systems, Inc. All rights reserved. 26# 27# Copyright (c) 2018, Joyent, Inc. 28 29LIBRARY = libfksmbsrv.a 30VERS = .1 31 32OBJS_LOCAL = \ 33 fksmb_cred.o \ 34 fksmb_encrypt_pkcs.o \ 35 fksmb_fem.o \ 36 fksmb_idmap.o \ 37 fksmb_init.o \ 38 fksmb_kdoor.o \ 39 fksmb_sign_pkcs.o \ 40 fake_lookup.o \ 41 fake_nblk.o \ 42 fake_vfs.o \ 43 fake_vnode.o \ 44 fake_vop.o \ 45 fake_xattr.o \ 46 reparse.o \ 47 vncache.o 48 49# See also: $SRC/uts/common/Makefile.files 50# NB: Intentionally ommitted, compared w/ the above: 51# smb_cred, smb_fem, smb_idmap, smb_init, smb_kdoor 52# 53OBJS_FS_SMBSRV = \ 54 smb_acl.o \ 55 smb_alloc.o \ 56 smb_authenticate.o \ 57 smb_close.o \ 58 smb_cmn_oplock.o \ 59 smb_cmn_rename.o \ 60 smb_cmn_setfile.o \ 61 smb_common_open.o \ 62 smb_common_transact.o \ 63 smb_create.o \ 64 smb_delete.o \ 65 smb_dfs.o \ 66 smb_directory.o \ 67 smb_dispatch.o \ 68 smb_echo.o \ 69 smb_errno.o \ 70 smb_find.o \ 71 smb_flush.o \ 72 smb_fsinfo.o \ 73 smb_fsops.o \ 74 smb_kshare.o \ 75 smb_kutil.o \ 76 smb_lock.o \ 77 smb_lock_byte_range.o \ 78 smb_locking_andx.o \ 79 smb_logoff_andx.o \ 80 smb_mangle_name.o \ 81 smb_mbuf_marshaling.o \ 82 smb_mbuf_util.o \ 83 smb_negotiate.o \ 84 smb_net.o \ 85 smb_node.o \ 86 smb_notify.o \ 87 smb_nt_cancel.o \ 88 smb_nt_create_andx.o \ 89 smb_nt_transact_create.o \ 90 smb_nt_transact_ioctl.o \ 91 smb_nt_transact_notify_change.o \ 92 smb_nt_transact_quota.o \ 93 smb_nt_transact_security.o \ 94 smb_odir.o \ 95 smb_ofile.o \ 96 smb_open_andx.o \ 97 smb_opipe.o \ 98 smb_oplock.o \ 99 smb_pathname.o \ 100 smb_print.o \ 101 smb_process_exit.o \ 102 smb_query_fileinfo.o \ 103 smb_quota.o \ 104 smb_read.o \ 105 smb_rename.o \ 106 smb_sd.o \ 107 smb_seek.o \ 108 smb_server.o \ 109 smb_session.o \ 110 smb_session_setup_andx.o \ 111 smb_set_fileinfo.o \ 112 smb_signing.o \ 113 smb_srv_oplock.o \ 114 smb_thread.o \ 115 smb_tree.o \ 116 smb_trans2_create_directory.o \ 117 smb_trans2_dfs.o \ 118 smb_trans2_find.o \ 119 smb_tree_connect.o \ 120 smb_unlock_byte_range.o \ 121 smb_user.o \ 122 smb_vfs.o \ 123 smb_vops.o \ 124 smb_vss.o \ 125 smb_write.o \ 126 \ 127 smb2_aapl.o \ 128 smb2_dispatch.o \ 129 smb2_durable.o \ 130 smb2_cancel.o \ 131 smb2_change_notify.o \ 132 smb2_close.o \ 133 smb2_create.o \ 134 smb2_echo.o \ 135 smb2_flush.o \ 136 smb2_fsctl_copychunk.o \ 137 smb2_fsctl_fs.o \ 138 smb2_fsctl_odx.o \ 139 smb2_fsctl_sparse.o \ 140 smb2_ioctl.o \ 141 smb2_lease.o \ 142 smb2_lock.o \ 143 smb2_logoff.o \ 144 smb2_negotiate.o \ 145 smb2_ofile.o \ 146 smb2_oplock.o \ 147 smb2_qinfo_file.o \ 148 smb2_qinfo_fs.o \ 149 smb2_qinfo_sec.o \ 150 smb2_qinfo_quota.o \ 151 smb2_query_dir.o \ 152 smb2_query_info.o \ 153 smb2_read.o \ 154 smb2_session_setup.o \ 155 smb2_set_info.o \ 156 smb2_setinfo_file.o \ 157 smb2_setinfo_fs.o \ 158 smb2_setinfo_quota.o \ 159 smb2_setinfo_sec.o \ 160 smb2_signing.o \ 161 smb2_tree_connect.o \ 162 smb2_tree_disconn.o \ 163 smb2_write.o \ 164 \ 165 smb3_encrypt.o 166 167# Can't just link with -lsmb because of user vs kernel API 168# i.e. can't call free with mem from kmem_alloc, which is 169# what happens if we just link with -lsmb 170OBJS_CMN_SMBSRV = \ 171 smb_cfg_util.o \ 172 smb_inet.o \ 173 smb_match.o \ 174 smb_msgbuf.o \ 175 smb_native.o \ 176 smb_netbios_util.o \ 177 smb_oem.o \ 178 smb_sid.o \ 179 smb_string.o \ 180 smb_token.o \ 181 smb_token_xdr.o \ 182 smb_utf8.o \ 183 smb_xdr.o 184 185OBJS_MISC = \ 186 acl_common.o \ 187 pathname.o \ 188 refstr.o \ 189 smb_status2winerr.o \ 190 xattr_common.o 191 192# This one can't be in OBJECTS, as it has to depend on 193# all of those for the COMPILE.d rule (which processes 194# all those objects collecting probe instances). 195DTRACE_OBJS = fksmb_dt.o 196 197OBJECTS = \ 198 $(OBJS_LOCAL) \ 199 $(OBJS_FS_SMBSRV) \ 200 $(OBJS_CMN_SMBSRV) \ 201 $(OBJS_MISC) 202 203include ../../../Makefile.lib 204include ../../Makefile.lib 205 206# Force SOURCEDEBUG 207CSOURCEDEBUGFLAGS = $(CCGDEBUG) 208CCSOURCEDEBUGFLAGS = $(CCGDEBUG) 209STRIP_STABS = : 210 211 212# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc. 213CPPFLAGS.first += -I../../../libfakekernel/common 214CPPFLAGS.first += -I../common 215 216INCS += -I$(SRC)/uts/common 217INCS += -I$(SRC)/common/smbsrv 218INCS += -I$(SRC)/common 219 220LINTCHECKFLAGS += -erroff=E_INCONS_ARG_DECL2 221LINTCHECKFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 222LINTCHECKFLAGS += -erroff=E_INCONS_VAL_TYPE_USED2 223 224LDLIBS += $(MACH_LDLIBS) 225LDLIBS += -lfakekernel -lidmap -lcmdutils 226LDLIBS += -lavl -lnvpair -lnsl -lpkcs11 -lreparse -lc 227 228CPPFLAGS += $(INCS) -D_REENTRANT -D_FAKE_KERNEL 229CPPFLAGS += -D_FILE_OFFSET_BITS=64 230# Always want DEBUG here 231CPPFLAGS += -DDEBUG 232 233CERRWARN += -_gcc=-Wno-switch 234 235# not linted 236SMATCH=off 237 238SRCS= $(OBJS_LOCAL:%.o=$(SRCDIR)/%.c) \ 239 $(OBJS_FS_SMBSRV:%.o=$(SRC)/uts/common/fs/smbsrv/%.c) \ 240 $(OBJS_CMN_SMBSRV:%.o=$(SRC)/common/smbsrv/%.c) 241 242all: 243 244pics/%.o: $(SRC)/uts/common/fs/smbsrv/%.c 245 $(COMPILE.c) -o $@ $< 246 $(POST_PROCESS_O) 247 248pics/acl_common.o: $(SRC)/common/acl/acl_common.c 249 $(COMPILE.c) -o $@ $(SRC)/common/acl/acl_common.c 250 $(POST_PROCESS_O) 251 252pics/pathname.o: $(SRC)/uts/common/fs/pathname.c 253 $(COMPILE.c) -o $@ $(SRC)/uts/common/fs/pathname.c 254 $(POST_PROCESS_O) 255 256pics/refstr.o: $(SRC)/uts/common/os/refstr.c 257 $(COMPILE.c) -o $@ $(SRC)/uts/common/os/refstr.c 258 $(POST_PROCESS_O) 259 260pics/smb_status2winerr.o: $(SRC)/common/smbclnt/smb_status2winerr.c 261 $(COMPILE.c) -o $@ $(SRC)/common/smbclnt/smb_status2winerr.c 262 $(POST_PROCESS_O) 263 264pics/xattr_common.o: $(SRC)/common/xattr/xattr_common.c 265 $(COMPILE.c) -o $@ $(SRC)/common/xattr/xattr_common.c 266 $(POST_PROCESS_O) 267 268# Makefile.targ has rule for $(SRC)/common/smbsrv/%.c 269 270.KEEP_STATE: 271 272include ../../Makefile.targ 273include ../../../Makefile.targ 274 275EXTPICS= $(DTRACE_OBJS:%=pics/%) 276CLEANFILES += $(EXTPICS) 277 278$(OBJS) $(PICS) : ../common/fksmb_dt.h 279 280pics/fksmb_dt.o: ../common/fksmb_dt.d $(PICS) 281 $(COMPILE.d) -C -s ../common/fksmb_dt.d -o $@ $(PICS) 282 $(POST_PROCESS_O) 283