xref: /titanic_52/usr/src/uts/common/rpcsvc/Makefile (revision 2bc987325e3ded1865bff043128661815c4690b9)
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 (c) 2012 by Delphix. All rights reserved.
26#
27# uts/common/rpcsvc/Makefile
28#	This makefile installs system header files that go into
29#	/usr/include/rpcsvc.
30#
31# include global definitions
32include ../../../Makefile.master
33
34# Protocol descriptions.  Alas, the NFS protocol cannot be expressed
35# completely via rpcgen.  The NLM description should go here some day.
36# Also, the v3 headers have been hacked so that they no longer
37# quite reflect what goes over the wire.
38IDMAP_PROT_X=	idmap_prot.x
39RPCGEN_SRC=	autofs_prot.x nlm_prot.x sm_inter.x nsm_addr.x \
40		$(IDMAP_PROT_X)
41
42DERIVED_HDRS=	$(RPCGEN_SRC:%.x=%.h)
43
44ALLHDRS=	$(RPCGEN_SRC) $(DERIVED_HDRS)
45
46ROOTDIRS=	$(ROOT)/usr/include/rpcsvc
47
48ROOTHDRS=	$(ALLHDRS:%=$(ROOTDIRS)/%)
49
50RPCGENFLAGS = -C
51idmap_prot.h :=	RPCGENFLAGS += -MN
52nlm_prot.h :=	RPCGENFLAGS += -M
53sm_inter.h :=	RPCGENFLAGS += -M
54nsm_addr.h :=	RPCGENFLAGS += -M
55
56$(ROOTDIRS)/%: %
57	$(INS.file)
58
59.KEEP_STATE:
60
61# all_h permits derived headers to be built here in the uts source area
62# for the kernel to reference, without going so far as to install them.
63#
64all_h: $(DERIVED_HDRS)
65
66install_h: all_h $(ROOTDIRS) $(ROOTHDRS)
67
68clean:
69	$(RM) $(DERIVED_HDRS)
70
71clobber: clean
72
73# Don't check rpcgen-derived files.
74check:
75
76$(ROOTDIRS):
77	$(INS.dir)
78
79%.h: %.x
80	$(RPCGEN) $(RPCGENFLAGS) -h $< -o $@
81