Home | History | Annotate | Download | only in autofs
      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 2008 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 # cmd/fs.d/autofs/Makefile
     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)	:= OWNER= root
     59 $(MAPINSTALL)	:= FILEMODE= 0644
     60 
     61 $(MFSTINSTALL)	:= FILEMODE = 0444
     62 
     63 REAL_COMMON=	debug_alloc.o
     64 COMMON=		ns_generic.o ns_files.o ns_nisplus.o ns_nis.o \
     65 		ns_ldap.o auto_mnttab.o auto_subr.o $(REAL_COMMON)
     66 
     67 AUTOOBJS=	automount.o $(COMMON) $(FSLIB)
     68 
     69 MOUNTOBJS=	mount.o $(FSLIB) $(REAL_COMMON)
     70 
     71 LOCAL=		autod_main.o \
     72 		autod_parse.o autod_mount.o autod_nfs.o nfs_cast.o \
     73 		autod_autofs.o autod_xdr.o autod_readdir.o autod_lookup.o
     74 
     75 TYPEOBJS=	$(LOCAL) $(COMMON) replica.o nfs_sec.o nfs_subr.o $(FSLIB) \
     76 		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  -ldoor
     87 $(MOUNT):=	LDLIBS += -lnsl
     88 $(TYPEPROG) :=	LDLIBS += -lrpcsvc -lsocket -lnsl -lsldap -lkstat -ldoor
     89 
     90 CFLAGS +=	$(CCVERBOSE) -D_FILE_OFFSET_BITS=64
     91 CPPFLAGS=	-I. -I.. -I../nfs/lib $(CPPFLAGS.master) -D_REENTRANT \
     92 			$(MALLOC_DEBUG)
     93 OBJS=		$(AUTOOBJS) $(MOUNTOBJS) $(TYPEOBJS) \
     94 		$(SHAREOBJS) $(UNSHAREOBJS)
     95 
     96 AUTOSRCS=	automount.c $(COMMON:%.o=%.c) $(FSLIBSRC)
     97 MOUNTSRCS=	mount.c $(FSLIBSRC)
     98 TYPESRCS=	$(LOCAL:%.o=%.c) $(COMMON:%.o=%.c) \
     99 		../nfs/lib/replica.c ../nfs/lib/nfs_sec.c \
    100 		../nfs/lib/nfs_subr.c $(FSLIBSRC) ../nfs/lib/selfcheck.c
    101 SHARESRCS=	$(SHARE:%=%.c)
    102 UNSHARESRCS=	$(UNSHARE:%=%.c)
    103 DFSHARESSRCS=	$(DFSHARES:%=%.sh)
    104 SRCS=		$(OBJS:%.o=%.c)
    105 
    106 nfs_sec.o :=	CPPFLAGS += -DWNFS_SEC_NEGO
    107 
    108 $(AUTO):	$(AUTOOBJS)
    109 		$(LINK.c) -o $@ $(AUTOOBJS) $(LDLIBS)
    110 		$(POST_PROCESS)
    111 
    112 $(MOUNT):	$(MOUNTOBJS)
    113 		$(LINK.c) -o $@ $(MOUNTOBJS) $(LDLIBS)
    114 		$(POST_PROCESS)
    115 
    116 $(TYPEPROG):	webnfs.h $(TYPEOBJS)
    117 		$(LINK.c) -o $@ $(TYPEOBJS) $(LDLIBS)
    118 		$(POST_PROCESS)
    119 
    120 $(SHARE):	$(SHAREOBJS)
    121 		$(LINK.c) -o $@ $(SHAREOBJS)
    122 		$(POST_PROCESS)
    123 
    124 $(UNSHARE):	$(UNSHAREOBJS)
    125 		$(LINK.c) -o $@ $(UNSHAREOBJS)
    126 		$(POST_PROCESS)
    127 
    128 $(ROOTSVCSYSTEM)/filesystem/%: %
    129 		$(INS.file)
    130 
    131 DUMP_PROG=malloc_dump
    132 BUILDDIR=tmp
    133 DUMP_PROTO=$(BUILDDIR)/$(DUMP_PROG)_client
    134 XFILE=$(BUILDDIR)/malloc_dump.x
    135 XLINE= "program DUMP { version VERS \
    136 	{ void DUMP_IT(void) = 1000000; } = 2; } = 100099;"
    137 
    138 $(XFILE):	$(BUILDDIR)
    139 		$(RM) $(XFILE)
    140 		echo $(XLINE) > $(XFILE)
    141 
    142 $(BUILDDIR):
    143 		$(RM) -r $(BUILDDIR)
    144 		mkdir $(BUILDDIR)
    145 
    146 $(DUMP_PROTO):	$(BUILDDIR) $(XFILE)
    147 		cd $(BUILDDIR); $(RM) *.[ch] makefile.malloc_dump ; rpcgen -a `basename $(XFILE)
    148 		cd $(BUILDDIR); $(MAKE) -f makefile.malloc_dump `basename $@`
    149 
    150 $(DUMP_PROG):	$(DUMP_PROTO)
    151 		$(RM) $@
    152 		cp $(DUMP_PROTO) $@
    153 
    154 clean_dump:
    155 		$(RM) -r $(BUILDDIR)
    156 		$(RM) $(DUMP_PROG)
    157 $(ROOTUSRSBIN)/$(AUTO):
    158 		$(RM) $@; $(SYMLINK) $(LINKVALUE) $@
    159 
    160 replica.o:	../nfs/lib/replica.c
    161 		$(COMPILE.c) ../nfs/lib/replica.c
    162 
    163 nfs_sec.o:	../nfs/lib/nfs_sec.c
    164 		$(COMPILE.c) ../nfs/lib/nfs_sec.c
    165 
    166 nfs_subr.o:	../nfs/lib/nfs_subr.c
    167 		$(COMPILE.c) ../nfs/lib/nfs_subr.c
    168 
    169 selfcheck.o:	../nfs/lib/selfcheck.c
    170 		$(COMPILE.c) ../nfs/lib/selfcheck.c
    171 
    172 
    173 webnfs_xdr.c:	webnfs.x
    174 	$(RPCGEN) -M -C -c -o $@ webnfs.x
    175 
    176 webnfs_client.c:	webnfs.x
    177 	$(RPCGEN) -M -C -l -o $@ webnfs.x
    178 
    179 webnfs.h:	webnfs.x
    180 	$(RPCGEN) -M -C -h -o $@ webnfs.x
    181 
    182 webnfs.x:	../nfs/lib/webnfs.x
    183 	$(RM) webnfs.x
    184 	cp ../nfs/lib/webnfs.x .
    185 
    186 catalog: $(POFILE)
    187 
    188 $(POFILE):
    189 	$(RM) messages.po
    190 	$(SED) -e 's/pr_msg/gettext/' `$(GREP) -l "pr_msg|gettext" *.[ch]` | \
    191 	$(XGETTEXT) $(XGETFLAGS) -
    192 	$(SED) -e '/^# msg/d' -e '/^domain/d' < messages.po > $@
    193 	$(RM) messages.po
    194 
    195 lint:
    196 	$(LINT.c) $(AUTOSRCS)
    197 	$(LINT.c) $(MOUNTSRCS)
    198 	$(LINT.c) $(TYPESRCS)
    199 
    200 clean:	clean_dump
    201 	$(RM) $(OBJS) webnfs_xdr.c webnfs_client.c webnfs.h webnfs.x
    202 
    203 check:	$(CHKMANIFEST)
    204