xref: /titanic_51/usr/src/cmd/smbsrv/fksmbd/Makefile (revision b819cea2f73f98c5662230cc9affc8cc84f77fcf)
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#
25
26
27PROG=	fksmbd
28OBJS_SMBD=			\
29	smbd_doorsvc.o		\
30	smbd_join.o		\
31	smbd_logon.o		\
32	smbd_main.o		\
33	smbd_nicmon.o		\
34	smbd_opipe_doorsvc.o	\
35	smbd_share_doorsvc.o	\
36	smbd_spool.o		\
37	smbd_vss.o		\
38
39
40OBJS_LOCAL =			\
41	fksmbd_door.o		\
42	fksmbd_kmod.o		\
43	fksmbd_ksock.o		\
44	fksmbd_opipe.o		\
45	fksmbd_log.o		\
46	fksmbd_shr.o
47
48OBJS=	${OBJS_SMBD} ${OBJS_LOCAL}
49SRCS=	${OBJS_SMBD:%.o=../smbd/%.c} \
50	${OBJS_LOCAL:.o=.c}
51
52include ../../Makefile.cmd
53include ../../Makefile.ctf
54
55# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
56CPPFLAGS.first += -I../../../lib/smbsrv/libfksmbsrv/common
57
58INCS += -I../smbd
59INCS +=	-I../../../uts/common
60INCS +=	-I../../../uts/common/smbsrv
61INCS +=	-I../../../common/smbsrv
62
63C99MODE=	-xc99=%all
64C99LMODE=	-Xc99=%all
65
66CFLAGS += $(CCVERBOSE)
67CFLAGS64 += $(CCVERBOSE)
68CPPFLAGS += -D_REENTRANT
69CPPFLAGS += -Dsyslog=smb_syslog
70CPPFLAGS += -D_LARGEFILE64_SOURCE=1
71CPPFLAGS += -DFKSMBD
72# Always debug here
73CPPFLAGS += -DDEBUG
74CPPFLAGS += $(INCS)
75
76LDFLAGS += $(ZNOLAZYLOAD)
77LDFLAGS += -R/usr/lib/smbsrv
78LDLIBS += -L$(ROOT)/usr/lib/smbsrv
79LDLIBS += -lfksmbsrv -lfakekernel
80LDLIBS += -lmlsvc -lmlrpc -lsmbns -lsmb
81LDLIBS += -lzfs -lcmdutils -lbsm -lsocket -lnsl -lscf -lumem
82
83LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
84LINTFLAGS += -xerroff=E_INCONS_ARG_DECL2
85LINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2
86
87ROOTSMBDDIR = $(ROOTLIB)/smbsrv
88ROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%)
89
90.KEEP_STATE:
91
92all: $(PROG)
93
94$(PROG): $(OBJS)
95	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
96	$(POST_PROCESS)
97
98clean:
99	-$(RM) $(OBJS)
100
101lint:	lint_SRCS
102
103include ../../Makefile.targ
104
105install: all $(ROOTSMBDFILE)
106
107%.o: ../smbd/%.c
108	$(COMPILE.c) $<
109	$(POST_PROCESS_O)
110
111$(ROOTSMBDDIR)/%: %
112	$(INS.file)
113