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 # Copyright (c) 2018, Joyent, Inc.
  25 #
  26 
  27 
  28 PROG=   smbd
  29 OBJS=                           \
  30         smbd_authsvc.o          \
  31         smbd_doorsvc.o          \
  32         smbd_join.o             \
  33         smbd_krb5lookup.o       \
  34         smbd_krb5ssp.o          \
  35         smbd_logon.o            \
  36         smbd_main.o             \
  37         smbd_nicmon.o           \
  38         smbd_ntlmssp.o          \
  39         smbd_pipesvc.o          \
  40         smbd_share_doorsvc.o    \
  41         smbd_spool.o            \
  42         smbd_syslog.o           \
  43         smbd_vss.o
  44 
  45 SRCS=   $(OBJS:%.o=%.c)
  46 
  47 include ../../Makefile.cmd
  48 
  49 MANIFEST=       server.xml
  50 SVCMETHOD=      svc-smbd
  51 LOGDLL=         eventlog.dll
  52 
  53 ROOTMANIFESTDIR = $(ROOTSVCSMB)
  54 ROOTVARSMBDLLDIR = $(ROOTVARSMB)/cvol/windows/system32
  55 ROOTVARSMBDLL= $(LOGDLL:%=$(ROOTVARSMBDLLDIR)/%)
  56 
  57 $(ROOTMANIFEST):= FILEMODE = 0444
  58 $(ROOTSVCMETHOD):= FILEMODE = 0555
  59 $(ROOTVARSMBDLL):= FILEMODE = 0755
  60 
  61 LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
  62 LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
  63 
  64 CFLAGS += $(CCVERBOSE)
  65 CPPFLAGS += -D_IPP_PRIVATE_STRUCTURES
  66 CPPFLAGS += -D_REENTRANT
  67 CPPFLAGS += -Dsyslog=smb_syslog
  68 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
  69 
  70 # Should not have to do this, but the Kerberos includes are a mess.
  71 CPPFLAGS += -I $(ROOT)/usr/include/kerberosv5
  72 
  73 # needs work
  74 SMOFF += all_func_returns,deref_check
  75 
  76 CSTD =       $(CSTD_GNU99)
  77 C99LMODE =      -Xc99=%all
  78 
  79 LDFLAGS += -R/usr/lib/smbsrv
  80 LDLIBS += -L$(ROOT)/usr/lib/smbsrv
  81 # prefer to keep libs ordered by dependence
  82 LDLIBS += -lmlsvc -lmlrpc -lsmbns -lsmb -lsmbfs -lgss
  83 LDLIBS += -lzfs -lbsm -lscf -lcmdutils -lsocket -lnsl -lumem
  84 $(PROG) := LDLIBS += -lkrb5
  85 
  86 $(ENABLE_SMB_PRINTING) CPPFLAGS += -DHAVE_CUPS
  87 
  88 ROOTSMBDDIR = $(ROOTLIB)/smbsrv
  89 ROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%)
  90 
  91 FILEMODE = 0444
  92 $(ROOTSMBDFILE):= FILEMODE = 0555
  93 
  94 $(ROOTSMBDDIR)/%: %
  95         $(INS.file)
  96 
  97 $(ROOTVARSMBDLLDIR)/%: %
  98         $(INS.file)
  99 
 100 all:            $(PROG)
 101 
 102 clean:
 103         $(RM) $(OBJS)
 104 
 105 lint:           lint_SRCS
 106 
 107 $(PROG):        $(OBJS)
 108         $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
 109         $(POST_PROCESS)
 110 
 111 check:          $(CHKMANIFEST)
 112 
 113 _msg:
 114 
 115 include ../../Makefile.targ
 116 
 117 install: all .WAIT $(ROOTETCDEFAULTFILES) $(ROOTMANIFEST) \
 118                 $(ROOTSMBDFILE) ${ROOTSVCMETHOD} $(ROOTVARSMBDLL)
 119 
 120 .KEEP_STATE: