Merge illumos-gate
[unleashed/lotheac.git] / usr / src / cmd / fs.d / autofs / Makefile
blobc3f9231b276c8f3a3eb9de52d9641094b03be8cf
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
23 # Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2015 RackTop Systems.
25 # Copyright (c) 2018, Joyent, Inc.
28 FSTYPE= autofs
29 AUTO= automount
30 MOUNT= mount
31 VERS= .2
32 DFSHARES= dfshares
33 SHARE= share
34 UNSHARE= unshare
35 LIBPROG= $(AUTO) $(MOUNT) $(DFSHARES) $(SHARE) $(UNSHARE)
36 TYPEPROG= automountd
38 LINKINSTALL= $(ROOTUSRSBIN)/$(AUTO)
39 LINKVALUE= ../lib/fs/$(FSTYPE)/$(AUTO)
40 AUTOFS= autofs
41 DEFAULTFILES= autofs.dfl
42 SMFMANIFEST= autofs.xml
43 SMFMETHOD= svc-autofs
44 MFSTINSTALL= $(SMFMANIFEST:%=$(ROOTSVCSYSTEM)/filesystem/%)
45 METHODINSTALL= $(SMFMETHOD:%=$(ROOTLIBSVCMETHOD)/%)
47 OTHERINSTALL= $(LINKINSTALL) $(ROOTETCDEFAULTFILES) \
48 $(MFSTINSTALL) $(METHODINSTALL)
50 UNCHECKED_HDRS= webnfs.h
52 MANIFEST= autofs.xml
53 SVCMETHOD= svc-autofs
55 include ../Makefile.fstype
57 $(MFSTINSTALL) := FILEMODE = 0444
59 REAL_COMMON= debug_alloc.o
60 COMMON= ns_generic.o ns_files.o ns_nis.o \
61 ns_ldap.o auto_mnttab.o auto_subr.o $(REAL_COMMON)
63 AUTOOBJS= automount.o $(COMMON) $(FSLIB) smfcfg.o
65 MOUNTOBJS= mount.o $(FSLIB) $(REAL_COMMON)
67 LOCAL= autod_main.o \
68 autod_parse.o autod_mount.o autod_nfs.o nfs_cast.o \
69 autod_autofs.o autod_xdr.o autod_readdir.o autod_lookup.o \
70 smfcfg.o
72 TYPEOBJS= $(LOCAL) $(COMMON) replica.o nfs_sec.o nfs_resolve.o nfs_subr.o \
73 $(FSLIB) webnfs_xdr.o webnfs_client.o selfcheck.o
75 SHAREOBJS= $(SHARESRCS:%.c=%.o)
77 UNSHAREOBJS= $(UNSHARESRCS:%.c=%.o)
79 POFILE= autofs.po
80 GREP= egrep
81 SED= sed
83 $(AUTO) := LDLIBS += -lsldap -lscf
84 $(MOUNT):= LDLIBS += -lscf
85 $(TYPEPROG) := LDLIBS += -lrpcsvc -lsldap -lkstat -lscf
87 CPPFLAGS= -I. -I.. -I../nfs/lib $(CPPFLAGS.master) \
88 $(MALLOC_DEBUG)
90 CERRWARN += -Wno-parentheses
91 CERRWARN += -Wno-unused-variable
92 CERRWARN += -Wno-switch
93 CERRWARN += -Wno-uninitialized
94 CERRWARN += -Wno-unused-label
95 CERRWARN += -Wno-unused-function
97 # not linted
98 SMATCH=off
100 OBJS= $(AUTOOBJS) $(MOUNTOBJS) $(TYPEOBJS) \
101 $(SHAREOBJS) $(UNSHAREOBJS)
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)
114 nfs_sec.o := CPPFLAGS += -DWNFS_SEC_NEGO
116 $(AUTO): $(AUTOOBJS)
117 $(LINK.c) -o $@ $(AUTOOBJS) $(LDLIBS)
118 $(POST_PROCESS)
120 $(MOUNT): $(MOUNTOBJS)
121 $(LINK.c) -o $@ $(MOUNTOBJS) $(LDLIBS)
122 $(POST_PROCESS)
124 $(TYPEPROG): webnfs.h $(TYPEOBJS)
125 $(LINK.c) -o $@ $(TYPEOBJS) $(LDLIBS)
126 $(POST_PROCESS)
128 $(SHARE): $(SHAREOBJS)
129 $(LINK.c) -o $@ $(SHAREOBJS) $(LDLIBS)
130 $(POST_PROCESS)
132 $(UNSHARE): $(UNSHAREOBJS)
133 $(LINK.c) -o $@ $(UNSHAREOBJS) $(LDLIBS)
134 $(POST_PROCESS)
136 $(ROOTSVCSYSTEM)/filesystem/%: %
137 $(INS.file)
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;"
146 $(XFILE): $(BUILDDIR)
147 $(RM) $(XFILE)
148 echo $(XLINE) > $(XFILE)
150 $(BUILDDIR):
151 $(RM) -r $(BUILDDIR)
152 mkdir $(BUILDDIR)
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 $@`
158 $(DUMP_PROG): $(DUMP_PROTO)
159 $(RM) $@
160 cp $(DUMP_PROTO) $@
162 clean_dump:
163 $(RM) -r $(BUILDDIR)
164 $(RM) $(DUMP_PROG)
165 $(ROOTUSRSBIN)/$(AUTO):
166 $(RM) $@; $(SYMLINK) $(LINKVALUE) $@
168 replica.o: ../nfs/lib/replica.c
169 $(COMPILE.c) ../nfs/lib/replica.c
171 nfs_sec.o: ../nfs/lib/nfs_sec.c
172 $(COMPILE.c) ../nfs/lib/nfs_sec.c
174 nfs_subr.o: ../nfs/lib/nfs_subr.c
175 $(COMPILE.c) ../nfs/lib/nfs_subr.c
177 selfcheck.o: ../nfs/lib/selfcheck.c
178 $(COMPILE.c) ../nfs/lib/selfcheck.c
180 smfcfg.o: ../nfs/lib/smfcfg.c
181 $(COMPILE.c) ../nfs/lib/smfcfg.c
183 nfs_resolve.o: ../nfs/lib/nfs_resolve.c
184 $(COMPILE.c) ../nfs/lib/nfs_resolve.c
186 webnfs_xdr.c: webnfs.x
187 $(RPCGEN) -M -C -c -o $@ webnfs.x
189 webnfs_client.c: webnfs.x
190 $(RPCGEN) -M -C -l -o $@ webnfs.x
192 webnfs.h: webnfs.x
193 $(RPCGEN) -M -C -h -o $@ webnfs.x
195 webnfs.x: ../nfs/lib/webnfs.x
196 $(RM) webnfs.x
197 cp ../nfs/lib/webnfs.x .
199 catalog: $(POFILE)
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
208 clean: clean_dump
209 $(RM) $(OBJS) webnfs_xdr.c webnfs_client.c webnfs.h webnfs.x
211 check: $(CHKMANIFEST)