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