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