xref: /illumos-gate/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile (revision f3655454)
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#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# Copyright 2020 Joyent, Inc.
26
27
28FSTYPE	  =	nfs
29TYPEPROG  =	nfsmapid
30TESTPROG  =	nfsmapid_test
31ATTMK	  =	$(TYPEPROG)
32
33include		../../Makefile.fstype
34
35LDLIBS   +=	-L$(ROOT)/usr/lib/nfs -R/usr/lib/nfs
36$(TYPEPROG) := LDLIBS += -lnsl -lmapid -ldtrace -lidmap
37COMMON    =	nfs_resolve.o
38SRCS	  =	nfsmapid.c ../lib/nfs_resolve.c nfsmapid_server.c
39DSRC	  =	nfsmapid_dt.d
40DOBJ	  =	$(DSRC:%.d=%.o)
41OBJS	  =	nfsmapid.o nfsmapid_server.o $(COMMON)
42CPPFLAGS +=	-I../lib -D_POSIX_PTHREAD_SEMANTICS
43
44CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
45CERRWARN +=	-_gcc=-Wno-unused-variable
46CERRWARN +=	-_gcc=-Wno-parentheses
47CERRWARN +=	$(CNOWARN_UNINIT)
48
49# not linted
50SMATCH=off
51
52all:		$(TYPEPROG) $(TESTPROG)
53
54$(TYPEPROG):	$(OBJS) $(DSRC)
55		$(COMPILE.d) -s $(DSRC) -o $(DOBJ) $(OBJS)
56		$(LINK.c) $(ZIGNORE) -o $@ $(DOBJ) $(OBJS) $(LDLIBS)
57		$(POST_PROCESS)
58
59nfs_resolve.o:	../lib/nfs_resolve.c
60		$(COMPILE.c) ../lib/nfs_resolve.c
61
62TESTSRCS  =	nfsmapid_test.c
63TESTOBJS  =	$(TESTSRCS:%.c=%.o)
64TEST_OBJS =	$(TESTOBJS)
65
66$(TESTPROG):	$(TEST_OBJS)
67		$(LINK.c) -o $@ $(TEST_OBJS) $(LDLIBS)
68		$(POST_PROCESS)
69
70POFILE	  =	nfsmapid.po
71catalog:	$(POFILE)
72
73$(POFILE):	$(SRCS)
74		$(RM) $@
75		$(COMPILE.cpp) $(SRCS) > $@.i
76		$(XGETTEXT) $(XGETFLAGS) $@.i
77		sed "/^domain/d" messages.po > $@
78		$(RM) $@.i messages.po
79
80clean:
81		$(RM) $(OBJS) $(TESTPROG) $(TESTOBJS) $(DOBJ) $(POFILE)
82
83lint:		$(SRCS) lint_SRCS
84