xref: /illumos-gate/usr/src/uts/common/rpc/Makefile (revision a38ddfee9c8c6b6c5a2947ff52fd2338362a4444)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22
23#
24# ident	"%Z%%M%	%I%	%E% SMI"
25#
26# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
27# Use is subject to license terms.
28#
29# uts/common/rpc/Makefile
30#
31# include global definitions
32include ../../../Makefile.master
33
34i386_HDRS=
35
36sparc_HDRS= ib.h
37
38COMMHDRS= \
39auth.h		auth_des.h	auth_sys.h	auth_unix.h \
40bootparam.h	clnt.h		clnt_soc.h	clnt_stat.h	des_crypt.h \
41nettype.h	pmap_clnt.h	pmap_rmt.h \
42raw.h		rpc.h		rpc_com.h	rpc_msg.h \
43rpcb_clnt.h	rpcent.h	svc.h		svc_auth.h	svc_soc.h \
44types.h		xdr.h		rpcsec_gss.h	svc_mt.h \
45rpcsys.h	rpc_rdma.h
46
47HDRS=			\
48	$(COMMHDRS)	\
49	$($(MACH)_HDRS)
50
51RPC_SRC=	pmap_prot.x	rpcb_prot.x
52
53RPCSVC_SRC=	key_prot.x	rpc_sztypes.x
54
55DERIVED_FILES=	key_prot.h	pmap_prot.h	rpcb_prot.h	rpc_sztypes.h
56
57RPCHDRS=	$(HDRS)	$(RPC_SRC) $(DERIVED_FILES)
58
59RPCSVCHDRS=	$(RPCSVC_SRC)
60
61RPCDIRS=	$(ROOT)/usr/include/rpc
62RPCSVCDIRS=	$(ROOT)/usr/include/rpcsvc
63
64ROOTHDRS= $(RPCHDRS:%=$(RPCDIRS)/%) $(RPCSVCHDRS:%=$(RPCSVCDIRS)/%)
65
66$(RPCDIRS)/%: %
67	$(INS.file)
68
69$(RPCSVCDIRS)/%: %
70	$(INS.file)
71
72# XXX: should really check the style of the derived files as well...
73#	$(RPC_SRC:%.x=%.check) \
74#	$(RPCSVC_SRC:%.x=%.check)
75#
76CHECKHDRS= $(HDRS:%.h=%.check)
77
78.KEEP_STATE:
79
80.PARALLEL: $(CHECKHDRS)
81
82all: all_h
83
84install_h: all_h $(RPCDIRS) $(RPCSVCDIRS) $(ROOTHDRS)
85
86# all_h permits derived headers to be built here in the uts source area
87# for the kernel to reference, without going so far as to install them.
88#
89all_h: $(DERIVED_FILES)
90
91clean:
92	$(RM) $(DERIVED_FILES)
93
94$(RPCDIRS):
95	$(INS.dir)
96
97$(RPCSVCDIRS):
98	$(INS.dir)
99
100key_prot.h: key_prot.x
101	$(RPCGEN) -C -h key_prot.x > $@
102
103pmap_prot.h: pmap_prot.x
104	$(RPCGEN) -h pmap_prot.x > $@
105
106# EXPORT DELETE START
107# Special target to clean up the source tree for export distribution
108# Warning: This target changes the source tree
109EXPORT_SRC:
110	$(RM) Makefile+ sec_gss/rpcsec_gss_misc.c+
111	$(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
112		< Makefile > Makefile+
113	$(MV) Makefile+ Makefile
114	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
115	< sec_gss/rpcsec_gss_misc.c > sec_gss/rpcsec_gss_misc.c+
116	$(MV) sec_gss/rpcsec_gss_misc.c+ sec_gss/rpcsec_gss_misc.c
117	$(CHMOD) 444 Makefile sec_gss/rpcsec_gss_misc.c
118
119# EXPORT DELETE END
120
121rpc_sztypes.h: rpc_sztypes.x
122	$(RPCGEN) -C -h rpc_sztypes.x > $@
123
124rpcb_prot.h: rpcb_prot.x
125	$(RPCGEN) -h rpcb_prot.x > $@
126
127check:	$(CHECKHDRS)
128