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 #
  23 # Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  24 # Copyright 2015 RackTop Systems.
  25 #
  26 
  27 FSTYPE=         autofs
  28 AUTO=           automount
  29 MOUNT=          mount
  30 VERS=           .2
  31 DFSHARES=       dfshares
  32 SHARE=          share
  33 UNSHARE=        unshare
  34 LIBPROG=        $(AUTO) $(MOUNT) $(DFSHARES) $(SHARE) $(UNSHARE)
  35 TYPEPROG=       automountd
  36 
  37 LINKINSTALL=    $(ROOTUSRSBIN)/$(AUTO)
  38 LINKVALUE=      ../lib/fs/$(FSTYPE)/$(AUTO)
  39 MAPS=           auto_master auto_home
  40 MAPINSTALL=     $(MAPS:%=$(ROOTETC)/%)
  41 AUTOFS=         autofs
  42 DEFAULTFILES=   autofs.dfl
  43 SMFMANIFEST=    autofs.xml
  44 SMFMETHOD=      svc-autofs
  45 MFSTINSTALL=    $(SMFMANIFEST:%=$(ROOTSVCSYSTEM)/filesystem/%)
  46 METHODINSTALL=  $(SMFMETHOD:%=$(ROOTLIBSVCMETHOD)/%)
  47 
  48 OTHERINSTALL=   $(MAPINSTALL) $(LINKINSTALL) $(ROOTETCDEFAULTFILES) \
  49                 $(MFSTINSTALL) $(METHODINSTALL)
  50 
  51 UNCHECKED_HDRS= webnfs.h
  52 
  53 MANIFEST=       autofs.xml
  54 SVCMETHOD=      svc-autofs
  55 
  56 include         ../Makefile.fstype
  57 
  58 $(MAPINSTALL)   := FILEMODE= 0644
  59 
  60 $(MFSTINSTALL)  := FILEMODE = 0444
  61 
  62 REAL_COMMON=    debug_alloc.o
  63 COMMON=         ns_generic.o ns_files.o ns_nis.o \
  64                 ns_ldap.o auto_mnttab.o auto_subr.o $(REAL_COMMON)
  65 
  66 AUTOOBJS=       automount.o $(COMMON) $(FSLIB) smfcfg.o
  67 
  68 MOUNTOBJS=      mount.o $(FSLIB) $(REAL_COMMON)
  69 
  70 LOCAL=          autod_main.o \
  71                 autod_parse.o autod_mount.o autod_nfs.o nfs_cast.o \
  72                 autod_autofs.o autod_xdr.o autod_readdir.o autod_lookup.o \
  73                 smfcfg.o
  74 
  75 TYPEOBJS=       $(LOCAL) $(COMMON) replica.o nfs_sec.o nfs_resolve.o nfs_subr.o \
  76                 $(FSLIB) webnfs_xdr.o webnfs_client.o selfcheck.o
  77 
  78 SHAREOBJS=      $(SHARESRCS:%.c=%.o)
  79 
  80 UNSHAREOBJS=    $(UNSHARESRCS:%.c=%.o)
  81 
  82 POFILE= autofs.po
  83 GREP= egrep
  84 SED= sed
  85 
  86 $(AUTO) :=      LDLIBS += -lnsl -lsldap -lscf
  87 $(MOUNT):=      LDLIBS += -lscf
  88 $(TYPEPROG) :=  LDLIBS += -lrpcsvc -lsocket -lnsl -lsldap -lkstat -lscf
  89 
  90 CFLAGS +=       $(CCVERBOSE) -D_FILE_OFFSET_BITS=64
  91 CPPFLAGS=       -I. -I.. -I../nfs/lib $(CPPFLAGS.master) -D_REENTRANT  \
  92                         $(MALLOC_DEBUG)
  93 
  94 CERRWARN +=     -_gcc=-Wno-parentheses
  95 CERRWARN +=     -_gcc=-Wno-unused-variable
  96 CERRWARN +=     -_gcc=-Wno-switch
  97 CERRWARN +=     -_gcc=-Wno-uninitialized
  98 CERRWARN +=     -_gcc=-Wno-unused-label
  99 CERRWARN +=     -_gcc=-Wno-unused-function
 100 
 101 OBJS=           $(AUTOOBJS) $(MOUNTOBJS) $(TYPEOBJS) \
 102                 $(SHAREOBJS) $(UNSHAREOBJS)
 103 
 104 AUTOSRCS=       automount.c $(COMMON:%.o=%.c) $(FSLIBSRC)
 105 MOUNTSRCS=      mount.c $(FSLIBSRC)
 106 TYPESRCS=       $(LOCAL:%.o=%.c) $(COMMON:%.o=%.c) \
 107                 ../nfs/lib/replica.c ../nfs/lib/nfs_sec.c \
 108                 ../nfs/lib/nfs_subr.c $(FSLIBSRC) ../nfs/lib/selfcheck.c \
 109                 ../nfs/lib/nfs_resolve.c ../nfs/lib/smfcfg.c
 110 SHARESRCS=      $(SHARE:%=%.c)
 111 UNSHARESRCS=    $(UNSHARE:%=%.c)
 112 DFSHARESSRCS=   $(DFSHARES:%=%.sh)
 113 SRCS=           $(OBJS:%.o=%.c)
 114 
 115 nfs_sec.o :=    CPPFLAGS += -DWNFS_SEC_NEGO
 116 
 117 $(AUTO):        $(AUTOOBJS)
 118                 $(LINK.c) -o $@ $(AUTOOBJS) $(LDLIBS)
 119                 $(POST_PROCESS)
 120 
 121 $(MOUNT):       $(MOUNTOBJS)
 122                 $(LINK.c) -o $@ $(MOUNTOBJS) $(LDLIBS)
 123                 $(POST_PROCESS)
 124 
 125 $(TYPEPROG):    webnfs.h $(TYPEOBJS)
 126                 $(LINK.c) -o $@ $(TYPEOBJS) $(LDLIBS)
 127                 $(POST_PROCESS)
 128 
 129 $(SHARE):       $(SHAREOBJS)
 130                 $(LINK.c) -o $@ $(SHAREOBJS) $(LDLIBS)
 131                 $(POST_PROCESS)
 132 
 133 $(UNSHARE):     $(UNSHAREOBJS)
 134                 $(LINK.c) -o $@ $(UNSHAREOBJS) $(LDLIBS)
 135                 $(POST_PROCESS)
 136 
 137 $(ROOTSVCSYSTEM)/filesystem/%: %
 138                 $(INS.file)
 139 
 140 DUMP_PROG=malloc_dump
 141 BUILDDIR=tmp
 142 DUMP_PROTO=$(BUILDDIR)/$(DUMP_PROG)_client
 143 XFILE=$(BUILDDIR)/malloc_dump.x
 144 XLINE= "program DUMP { version VERS \
 145         { void DUMP_IT(void) = 1000000; } = 2; } = 100099;"
 146 
 147 $(XFILE):       $(BUILDDIR)
 148                 $(RM) $(XFILE)
 149                 echo $(XLINE) > $(XFILE)
 150 
 151 $(BUILDDIR):
 152                 $(RM) -r $(BUILDDIR)
 153                 mkdir $(BUILDDIR)
 154 
 155 $(DUMP_PROTO):  $(BUILDDIR) $(XFILE)
 156                 cd $(BUILDDIR); $(RM) *.[ch] makefile.malloc_dump ; rpcgen -a `basename $(XFILE)
 157                 cd $(BUILDDIR); $(MAKE) -f makefile.malloc_dump `basename $@`
 158 
 159 $(DUMP_PROG):   $(DUMP_PROTO)
 160                 $(RM) $@
 161                 cp $(DUMP_PROTO) $@
 162 
 163 clean_dump:
 164                 $(RM) -r $(BUILDDIR)
 165                 $(RM) $(DUMP_PROG)
 166 $(ROOTUSRSBIN)/$(AUTO):
 167                 $(RM) $@; $(SYMLINK) $(LINKVALUE) $@
 168 
 169 replica.o:      ../nfs/lib/replica.c
 170                 $(COMPILE.c) ../nfs/lib/replica.c
 171 
 172 nfs_sec.o:      ../nfs/lib/nfs_sec.c
 173                 $(COMPILE.c) ../nfs/lib/nfs_sec.c
 174 
 175 nfs_subr.o:     ../nfs/lib/nfs_subr.c
 176                 $(COMPILE.c) ../nfs/lib/nfs_subr.c
 177 
 178 selfcheck.o:    ../nfs/lib/selfcheck.c
 179                 $(COMPILE.c) ../nfs/lib/selfcheck.c
 180 
 181 smfcfg.o: ../nfs/lib/smfcfg.c
 182                 $(COMPILE.c) ../nfs/lib/smfcfg.c
 183 
 184 nfs_resolve.o:  ../nfs/lib/nfs_resolve.c
 185                 $(COMPILE.c) ../nfs/lib/nfs_resolve.c
 186 
 187 webnfs_xdr.c:   webnfs.x
 188         $(RPCGEN) -M -C -c -o $@ webnfs.x
 189 
 190 webnfs_client.c:        webnfs.x
 191         $(RPCGEN) -M -C -l -o $@ webnfs.x
 192 
 193 webnfs.h:       webnfs.x
 194         $(RPCGEN) -M -C -h -o $@ webnfs.x
 195 
 196 webnfs.x:       ../nfs/lib/webnfs.x
 197         $(RM) webnfs.x
 198         cp ../nfs/lib/webnfs.x .
 199 
 200 catalog: $(POFILE)
 201 
 202 $(POFILE):
 203         $(RM) messages.po
 204         $(SED) -e 's/pr_msg/gettext/' `$(GREP) -l "pr_msg|gettext" *.[ch]` | \
 205         $(XGETTEXT) $(XGETFLAGS) -
 206         $(SED) -e '/^# msg/d' -e '/^domain/d' < messages.po > $@
 207         $(RM) messages.po
 208 
 209 lint:
 210         $(LINT.c) $(AUTOSRCS)
 211         $(LINT.c) $(MOUNTSRCS)
 212         $(LINT.c) $(TYPESRCS)
 213 
 214 clean:  clean_dump
 215         $(RM) $(OBJS) webnfs_xdr.c webnfs_client.c webnfs.h webnfs.x
 216 
 217 check:  $(CHKMANIFEST)