xref: /illumos-gate/usr/src/cmd/smbsrv/fksmbd/Makefile (revision 06ca4e396ecc93ed45a333664a51558b7e84e8f5)
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 2015 Nexenta Systems, Inc.  All rights reserved.
24#
25
26
27PROG=	fksmbd
28OBJS_SMBD=			\
29	smbd_authsvc.o		\
30	smbd_doorsvc.o		\
31	smbd_join.o		\
32	smbd_krb5lookup.o	\
33	smbd_krb5ssp.o		\
34	smbd_logon.o		\
35	smbd_main.o		\
36	smbd_nicmon.o		\
37	smbd_ntlmssp.o		\
38	smbd_pipesvc.o		\
39	smbd_share_doorsvc.o	\
40	smbd_spool.o		\
41	smbd_vss.o		\
42
43
44OBJS_LOCAL =			\
45	fksmbd_door.o		\
46	fksmbd_kmod.o		\
47	fksmbd_ksock.o		\
48	fksmbd_log.o		\
49	fksmbd_shr.o
50
51OBJS=	${OBJS_SMBD} ${OBJS_LOCAL}
52SRCS=	${OBJS_SMBD:%.o=../smbd/%.c} \
53	${OBJS_LOCAL:.o=.c}
54
55include ../../Makefile.cmd
56include ../../Makefile.ctf
57
58# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
59CPPFLAGS.first += -I../../../lib/smbsrv/libfksmbsrv/common
60
61INCS += -I../smbd
62INCS +=	-I../../../uts/common
63INCS +=	-I../../../uts/common/smbsrv
64INCS +=	-I../../../common/smbsrv
65
66# Should not have to do this, but the Kerberos includes are a mess.
67INCS += -I $(ROOT)/usr/include/kerberosv5
68
69CSTD=	$(CSTD_GNU99)
70
71CFLAGS += $(CCVERBOSE)
72CFLAGS64 += $(CCVERBOSE)
73CPPFLAGS += -D_REENTRANT
74CPPFLAGS += -Dsyslog=smb_syslog
75CPPFLAGS += -D_LARGEFILE64_SOURCE=1
76CPPFLAGS += -DFKSMBD
77# Always debug here
78CPPFLAGS += -DDEBUG
79CPPFLAGS += $(INCS)
80
81LDFLAGS += $(ZNOLAZYLOAD)
82LDFLAGS += '-R$$ORIGIN' '-R$$ORIGIN/..'
83LDLIBS += -L$(ROOT)/usr/lib/smbsrv
84LDLIBS += -lfksmbsrv -lfakekernel
85# prefer to keep libs ordered by dependence
86LDLIBS += -lmlsvc -lmlrpc -lsmbns -lsmb -lsmbfs -lgss
87LDLIBS += -lzfs -lbsm -lscf -lcmdutils -lsocket -lnsl -lumem
88$(PROG) := LDLIBS += -lkrb5
89
90ROOTSMBDDIR = $(ROOTLIB)/smbsrv
91ROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%)
92
93.KEEP_STATE:
94
95all: $(PROG)
96
97$(PROG): $(OBJS)
98	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
99	$(POST_PROCESS)
100
101clean:
102	-$(RM) $(OBJS)
103
104include ../../Makefile.targ
105
106install: all $(ROOTSMBDFILE)
107
108%.o: ../smbd/%.c
109	$(COMPILE.c) $<
110	$(POST_PROCESS_O)
111
112$(ROOTSMBDDIR)/%: %
113	$(INS.file)
114