xref: /illumos-gate/usr/src/cmd/smbsrv/smbd/Makefile (revision 6f1fa39e)
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 (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
24# Copyright (c) 2018, Joyent, Inc.
25#
26
27
28PROG=	smbd
29OBJS=				\
30	smbd_authsvc.o		\
31	smbd_doorsvc.o		\
32	smbd_join.o		\
33	smbd_krb5lookup.o	\
34	smbd_krb5ssp.o		\
35	smbd_logon.o		\
36	smbd_main.o		\
37	smbd_nicmon.o		\
38	smbd_ntlmssp.o		\
39	smbd_pipesvc.o		\
40	smbd_share_doorsvc.o	\
41	smbd_spool.o		\
42	smbd_syslog.o		\
43	smbd_vss.o
44
45SRCS=	$(OBJS:%.o=%.c)
46
47include ../../Makefile.cmd
48include ../../Makefile.ctf
49
50MANIFEST=	server.xml
51SVCMETHOD=	svc-smbd
52LOGDLL=		eventlog.dll
53
54ROOTMANIFESTDIR	= $(ROOTSVCSMB)
55ROOTVARSMBDLLDIR = $(ROOTVARSMB)/cvol/windows/system32
56ROOTVARSMBDLL= $(LOGDLL:%=$(ROOTVARSMBDLLDIR)/%)
57
58$(ROOTMANIFEST):= FILEMODE = 0444
59$(ROOTSVCMETHOD):= FILEMODE = 0555
60$(ROOTVARSMBDLL):= FILEMODE = 0755
61
62LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
63LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
64
65CFLAGS += $(CCVERBOSE)
66CPPFLAGS += -D_IPP_PRIVATE_STRUCTURES
67CPPFLAGS += -D_REENTRANT
68CPPFLAGS += -Dsyslog=smb_syslog
69$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
70
71# Should not have to do this, but the Kerberos includes are a mess.
72CPPFLAGS += -I $(ROOT)/usr/include/kerberosv5
73
74# needs work
75SMOFF += all_func_returns,deref_check
76
77CSTD =       $(CSTD_GNU99)
78C99LMODE =      -Xc99=%all
79
80LDFLAGS += -R/usr/lib/smbsrv
81LDLIBS += -L$(ROOT)/usr/lib/smbsrv
82# prefer to keep libs ordered by dependence
83LDLIBS += -lmlsvc -lmlrpc -lsmbns -lsmb -lsmbfs -lgss
84LDLIBS += -lzfs -lbsm -lscf -lcmdutils -lsocket -lnsl -lumem
85$(PROG) := LDLIBS += -lkrb5
86
87$(ENABLE_SMB_PRINTING) CPPFLAGS += -DHAVE_CUPS
88
89ROOTSMBDDIR = $(ROOTLIB)/smbsrv
90ROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%)
91
92FILEMODE = 0444
93$(ROOTSMBDFILE):= FILEMODE = 0555
94
95$(ROOTSMBDDIR)/%: %
96	$(INS.file)
97
98$(ROOTVARSMBDLLDIR)/%: %
99	$(INS.file)
100
101all:		$(PROG)
102
103clean:
104	$(RM) $(OBJS)
105
106lint:		lint_SRCS
107
108$(PROG):	$(OBJS)
109	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
110	$(POST_PROCESS)
111
112check:		$(CHKMANIFEST)
113
114_msg:
115
116include ../../Makefile.targ
117
118install: all .WAIT $(ROOTETCDEFAULTFILES) $(ROOTMANIFEST) \
119		$(ROOTSMBDFILE) ${ROOTSVCMETHOD} $(ROOTVARSMBDLL)
120
121.KEEP_STATE:
122