1b819cea2SGordon Ross# 2b819cea2SGordon Ross# CDDL HEADER START 3b819cea2SGordon Ross# 4b819cea2SGordon Ross# The contents of this file are subject to the terms of the 5b819cea2SGordon Ross# Common Development and Distribution License (the "License"). 6b819cea2SGordon Ross# You may not use this file except in compliance with the License. 7b819cea2SGordon Ross# 8b819cea2SGordon Ross# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9b819cea2SGordon Ross# or http://www.opensolaris.org/os/licensing. 10b819cea2SGordon Ross# See the License for the specific language governing permissions 11b819cea2SGordon Ross# and limitations under the License. 12b819cea2SGordon Ross# 13b819cea2SGordon Ross# When distributing Covered Code, include this CDDL HEADER in each 14b819cea2SGordon Ross# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15b819cea2SGordon Ross# If applicable, add the following below this CDDL HEADER, with the 16b819cea2SGordon Ross# fields enclosed by brackets "[]" replaced with your own identifying 17b819cea2SGordon Ross# information: Portions Copyright [yyyy] [name of copyright owner] 18b819cea2SGordon Ross# 19b819cea2SGordon Ross# CDDL HEADER END 20b819cea2SGordon Ross# 21b819cea2SGordon Ross# 22b819cea2SGordon Ross# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 23b819cea2SGordon Ross# Copyright 2014 Nexenta Systems, Inc. All rights reserved. 24b819cea2SGordon Ross# 25b819cea2SGordon Ross 26b819cea2SGordon Ross 27b819cea2SGordon RossPROG= fksmbd 28b819cea2SGordon RossOBJS_SMBD= \ 2912b65585SGordon Ross smbd_authsvc.o \ 30b819cea2SGordon Ross smbd_doorsvc.o \ 31b819cea2SGordon Ross smbd_join.o \ 32*b3700b07SGordon Ross smbd_krb5lookup.o \ 3312b65585SGordon Ross smbd_krb5ssp.o \ 34b819cea2SGordon Ross smbd_logon.o \ 35b819cea2SGordon Ross smbd_main.o \ 36b819cea2SGordon Ross smbd_nicmon.o \ 3712b65585SGordon Ross smbd_ntlmssp.o \ 3868b2bbf2SGordon Ross smbd_pipesvc.o \ 39b819cea2SGordon Ross smbd_share_doorsvc.o \ 40b819cea2SGordon Ross smbd_spool.o \ 41b819cea2SGordon Ross smbd_vss.o \ 42b819cea2SGordon Ross 43b819cea2SGordon Ross 44b819cea2SGordon RossOBJS_LOCAL = \ 45b819cea2SGordon Ross fksmbd_door.o \ 46b819cea2SGordon Ross fksmbd_kmod.o \ 47b819cea2SGordon Ross fksmbd_ksock.o \ 48b819cea2SGordon Ross fksmbd_log.o \ 49b819cea2SGordon Ross fksmbd_shr.o 50b819cea2SGordon Ross 51b819cea2SGordon RossOBJS= ${OBJS_SMBD} ${OBJS_LOCAL} 52b819cea2SGordon RossSRCS= ${OBJS_SMBD:%.o=../smbd/%.c} \ 53b819cea2SGordon Ross ${OBJS_LOCAL:.o=.c} 54b819cea2SGordon Ross 55b819cea2SGordon Rossinclude ../../Makefile.cmd 56b819cea2SGordon Rossinclude ../../Makefile.ctf 57b819cea2SGordon Ross 58b819cea2SGordon Ross# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc. 59b819cea2SGordon RossCPPFLAGS.first += -I../../../lib/smbsrv/libfksmbsrv/common 60b819cea2SGordon Ross 61b819cea2SGordon RossINCS += -I../smbd 62b819cea2SGordon RossINCS += -I../../../uts/common 63b819cea2SGordon RossINCS += -I../../../uts/common/smbsrv 64b819cea2SGordon RossINCS += -I../../../common/smbsrv 65b819cea2SGordon Ross 6612b65585SGordon Ross# Should not have to do this, but the Kerberos includes are a mess. 6712b65585SGordon RossINCS += -I $(ROOT)/usr/include/kerberosv5 6812b65585SGordon Ross 69b819cea2SGordon RossC99MODE= -xc99=%all 70b819cea2SGordon RossC99LMODE= -Xc99=%all 71b819cea2SGordon Ross 72b819cea2SGordon RossCFLAGS += $(CCVERBOSE) 73b819cea2SGordon RossCFLAGS64 += $(CCVERBOSE) 74b819cea2SGordon RossCPPFLAGS += -D_REENTRANT 75b819cea2SGordon RossCPPFLAGS += -Dsyslog=smb_syslog 76b819cea2SGordon RossCPPFLAGS += -D_LARGEFILE64_SOURCE=1 77b819cea2SGordon RossCPPFLAGS += -DFKSMBD 78b819cea2SGordon Ross# Always debug here 79b819cea2SGordon RossCPPFLAGS += -DDEBUG 80b819cea2SGordon RossCPPFLAGS += $(INCS) 81b819cea2SGordon Ross 82b819cea2SGordon RossLDFLAGS += $(ZNOLAZYLOAD) 83b819cea2SGordon RossLDFLAGS += -R/usr/lib/smbsrv 84b819cea2SGordon RossLDLIBS += -L$(ROOT)/usr/lib/smbsrv 85b819cea2SGordon RossLDLIBS += -lfksmbsrv -lfakekernel 8612b65585SGordon Ross# prefer to keep libs ordered by dependence 8712b65585SGordon RossLDLIBS += -lmlsvc -lmlrpc -lsmbns -lsmb -lsmbfs -lgss 8812b65585SGordon RossLDLIBS += -lzfs -lbsm -lscf -lcmdutils -lsocket -lnsl -lumem 8912b65585SGordon Ross$(PROG) := LDLIBS += -lkrb5 90b819cea2SGordon Ross 91b819cea2SGordon RossLINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 9212b65585SGordon RossLINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2 93b819cea2SGordon RossLINTFLAGS += -xerroff=E_INCONS_ARG_DECL2 94b819cea2SGordon RossLINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2 95b819cea2SGordon Ross 96b819cea2SGordon RossROOTSMBDDIR = $(ROOTLIB)/smbsrv 97b819cea2SGordon RossROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%) 98b819cea2SGordon Ross 99b819cea2SGordon Ross.KEEP_STATE: 100b819cea2SGordon Ross 101b819cea2SGordon Rossall: $(PROG) 102b819cea2SGordon Ross 103b819cea2SGordon Ross$(PROG): $(OBJS) 104b819cea2SGordon Ross $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS) 105b819cea2SGordon Ross $(POST_PROCESS) 106b819cea2SGordon Ross 107b819cea2SGordon Rossclean: 108b819cea2SGordon Ross -$(RM) $(OBJS) 109b819cea2SGordon Ross 110b819cea2SGordon Rosslint: lint_SRCS 111b819cea2SGordon Ross 112b819cea2SGordon Rossinclude ../../Makefile.targ 113b819cea2SGordon Ross 114b819cea2SGordon Rossinstall: all $(ROOTSMBDFILE) 115b819cea2SGordon Ross 116b819cea2SGordon Ross%.o: ../smbd/%.c 117b819cea2SGordon Ross $(COMPILE.c) $< 118b819cea2SGordon Ross $(POST_PROCESS_O) 119b819cea2SGordon Ross 120b819cea2SGordon Ross$(ROOTSMBDDIR)/%: % 121b819cea2SGordon Ross $(INS.file) 122