xref: /illumos-gate/usr/src/uts/common/rpc/Makefile (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# uts/common/rpc/Makefile
29#
30# include global definitions
31include ../../../Makefile.master
32
33i386_HDRS=
34
35sparc_HDRS= ib.h
36
37COMMHDRS= \
38auth.h		auth_des.h	auth_sys.h	auth_unix.h \
39bootparam.h	clnt.h		clnt_soc.h	clnt_stat.h	des_crypt.h \
40nettype.h	pmap_clnt.h	pmap_rmt.h \
41rac.h		raw.h		rpc.h		rpc_com.h	rpc_msg.h \
42rpcb_clnt.h	rpcent.h	svc.h		svc_auth.h	svc_soc.h \
43trace.h		types.h		xdr.h		rpcsec_gss.h	svc_mt.h \
44rpcsys.h	rpc_rdma.h
45
46HDRS=			\
47	$(COMMHDRS)	\
48	$($(MACH)_HDRS)
49
50RPC_SRC=	pmap_prot.x	rpcb_prot.x
51
52RPCSVC_SRC=	key_prot.x	rpc_sztypes.x
53
54DERIVED_FILES=	key_prot.h	pmap_prot.h	rpcb_prot.h	rpc_sztypes.h
55
56RPCHDRS=	$(HDRS)	$(RPC_SRC) $(DERIVED_FILES)
57
58RPCSVCHDRS=	$(RPCSVC_SRC)
59
60RPCDIRS=	$(ROOT)/usr/include/rpc
61RPCSVCDIRS=	$(ROOT)/usr/include/rpcsvc
62
63ROOTHDRS= $(RPCHDRS:%=$(RPCDIRS)/%) $(RPCSVCHDRS:%=$(RPCSVCDIRS)/%)
64
65$(RPCDIRS)/%: %
66	$(INS.file)
67
68$(RPCSVCDIRS)/%: %
69	$(INS.file)
70
71# XXX: should really check the style of the derived files as well...
72#	$(RPC_SRC:%.x=%.check) \
73#	$(RPCSVC_SRC:%.x=%.check)
74#
75CHECKHDRS= $(HDRS:%.h=%.check)
76
77.KEEP_STATE:
78
79.PARALLEL: $(CHECKHDRS)
80
81all: all_h
82
83install_h: all_h $(RPCDIRS) $(RPCSVCDIRS) $(ROOTHDRS)
84
85# all_h permits derived headers to be built here in the uts source area
86# for the kernel to reference, without going so far as to install them.
87#
88all_h: $(DERIVED_FILES)
89
90clean:
91	$(RM) $(DERIVED_FILES)
92
93$(RPCDIRS):
94	$(INS.dir)
95
96$(RPCSVCDIRS):
97	$(INS.dir)
98
99key_prot.h: key_prot.x
100	$(RPCGEN) -C -h key_prot.x > $@
101
102pmap_prot.h: pmap_prot.x
103	$(RPCGEN) -h pmap_prot.x > $@
104
105# EXPORT DELETE START
106# Special target to clean up the source tree for export distribution
107# Warning: This target changes the source tree
108EXPORT_SRC:
109	$(RM) Makefile+ sec_gss/rpcsec_gss_misc.c+
110	$(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
111		< Makefile > Makefile+
112	$(MV) Makefile+ Makefile
113	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
114	< sec_gss/rpcsec_gss_misc.c > sec_gss/rpcsec_gss_misc.c+
115	$(MV) sec_gss/rpcsec_gss_misc.c+ sec_gss/rpcsec_gss_misc.c
116	$(CHMOD) 444 Makefile sec_gss/rpcsec_gss_misc.c
117
118# EXPORT DELETE END
119
120# The sed stuff is a workaround for an rpcgen bug (bugid 1128007).
121rpc_sztypes.h: rpc_sztypes.x
122	$(RPCGEN) -C -h rpc_sztypes.x > rpc_sztypes.tmp
123	sed -e s/ulonglong/u_longlong/ rpc_sztypes.tmp > $@
124	rm rpc_sztypes.tmp
125
126rpcb_prot.h: rpcb_prot.x
127	$(RPCGEN) -h rpcb_prot.x > $@
128
129check:	$(CHECKHDRS)
130