b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# CDDL HEADER START
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# The contents of this file are subject to the terms of the
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# Common Development and Distribution License (the "License").
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# You may not use this file except in compliance with the License.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# or http://www.opensolaris.org/os/licensing.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# See the License for the specific language governing permissions
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# and limitations under the License.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# When distributing Covered Code, include this CDDL HEADER in each
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# If applicable, add the following below this CDDL HEADER, with the
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# fields enclosed by brackets "[]" replaced with your own identifying
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# information: Portions Copyright [yyyy] [name of copyright owner]
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# CDDL HEADER END
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# Copyright 2014 Nexenta Systems, Inc. All rights reserved.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossPROG= fksmbd
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossOBJS_SMBD= \
12b65585e720714b31036daaa2b30eb76014048eGordon Ross smbd_authsvc.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross smbd_doorsvc.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross smbd_join.o \
b3700b074e637f8c6991b70754c88a2cfffb246bGordon Ross smbd_krb5lookup.o \
12b65585e720714b31036daaa2b30eb76014048eGordon Ross smbd_krb5ssp.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross smbd_logon.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross smbd_main.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross smbd_nicmon.o \
12b65585e720714b31036daaa2b30eb76014048eGordon Ross smbd_ntlmssp.o \
68b2bbf26c7040fea4281dcb58b81e7627e46f34Gordon Ross smbd_pipesvc.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross smbd_share_doorsvc.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross smbd_spool.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross smbd_vss.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossOBJS_LOCAL = \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross fksmbd_door.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross fksmbd_kmod.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross fksmbd_ksock.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross fksmbd_log.o \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross fksmbd_shr.o
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossOBJS= ${OBJS_SMBD} ${OBJS_LOCAL}
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossSRCS= ${OBJS_SMBD:%.o=../smbd/%.c} \
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross ${OBJS_LOCAL:.o=.c}
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossinclude ../../Makefile.cmd
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossinclude ../../Makefile.ctf
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCPPFLAGS.first += -I../../../lib/smbsrv/libfksmbsrv/common
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossINCS += -I../smbd
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossINCS += -I../../../uts/common
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossINCS += -I../../../uts/common/smbsrv
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossINCS += -I../../../common/smbsrv
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
12b65585e720714b31036daaa2b30eb76014048eGordon Ross# Should not have to do this, but the Kerberos includes are a mess.
12b65585e720714b31036daaa2b30eb76014048eGordon RossINCS += -I $(ROOT)/usr/include/kerberosv5
12b65585e720714b31036daaa2b30eb76014048eGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossC99MODE= -xc99=%all
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossC99LMODE= -Xc99=%all
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCFLAGS += $(CCVERBOSE)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCFLAGS64 += $(CCVERBOSE)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCPPFLAGS += -D_REENTRANT
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCPPFLAGS += -Dsyslog=smb_syslog
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCPPFLAGS += -D_LARGEFILE64_SOURCE=1
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCPPFLAGS += -DFKSMBD
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross# Always debug here
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCPPFLAGS += -DDEBUG
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossCPPFLAGS += $(INCS)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossLDFLAGS += $(ZNOLAZYLOAD)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossLDFLAGS += -R/usr/lib/smbsrv
12b65585e720714b31036daaa2b30eb76014048eGordon RossLDLIBS += -L$(ROOT)/usr/lib/smbsrv
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossLDLIBS += -lfksmbsrv -lfakekernel
12b65585e720714b31036daaa2b30eb76014048eGordon Ross# prefer to keep libs ordered by dependence
12b65585e720714b31036daaa2b30eb76014048eGordon RossLDLIBS += -lmlsvc -lmlrpc -lsmbns -lsmb -lsmbfs -lgss
12b65585e720714b31036daaa2b30eb76014048eGordon RossLDLIBS += -lzfs -lbsm -lscf -lcmdutils -lsocket -lnsl -lumem
12b65585e720714b31036daaa2b30eb76014048eGordon Ross$(PROG) := LDLIBS += -lkrb5
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossLINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
12b65585e720714b31036daaa2b30eb76014048eGordon RossLINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossLINTFLAGS += -xerroff=E_INCONS_ARG_DECL2
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossLINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossROOTSMBDDIR = $(ROOTLIB)/smbsrv
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon RossROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross.KEEP_STATE:
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossall: $(PROG)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross$(PROG): $(OBJS)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross $(POST_PROCESS)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossclean:
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross -$(RM) $(OBJS)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rosslint: lint_SRCS
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossinclude ../../Makefile.targ
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossinstall: all $(ROOTSMBDFILE)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross%.o: ../smbd/%.c
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross $(COMPILE.c) $<
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross $(POST_PROCESS_O)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross$(ROOTSMBDDIR)/%: %
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross $(INS.file)