xref: /titanic_51/usr/src/lib/librpcsvc/Makefile (revision d50bcaae2118610560f2b107d0d282315e47e4e4)
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 2015 Gary Mills
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27include  ../../Makefile.master
28
29# Relative path to ensure path to header file is also relative
30HEAD_DIR= ../../head/rpcsvc
31UTS_DIR= ../../uts/common/rpcsvc
32RPC_DIR= ../../uts/common/rpc
33
34SUBDIRS=	$(MACH)
35$(BUILD64)SUBDIRS += $(MACH64)
36
37DERIVED_FILES=  \
38	common/bootparam_prot_xdr.c	\
39	common/rstat_xdr.c	\
40	common/rusers_xdr.c	\
41	common/spray_xdr.c	\
42	common/nlm_prot.c	\
43	common/sm_inter_xdr.c	\
44	common/mount_xdr.c	\
45	common/nsm_addr_xdr.c	\
46	common/rpc_sztypes.c
47
48CLEANFILES += $(DERIVED_FILES)
49
50# include library definitions
51include ../Makefile.lib
52
53# definitions for install_h target
54HDRS= 		$(TXTS)
55ROOTHDRDIR=	$(ROOT)/usr/include/rpcsvc
56ROOTHDRS=	$(HDRS:%=$(ROOTHDRDIR)/%)
57CHECKHDRS=	$(HDRS:%.h=%.check)
58
59# install rule for install_h target
60$(ROOTHDRDIR)/%: %
61	$(INS.file)
62
63all :=		TARGET= all
64clean :=	TARGET= clean
65clobber :=	TARGET= clobber
66install :=	TARGET= install
67lint :=		TARGET= lint
68
69.KEEP_STATE:
70
71all:	$(DERIVED_FILES) $(TXTS) .WAIT $(SUBDIRS)
72
73install: all .WAIT $(SUBDIRS)
74
75install_h: $(DERIVED_FILES) $(ROOTHDRS)
76
77check: $(CHECKHDRS)
78
79clean clobber lint: $(SUBDIRS)
80
81#
82# Rules for building the derived files
83#
84# Derived files
85#
86common/bootparam_prot_xdr.c: $(HEAD_DIR)/bootparam_prot.x
87	$(RPCGEN) -c $(HEAD_DIR)/bootparam_prot.x > $@
88
89common/rstat_xdr.c: $(HEAD_DIR)/rstat.x
90	$(RPCGEN) -c $(HEAD_DIR)/rstat.x > $@
91
92common/rusers_xdr.c: $(HEAD_DIR)/rusers.x
93	$(RPCGEN) -c $(HEAD_DIR)/rusers.x > $@
94
95common/sm_inter_xdr.c: $(UTS_DIR)/sm_inter.x
96	$(RPCGEN) -c $(UTS_DIR)/sm_inter.x > $@
97
98common/spray_xdr.c: $(HEAD_DIR)/spray.x
99	$(RPCGEN) -c $(HEAD_DIR)/spray.x > $@
100
101common/nlm_prot.c: $(UTS_DIR)/nlm_prot.x
102	$(RPCGEN) -c $(UTS_DIR)/nlm_prot.x > $@
103
104common/mount_xdr.c: $(HEAD_DIR)/mount.x
105	$(RPCGEN) -c $(HEAD_DIR)/mount.x > $@
106
107common/nsm_addr_xdr.c: $(UTS_DIR)/nsm_addr.x
108	$(RPCGEN) -c $(UTS_DIR)/nsm_addr.x > $@
109
110common/rpc_sztypes.c: $(RPC_DIR)/rpc_sztypes.x
111	$(RPCGEN) -c $(RPC_DIR)/rpc_sztypes.x > $@
112
113# include library targets
114include ../Makefile.targ
115
116$(SUBDIRS): FRC
117	@cd $@; pwd; $(MAKE) $(TARGET)
118
119FRC:
120