xref: /illumos-gate/usr/src/cmd/smbsrv/smbd/Makefile (revision 689b9301078f0c35c7f198fcee8032a0d30eff3a)
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
62CFLAGS += $(CCVERBOSE)
63CPPFLAGS += -D_IPP_PRIVATE_STRUCTURES
64CPPFLAGS += -D_REENTRANT
65CPPFLAGS += -Dsyslog=smb_syslog
66$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
67
68# Should not have to do this, but the Kerberos includes are a mess.
69CPPFLAGS += -I $(ROOT)/usr/include/kerberosv5
70
71# needs work
72SMOFF += all_func_returns,deref_check
73
74CSTD =       $(CSTD_GNU99)
75
76LDFLAGS += -R/usr/lib/smbsrv
77LDLIBS += -L$(ROOT)/usr/lib/smbsrv
78# prefer to keep libs ordered by dependence
79LDLIBS += -lmlsvc -lmlrpc -lsmbns -lsmb -lsmbfs -lgss
80LDLIBS += -lzfs -lbsm -lscf -lcmdutils -lsocket -lnsl -lumem
81$(PROG) := LDLIBS += -lkrb5
82
83$(ENABLE_SMB_PRINTING) CPPFLAGS += -DHAVE_CUPS
84
85ROOTSMBDDIR = $(ROOTLIB)/smbsrv
86ROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%)
87
88FILEMODE = 0444
89$(ROOTSMBDFILE):= FILEMODE = 0555
90
91$(ROOTSMBDDIR)/%: %
92	$(INS.file)
93
94$(ROOTVARSMBDLLDIR)/%: %
95	$(INS.file)
96
97all:		$(PROG)
98
99clean:
100	$(RM) $(OBJS)
101
102$(PROG):	$(OBJS)
103	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
104	$(POST_PROCESS)
105
106check:		$(CHKMANIFEST)
107
108_msg:
109
110include ../../Makefile.targ
111
112install: all .WAIT $(ROOTETCDEFAULTFILES) $(ROOTMANIFEST) \
113		$(ROOTSMBDFILE) ${ROOTSVCMETHOD} $(ROOTVARSMBDLL)
114
115.KEEP_STATE:
116