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, Version 1.0 only 6# (the "License"). You may not use this file except in compliance 7# with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22# 23# Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28# cmd/fs.d/autofs/Makefile 29 30FSTYPE= autofs 31AUTO= automount 32MOUNT= mount 33VERS= .2 34DFSHARES= dfshares 35SHARE= share 36UNSHARE= unshare 37LIBPROG= $(AUTO) $(MOUNT) $(DFSHARES) $(SHARE) $(UNSHARE) 38TYPEPROG= automountd 39 40LINKINSTALL= $(ROOTUSRSBIN)/$(AUTO) 41LINKVALUE= ../lib/fs/$(FSTYPE)/$(AUTO) 42MAPS= auto_master auto_home 43MAPINSTALL= $(MAPS:%=$(ROOTETC)/%) 44AUTOFS= autofs 45AUTOFSINSTALL= $(AUTOFS:%=$(ROOTETC)/default/%) 46SMFMANIFEST= autofs.xml 47SMFMETHOD= svc-autofs 48MFSTINSTALL= $(SMFMANIFEST:%=$(ROOTSVCSYSTEM)/filesystem/%) 49METHODINSTALL= $(SMFMETHOD:%=$(ROOTLIBSVCMETHOD)/%) 50 51OTHERINSTALL= $(MAPINSTALL) $(LINKINSTALL) $(AUTOFSINSTALL) \ 52 $(MFSTINSTALL) $(METHODINSTALL) 53 54UNCHECKED_HDRS= webnfs.h 55 56MANIFEST= autofs.xml 57SVCMETHOD= svc-autofs 58 59include ../Makefile.fstype 60 61$(MAPINSTALL) := OWNER= root 62$(MAPINSTALL) := FILEMODE= 0644 63 64$(AUTOFSINSTALL) := OWNER= root 65$(AUTOFSINSTALL) := FILEMODE= 0444 66$(AUTOFSINSTALL) := GROUP= sys 67 68$(MFSTINSTALL) := FILEMODE = 0444 69 70REAL_COMMON= debug_alloc.o 71COMMON= ns_generic.o ns_files.o ns_nisplus.o ns_nis.o \ 72 ns_ldap.o auto_mnttab.o auto_subr.o $(REAL_COMMON) 73 74AUTOOBJS= automount.o $(COMMON) $(FSLIB) 75 76MOUNTOBJS= mount.o $(FSLIB) $(REAL_COMMON) 77 78LOCAL= autod_main.o key_generic.o \ 79 autod_parse.o autod_mount.o autod_nfs.o nfs_cast.o \ 80 autod_autofs.o autod_xdr.o autod_readdir.o autod_lookup.o 81 82TYPEOBJS= $(LOCAL) $(COMMON) replica.o nfs_sec.o nfs_subr.o $(FSLIB) \ 83 webnfs_xdr.o webnfs_client.o selfcheck.o 84 85SHAREOBJS= $(SHARESRCS:%.c=%.o) 86 87UNSHAREOBJS= $(UNSHARESRCS:%.c=%.o) 88 89POFILE= autofs.po 90GREP= egrep 91SED= sed 92 93$(AUTO) := LDLIBS += -lnsl -lsldap -lcmd 94$(MOUNT):= LDLIBS += -lnsl 95$(TYPEPROG) := LDLIBS += -lrpcsvc -lsocket -lnsl -lsldap -lcmd \ 96 -lkstat 97$(TYPEPROG) := LDFLAGS += -R/usr/lib/fs/$(FSTYPE) 98 99CFLAGS += $(CCVERBOSE) -D_FILE_OFFSET_BITS=64 -o $@ 100CPPFLAGS= -I. -I.. -I../nfs/lib $(CPPFLAGS.master) -D_REENTRANT \ 101 $(MALLOC_DEBUG) 102OBJS= $(AUTOOBJS) $(MOUNTOBJS) $(TYPEOBJS) \ 103 $(SHAREOBJS) $(UNSHAREOBJS) 104 105AUTOSRCS= automount.c $(COMMON:%.o=%.c) $(FSLIBSRC) 106MOUNTSRCS= mount.c $(FSLIBSRC) 107TYPESRCS= $(LOCAL:%.o=%.c) $(COMMON:%.o=%.c) \ 108 ../nfs/lib/replica.c ../nfs/lib/nfs_sec.c \ 109 ../nfs/lib/nfs_subr.c $(FSLIBSRC) ../nfs/lib/selfcheck.c 110SHARESRCS= $(SHARE:%=%.c) 111UNSHARESRCS= $(UNSHARE:%=%.c) 112DFSHARESSRCS= $(DFSHARES:%=%.sh) 113SRCS= $(OBJS:%.o=%.c) 114 115nfs_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) 131 $(POST_PROCESS) 132 133$(UNSHARE): $(UNSHAREOBJS) 134 $(LINK.c) -o $@ $(UNSHAREOBJS) 135 $(POST_PROCESS) 136 137$(ROOTETC)/default/%:% 138 $(INS.file) 139 140$(ROOTSVCSYSTEM)/filesystem/%: % 141 $(INS.file) 142 143DUMP_PROG=malloc_dump 144BUILDDIR=tmp 145DUMP_PROTO=$(BUILDDIR)/$(DUMP_PROG)_client 146XFILE=$(BUILDDIR)/malloc_dump.x 147XLINE= "program DUMP { version VERS \ 148 { void DUMP_IT(void) = 1000000; } = 2; } = 100099;" 149 150$(XFILE): $(BUILDDIR) 151 $(RM) $(XFILE) 152 echo $(XLINE) > $(XFILE) 153 154$(BUILDDIR): 155 $(RM) -r $(BUILDDIR) 156 mkdir $(BUILDDIR) 157 158$(DUMP_PROTO): $(BUILDDIR) $(XFILE) 159 cd $(BUILDDIR); $(RM) *.[ch] makefile.malloc_dump ; rpcgen -a `basename $(XFILE) 160 cd $(BUILDDIR); $(MAKE) -f makefile.malloc_dump `basename $@` 161 162$(DUMP_PROG): $(DUMP_PROTO) 163 $(RM) $@ 164 cp $(DUMP_PROTO) $@ 165 166clean_dump: 167 $(RM) -r $(BUILDDIR) 168 $(RM) $(DUMP_PROG) 169$(ROOTUSRSBIN)/$(AUTO): 170 $(RM) $@; $(SYMLINK) $(LINKVALUE) $@ 171 172replica.o: ../nfs/lib/replica.c 173 $(COMPILE.c) ../nfs/lib/replica.c 174 175nfs_sec.o: ../nfs/lib/nfs_sec.c 176 $(COMPILE.c) ../nfs/lib/nfs_sec.c 177 178nfs_subr.o: ../nfs/lib/nfs_subr.c 179 $(COMPILE.c) ../nfs/lib/nfs_subr.c 180 181selfcheck.o: ../nfs/lib/selfcheck.c 182 $(COMPILE.c) ../nfs/lib/selfcheck.c 183 184 185webnfs_xdr.c: webnfs.x 186 $(RPCGEN) -C -c -o $@ webnfs.x 187 188webnfs_client.c: webnfs.x 189 $(RPCGEN) -C -l -o $@ webnfs.x 190 191webnfs.h: webnfs.x 192 $(RPCGEN) -C -h -o $@ webnfs.x 193 194webnfs.x: ../nfs/lib/webnfs.x 195 $(RM) webnfs.x 196 cp ../nfs/lib/webnfs.x . 197 198catalog: $(POFILE) 199 200$(POFILE): 201 $(RM) messages.po 202 $(SED) -e 's/pr_msg/gettext/' `$(GREP) -l "pr_msg|gettext" *.[ch]` | \ 203 $(XGETTEXT) $(XGETFLAGS) - 204 $(SED) -e '/^# msg/d' -e '/^domain/d' < messages.po > $@ 205 $(RM) messages.po 206 207lint: 208 $(LINT.c) $(AUTOSRCS) 209 $(LINT.c) $(MOUNTSRCS) 210 $(LINT.c) $(TYPESRCS) 211 212clean: clean_dump 213 $(RM) $(OBJS) webnfs_xdr.c webnfs_client.c webnfs.h webnfs.x 214 215check: $(CHKMANIFEST) 216