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