xref: /titanic_50/usr/src/cmd/fs.d/autofs/Makefile (revision d50bcaae2118610560f2b107d0d282315e47e4e4)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
539d3e169Sevanl# Common Development and Distribution License (the "License").
639d3e169Sevanl# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
21*d50bcaaeSAndrew Stormont
227c478bd9Sstevel@tonic-gate#
23*d50bcaaeSAndrew Stormont# Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24*d50bcaaeSAndrew Stormont# Copyright 2015 RackTop Systems.
25*d50bcaaeSAndrew Stormont#
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateFSTYPE=		autofs
287c478bd9Sstevel@tonic-gateAUTO=		automount
297c478bd9Sstevel@tonic-gateMOUNT=		mount
307c478bd9Sstevel@tonic-gateVERS=		.2
317c478bd9Sstevel@tonic-gateDFSHARES=	dfshares
327c478bd9Sstevel@tonic-gateSHARE=		share
337c478bd9Sstevel@tonic-gateUNSHARE=	unshare
347c478bd9Sstevel@tonic-gateLIBPROG=	$(AUTO) $(MOUNT) $(DFSHARES) $(SHARE) $(UNSHARE)
357c478bd9Sstevel@tonic-gateTYPEPROG=	automountd
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gateLINKINSTALL=	$(ROOTUSRSBIN)/$(AUTO)
387c478bd9Sstevel@tonic-gateLINKVALUE=	../lib/fs/$(FSTYPE)/$(AUTO)
397c478bd9Sstevel@tonic-gateMAPS=		auto_master auto_home
407c478bd9Sstevel@tonic-gateMAPINSTALL=	$(MAPS:%=$(ROOTETC)/%)
417c478bd9Sstevel@tonic-gateAUTOFS=		autofs
42a7872406SmeemDEFAULTFILES=	autofs.dfl
437c478bd9Sstevel@tonic-gateSMFMANIFEST=	autofs.xml
447c478bd9Sstevel@tonic-gateSMFMETHOD=	svc-autofs
457c478bd9Sstevel@tonic-gateMFSTINSTALL=	$(SMFMANIFEST:%=$(ROOTSVCSYSTEM)/filesystem/%)
467c478bd9Sstevel@tonic-gateMETHODINSTALL=	$(SMFMETHOD:%=$(ROOTLIBSVCMETHOD)/%)
477c478bd9Sstevel@tonic-gate
48a7872406SmeemOTHERINSTALL=	$(MAPINSTALL) $(LINKINSTALL) $(ROOTETCDEFAULTFILES) \
497c478bd9Sstevel@tonic-gate		$(MFSTINSTALL) $(METHODINSTALL)
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gateUNCHECKED_HDRS=	webnfs.h
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gateMANIFEST=	autofs.xml
547c478bd9Sstevel@tonic-gateSVCMETHOD=	svc-autofs
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gateinclude		../Makefile.fstype
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gate$(MAPINSTALL)	:= FILEMODE= 0644
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gate$(MFSTINSTALL)	:= FILEMODE = 0444
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gateREAL_COMMON=	debug_alloc.o
6336e852a1SRaja AndraCOMMON=		ns_generic.o ns_files.o ns_nis.o \
647c478bd9Sstevel@tonic-gate		ns_ldap.o auto_mnttab.o auto_subr.o $(REAL_COMMON)
657c478bd9Sstevel@tonic-gate
66dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United StatesAUTOOBJS=	automount.o $(COMMON) $(FSLIB) smfcfg.o
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gateMOUNTOBJS=	mount.o $(FSLIB) $(REAL_COMMON)
697c478bd9Sstevel@tonic-gate
7039d3e169SevanlLOCAL=		autod_main.o \
717c478bd9Sstevel@tonic-gate		autod_parse.o autod_mount.o autod_nfs.o nfs_cast.o \
72dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States		autod_autofs.o autod_xdr.o autod_readdir.o autod_lookup.o \
73dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States		smfcfg.o
747c478bd9Sstevel@tonic-gate
752f172c55SRobert ThurlowTYPEOBJS=	$(LOCAL) $(COMMON) replica.o nfs_sec.o nfs_resolve.o nfs_subr.o \
762f172c55SRobert Thurlow		$(FSLIB) webnfs_xdr.o webnfs_client.o selfcheck.o
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gateSHAREOBJS=	$(SHARESRCS:%.c=%.o)
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gateUNSHAREOBJS=	$(UNSHARESRCS:%.c=%.o)
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gatePOFILE= autofs.po
837c478bd9Sstevel@tonic-gateGREP= egrep
847c478bd9Sstevel@tonic-gateSED= sed
857c478bd9Sstevel@tonic-gate
86b56bf881SAntonello Cruz$(AUTO) := 	LDLIBS += -lnsl -lsldap -lscf
87b56bf881SAntonello Cruz$(MOUNT):=	LDLIBS += -lscf
88b56bf881SAntonello Cruz$(TYPEPROG) :=	LDLIBS += -lrpcsvc -lsocket -lnsl -lsldap -lkstat -lscf
897c478bd9Sstevel@tonic-gate
9011606941SjwahligCFLAGS +=	$(CCVERBOSE) -D_FILE_OFFSET_BITS=64
917c478bd9Sstevel@tonic-gateCPPFLAGS=	-I. -I.. -I../nfs/lib $(CPPFLAGS.master) -D_REENTRANT  \
927c478bd9Sstevel@tonic-gate			$(MALLOC_DEBUG)
937014882cSRichard Lowe
947014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
957014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
967014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-switch
977014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
987014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-label
997014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-function
1007014882cSRichard Lowe
1017c478bd9Sstevel@tonic-gateOBJS=		$(AUTOOBJS) $(MOUNTOBJS) $(TYPEOBJS) \
1027c478bd9Sstevel@tonic-gate		$(SHAREOBJS) $(UNSHAREOBJS)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gateAUTOSRCS=	automount.c $(COMMON:%.o=%.c) $(FSLIBSRC)
1057c478bd9Sstevel@tonic-gateMOUNTSRCS=	mount.c $(FSLIBSRC)
1067c478bd9Sstevel@tonic-gateTYPESRCS=	$(LOCAL:%.o=%.c) $(COMMON:%.o=%.c) \
1077c478bd9Sstevel@tonic-gate		../nfs/lib/replica.c ../nfs/lib/nfs_sec.c \
1082f172c55SRobert Thurlow		../nfs/lib/nfs_subr.c $(FSLIBSRC) ../nfs/lib/selfcheck.c \
109dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States		../nfs/lib/nfs_resolve.c ../nfs/lib/smfcfg.c
1107c478bd9Sstevel@tonic-gateSHARESRCS=	$(SHARE:%=%.c)
1117c478bd9Sstevel@tonic-gateUNSHARESRCS=	$(UNSHARE:%=%.c)
1127c478bd9Sstevel@tonic-gateDFSHARESSRCS=	$(DFSHARES:%=%.sh)
1137c478bd9Sstevel@tonic-gateSRCS=		$(OBJS:%.o=%.c)
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gatenfs_sec.o :=	CPPFLAGS += -DWNFS_SEC_NEGO
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gate$(AUTO):	$(AUTOOBJS)
1187c478bd9Sstevel@tonic-gate		$(LINK.c) -o $@ $(AUTOOBJS) $(LDLIBS)
1197c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1207c478bd9Sstevel@tonic-gate
1217c478bd9Sstevel@tonic-gate$(MOUNT):	$(MOUNTOBJS)
1227c478bd9Sstevel@tonic-gate		$(LINK.c) -o $@ $(MOUNTOBJS) $(LDLIBS)
1237c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1247c478bd9Sstevel@tonic-gate
1257c478bd9Sstevel@tonic-gate$(TYPEPROG):	webnfs.h $(TYPEOBJS)
1267c478bd9Sstevel@tonic-gate		$(LINK.c) -o $@ $(TYPEOBJS) $(LDLIBS)
1277c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1287c478bd9Sstevel@tonic-gate
1297c478bd9Sstevel@tonic-gate$(SHARE):	$(SHAREOBJS)
130*d50bcaaeSAndrew Stormont		$(LINK.c) -o $@ $(SHAREOBJS) $(LDLIBS)
1317c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gate$(UNSHARE):	$(UNSHAREOBJS)
134*d50bcaaeSAndrew Stormont		$(LINK.c) -o $@ $(UNSHAREOBJS) $(LDLIBS)
1357c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
1367c478bd9Sstevel@tonic-gate
1377c478bd9Sstevel@tonic-gate$(ROOTSVCSYSTEM)/filesystem/%: %
1387c478bd9Sstevel@tonic-gate		$(INS.file)
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gateDUMP_PROG=malloc_dump
1417c478bd9Sstevel@tonic-gateBUILDDIR=tmp
1427c478bd9Sstevel@tonic-gateDUMP_PROTO=$(BUILDDIR)/$(DUMP_PROG)_client
1437c478bd9Sstevel@tonic-gateXFILE=$(BUILDDIR)/malloc_dump.x
1447c478bd9Sstevel@tonic-gateXLINE= "program DUMP { version VERS \
1457c478bd9Sstevel@tonic-gate	{ void DUMP_IT(void) = 1000000; } = 2; } = 100099;"
1467c478bd9Sstevel@tonic-gate
1477c478bd9Sstevel@tonic-gate$(XFILE):	$(BUILDDIR)
1487c478bd9Sstevel@tonic-gate		$(RM) $(XFILE)
1497c478bd9Sstevel@tonic-gate		echo $(XLINE) > $(XFILE)
1507c478bd9Sstevel@tonic-gate
1517c478bd9Sstevel@tonic-gate$(BUILDDIR):
1527c478bd9Sstevel@tonic-gate		$(RM) -r $(BUILDDIR)
1537c478bd9Sstevel@tonic-gate		mkdir $(BUILDDIR)
1547c478bd9Sstevel@tonic-gate
1557c478bd9Sstevel@tonic-gate$(DUMP_PROTO):	$(BUILDDIR) $(XFILE)
1567c478bd9Sstevel@tonic-gate		cd $(BUILDDIR); $(RM) *.[ch] makefile.malloc_dump ; rpcgen -a `basename $(XFILE)
1577c478bd9Sstevel@tonic-gate		cd $(BUILDDIR); $(MAKE) -f makefile.malloc_dump `basename $@`
1587c478bd9Sstevel@tonic-gate
1597c478bd9Sstevel@tonic-gate$(DUMP_PROG):	$(DUMP_PROTO)
1607c478bd9Sstevel@tonic-gate		$(RM) $@
1617c478bd9Sstevel@tonic-gate		cp $(DUMP_PROTO) $@
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gateclean_dump:
1647c478bd9Sstevel@tonic-gate		$(RM) -r $(BUILDDIR)
1657c478bd9Sstevel@tonic-gate		$(RM) $(DUMP_PROG)
1667c478bd9Sstevel@tonic-gate$(ROOTUSRSBIN)/$(AUTO):
1677c478bd9Sstevel@tonic-gate		$(RM) $@; $(SYMLINK) $(LINKVALUE) $@
1687c478bd9Sstevel@tonic-gate
1697c478bd9Sstevel@tonic-gatereplica.o:	../nfs/lib/replica.c
1707c478bd9Sstevel@tonic-gate		$(COMPILE.c) ../nfs/lib/replica.c
1717c478bd9Sstevel@tonic-gate
1727c478bd9Sstevel@tonic-gatenfs_sec.o:	../nfs/lib/nfs_sec.c
1737c478bd9Sstevel@tonic-gate		$(COMPILE.c) ../nfs/lib/nfs_sec.c
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gatenfs_subr.o:	../nfs/lib/nfs_subr.c
1767c478bd9Sstevel@tonic-gate		$(COMPILE.c) ../nfs/lib/nfs_subr.c
1777c478bd9Sstevel@tonic-gate
1787c478bd9Sstevel@tonic-gateselfcheck.o:	../nfs/lib/selfcheck.c
1797c478bd9Sstevel@tonic-gate		$(COMPILE.c) ../nfs/lib/selfcheck.c
1807c478bd9Sstevel@tonic-gate
181dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United Statessmfcfg.o: ../nfs/lib/smfcfg.c
182dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States		$(COMPILE.c) ../nfs/lib/smfcfg.c
183dd51520eSPavan Mettu - Oracle Corporation - Menlo Park United States
1842f172c55SRobert Thurlownfs_resolve.o:	../nfs/lib/nfs_resolve.c
1852f172c55SRobert Thurlow		$(COMPILE.c) ../nfs/lib/nfs_resolve.c
1867c478bd9Sstevel@tonic-gate
1877c478bd9Sstevel@tonic-gatewebnfs_xdr.c:	webnfs.x
188bfa62c28SVallish Vaidyeshwara	$(RPCGEN) -M -C -c -o $@ webnfs.x
1897c478bd9Sstevel@tonic-gate
1907c478bd9Sstevel@tonic-gatewebnfs_client.c:	webnfs.x
191bfa62c28SVallish Vaidyeshwara	$(RPCGEN) -M -C -l -o $@ webnfs.x
1927c478bd9Sstevel@tonic-gate
1937c478bd9Sstevel@tonic-gatewebnfs.h:	webnfs.x
194bfa62c28SVallish Vaidyeshwara	$(RPCGEN) -M -C -h -o $@ webnfs.x
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gatewebnfs.x:	../nfs/lib/webnfs.x
1977c478bd9Sstevel@tonic-gate	$(RM) webnfs.x
1987c478bd9Sstevel@tonic-gate	cp ../nfs/lib/webnfs.x .
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gatecatalog: $(POFILE)
2017c478bd9Sstevel@tonic-gate
2027c478bd9Sstevel@tonic-gate$(POFILE):
2037c478bd9Sstevel@tonic-gate	$(RM) messages.po
2047c478bd9Sstevel@tonic-gate	$(SED) -e 's/pr_msg/gettext/' `$(GREP) -l "pr_msg|gettext" *.[ch]` | \
2057c478bd9Sstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS) -
2067c478bd9Sstevel@tonic-gate	$(SED) -e '/^# msg/d' -e '/^domain/d' < messages.po > $@
2077c478bd9Sstevel@tonic-gate	$(RM) messages.po
2087c478bd9Sstevel@tonic-gate
2097c478bd9Sstevel@tonic-gatelint:
2107c478bd9Sstevel@tonic-gate	$(LINT.c) $(AUTOSRCS)
2117c478bd9Sstevel@tonic-gate	$(LINT.c) $(MOUNTSRCS)
2127c478bd9Sstevel@tonic-gate	$(LINT.c) $(TYPESRCS)
2137c478bd9Sstevel@tonic-gate
2147c478bd9Sstevel@tonic-gateclean:	clean_dump
2157c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) webnfs_xdr.c webnfs_client.c webnfs.h webnfs.x
2167c478bd9Sstevel@tonic-gate
2177c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
218