xref: /illumos-gate/usr/src/cmd/fs.d/nfs/mount/Makefile (revision cf9a187ca73bc899270af62ab1cd99f2e205cf41)
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) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
22# Copyright 2018, Joyent, Inc. All rights reserved.
23#
24# cmd/fs.d/nfs/mount/Makefile
25
26FSTYPE=		nfs
27LIBPROG=	mount
28ROOTFS_PROG=	$(LIBPROG)
29
30# duplicate ROOTLIBFSTYPE value needed for installation rule
31# we must define this before including Makefile.fstype
32ROOTLIBFSTYPE = $(ROOT)/usr/lib/fs/$(FSTYPE)
33$(ROOTLIBFSTYPE)/%:	$(ROOTLIBFSTYPE) %
34	$(RM) $@; $(SYMLINK) ../../../../etc/fs/$(FSTYPE)/$(LIBPROG) $@
35
36include		../../Makefile.fstype
37
38COMMON= $(FSLIB) nfs_sec.o replica.o nfs_subr.o selfcheck.o smfcfg.o
39OBJS=	$(LIBPROG).o $(COMMON) webnfs_client.o webnfs_xdr.o
40SRCS=	$(LIBPROG).c $(FSLIBSRC) ../lib/nfs_sec.c ../lib/replica.c \
41	../lib/nfs_subr.c webnfs_xdr.c webnfs_client.c ../lib/selfcheck.c \
42	../lib/smfcfg.c
43
44UNCHECKED_HDRS=	webnfs.h
45
46CERRWARN += -_gcc=-Wno-parentheses
47CERRWARN += -_gcc=-Wno-switch
48CERRWARN += -_gcc=-Wno-unused-variable
49CERRWARN += -_gcc=-Wno-uninitialized
50CERRWARN += -_gcc=-Wno-address
51CERRWARN += -_gcc=-Wno-unused-function
52
53# unknown type for func
54SMATCH=off
55
56#
57# Message catalog
58#
59POFILE= mount.po
60
61LDLIBS += -lrpcsvc -lnsl -lsocket -lscf
62CPPFLAGS += -I. -I../.. -I../lib
63CFLAGS += $(CCVERBOSE)
64
65nfs_sec.o :=	CPPFLAGS += -DWNFS_SEC_NEGO
66
67ROOTETCPROG	= $(LIBPROG:%=$(ROOTETCFSTYPE)/%)
68CLOBBERFILES	+= $(LIBPROG)
69
70.KEEP_STATE:
71
72all:	$(ROOTFS_PROG)
73
74$(LIBPROG):	webnfs.h $(OBJS)
75		$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
76		$(POST_PROCESS)
77
78nfs_sec.o:	../lib/nfs_sec.c
79		$(COMPILE.c) ../lib/nfs_sec.c
80
81replica.o:	../lib/replica.c
82		$(COMPILE.c) ../lib/replica.c
83
84nfs_subr.o:	../lib/nfs_subr.c
85		$(COMPILE.c) ../lib/nfs_subr.c
86
87selfcheck.o:	../lib/selfcheck.c
88		$(COMPILE.c) ../lib/selfcheck.c
89
90nfs_tbind.o:	../lib/nfs_tbind.c
91		$(COMPILE.c) ../lib/nfs_tbind.c
92
93smfcfg.o:	../lib/smfcfg.c
94		$(COMPILE.c) ../lib/smfcfg.c
95
96webnfs_xdr.c:	webnfs.x
97	$(RPCGEN) -M -C -c -o $@ webnfs.x
98
99webnfs_client.c:	webnfs.x
100	$(RPCGEN) -M -C -l -o $@ webnfs.x
101
102webnfs.h:	webnfs.x
103	$(RPCGEN) -M -C -h -o $@ webnfs.x
104
105webnfs.x:	../lib/webnfs.x
106		$(RM) webnfs.x
107		cp ../lib/webnfs.x .
108
109#
110# message catalog
111#
112catalog: $(POFILE)
113
114$(POFILE): $(SRCS) webnfs.h
115	$(RM) $@
116	$(COMPILE.cpp) $(SRCS)   > $(POFILE).i
117	$(XGETTEXT)     $(XGETFLAGS) $(POFILE).i
118	sed "/^domain/d"        messages.po     > $@
119	$(RM) $(POFILE).i messages.po
120
121install:	$(ROOTETCPROG)
122
123lint:	webnfs.h webnfs_xdr.c webnfs_client.c lint_SRCS
124
125clean:
126	$(RM) $(OBJS) webnfs.x webnfs.h webnfs_xdr.c webnfs_client.c
127