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