]> sourceware.org Git - glibc.git/blame - sunrpc/Makefile
Update.
[glibc.git] / sunrpc / Makefile
CommitLineData
0c5ecdc4 1# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
28f540f4
RM
2# This file is part of the GNU C Library.
3
4# The GNU C Library is free software; you can redistribute it and/or
5# modify it under the terms of the GNU Library General Public License as
6# published by the Free Software Foundation; either version 2 of the
7# License, or (at your option) any later version.
8
9# The GNU C Library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# Library General Public License for more details.
13
14# You should have received a copy of the GNU Library General Public
0c5ecdc4
UD
15# License along with the GNU C Library; see the file COPYING.LIB. If not,
16# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17# Boston, MA 02111-1307, USA.
28f540f4
RM
18
19#
20# Sub-makefile for sunrpc portion of the library.
21#
22subdir := sunrpc
23
0d204b0a
UD
24# The code in this subdirectory is taken from Sun's RPCSRC-4.0
25# distribution with some additional changes from the TI-RPC package
714a562f
UD
26# which is also available from Sun. The files are heavily changed to
27# compile cleanly and to fit in the GNU environment. All the code
28# from Sun's rpc, etc, and rpcgen subdirectories is in this directory;
29# the rpc subdirectory contains only the header files. Other than
30# that, several files were renamed so as not to exceed 14-character
31# file name limits:
28f540f4
RM
32#
33# authunix_prot.c -> authuxprot.c
34# bindresvport.c -> bindrsvprt.c
35# clnt_generic.c -> clnt_gen.c
36# clnt_perror.c -> clnt_perr.c
37# clnt_simple.c -> clnt_simp.c
38# get_myaddress.c -> get_myaddr.c
39# pmap_getmaps.c -> pm_getmaps.c
40# pmap_getport.c -> pm_getport.c
41# rpc_callmsg.c -> rpc_cmsg.c
42# rpc_commondata.c -> rpc_common.c
43# rpc_dtablesize.c -> rpc_dtable.c
44# svc_auth_unix.c -> svc_authux.c
45# xdr_reference.c -> xdr_ref.c
46# rpcsvc/bootparam_prot.x -> rpcsvc/bootparam.x
47
28f540f4
RM
48rpcsvc = bootparam.x nlm_prot.x rstat.x \
49 yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
800d775e 50 rusers.x spray.x nfs_prot.x rquota.x key_prot.x
56552e42
UD
51headers = $(addprefix rpc/,auth.h auth_unix.h clnt.h netdb.h pmap_clnt.h \
52 pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h svc.h \
800d775e
UD
53 svc_auth.h types.h xdr.h auth_des.h \
54 des_crypt.h key_prot.h) \
56552e42 55 $(rpcsvc:%=rpcsvc/%)
19361cb7 56install-others = $(inst_sysconfdir)/rpc
6952e59e 57generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) \
377a515b
UD
58 $(rpcsvc:%.x=rpcsvc/%.stmp) $(rpcsvc:%.x=x%.stmp) \
59 rpc-proto.c
28f540f4
RM
60
61routines := auth_none auth_unix authuxprot bindrsvprt \
62 clnt_gen clnt_perr clnt_raw clnt_simp clnt_tcp \
5f0e6fc7 63 clnt_udp rpc_dtable get_myaddr getrpcport \
28f540f4
RM
64 pmap_clnt pm_getmaps pm_getport pmap_prot \
65 pmap_prot2 pmap_rmt rpc_prot rpc_common rpc_cmsg \
66 svc svc_auth svc_authux svc_raw svc_run svc_simple \
67 svc_tcp svc_udp xdr xdr_array xdr_float xdr_mem \
800d775e
UD
68 xdr_rec xdr_ref xdr_stdio publickey xdr_sizeof \
69 auth_des authdes_prot des_crypt des_impl des_soft \
70 key_call key_prot netname openchild rtime svcauth_des xcrypt
28f540f4 71
46ec036d 72others := rpcinfo
28f540f4 73install-bin := rpcgen
8145a974 74install-sbin := rpcinfo
28f540f4 75rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
0d204b0a
UD
76 rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o \
77 rpc_tblout.o rpc_sample.o
28f540f4 78# These headers are part of rpcgen.
800d775e 79distribute := proto.h rpc_util.h rpc_parse.h rpc_scan.h des.h \
0d204b0a 80 $(rpcgen-objs:.o=.c) etc.rpc
693e7b96
RM
81extra-objs = $(rpcgen-objs)
82
e75154a6
RM
83all: # Make this the default target; it will be defined in Rules.
84
85include ../Makeconfig
86
a5113b14 87ifeq (no,$(cross-compiling))
e75154a6 88# We can only build this library if we can run the rpcgen we build.
6952e59e
UD
89headers += $(rpcsvc:%.x=rpcsvc/%.h)
90install-others += $(inst_includedir)/rpcsvc/bootparam_prot.h
693e7b96 91extra-libs := librpcsvc
dbe31b9a 92extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
693e7b96 93librpcsvc-routines = $(rpcsvc:%.x=x%)
40a55d20 94librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
693e7b96 95omit-deps = $(librpcsvc-routines)
e75154a6 96endif
28f540f4 97
e7fd8a39
UD
98CFLAGS-xbootparam.c = -Wno-unused
99CFLAGS-xnlm_prot.c = -Wno-unused
100CFLAGS-xrstat.c = -Wno-unused
101CFLAGS-xyppasswd.c = -Wno-unused
102CFLAGS-xklm_prot.c = -Wno-unused
103CFLAGS-xrex.c = -Wno-unused
104CFLAGS-xsm_inter.c = -Wno-unused
105CFLAGS-xmount.c = -Wno-unused
106CFLAGS-xrusers.c = -Wno-unused
107CFLAGS-xspray.c = -Wno-unused
108CFLAGS-xnfs_prot.c = -Wno-unused
22d57dd3 109CFLAGS-xrquota.c = -Wno-unused
26b4d766 110CFLAGS-xkey_prot.c = -Wno-unused
e7fd8a39 111
28f540f4
RM
112include ../Rules
113
693e7b96 114$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(common-objpfx)libc.a
28f540f4
RM
115 $(+link)
116
9756dfe1
UD
117# Tell rpcgen that it should unset LD_LIBRARY_PATH before executing the
118# preprocessor.
119rpcgen-cmd = $(built-program-cmd) -$$
28f540f4
RM
120
121# The proper file name is longer than 14 chars, so we install it under
122# a shorter name. But if the filesystem can handle it, we want to
123# install under the proper name as well.
8d57beea
UD
124$(inst_includedir)/rpcsvc/bootparam_prot.h: \
125 $(inst_includedir)/rpcsvc/bootparam.h
28f540f4
RM
126 @echo It is safe to ignore an error here if this file name is too long.
127 -$(do-install)
128
129# Install the rpc data base file.
8d57beea 130$(inst_sysconfdir)/rpc: etc.rpc
28f540f4 131 $(do-install)
28f540f4 132\f
28f540f4 133# Generate the rpcsvc headers with rpcgen.
c0e45674
UD
134# We use a stamp file to avoid unnessary recompilation each time rpcgen is
135# relinked.
d705269e
UD
136$(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
137 @:
c0e45674 138$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
28f540f4 139 $(make-target-directory)
c0e45674
UD
140 -@rm -f ${@:stmp=T} $@
141 $(rpcgen-cmd) -h $< -o ${@:stmp=T}
142 if test -r ${@:stmp=h} && cmp -s ${@:stmp=h} ${@:stmp=T}; \
143 then rm -f ${@:stmp=T}; \
144 else mv -f ${@:stmp=T} ${@:stmp=h}; fi
145 touch $@
0d204b0a 146
28f540f4 147# Generate the rpcsvc XDR functions with rpcgen.
d705269e
UD
148$(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
149 @:
c0e45674
UD
150$(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
151 -@rm -f ${@:stmp=T} $@
152 $(rpcgen-cmd) -c $< -o ${@:stmp=T}
153 if test -r ${@:stmp=c} && cmp -s ${@:stmp=c} ${@:stmp=T}; \
154 then rm -f ${@:stmp=T}; \
155 else mv -f ${@:stmp=T} ${@:stmp=c}; fi
156 touch $@
157
28f540f4
RM
158# The generated source files depend on the corresponding generated headers.
159# Gratuitous dependency on generated .c file here just gets it mentioned to
160# avoid being an intermediate file and getting removed.
377a515b
UD
161$(rpcsvc:%.x=$(objpfx)x%.o): $(objpfx)x%.o: $(objpfx)x%.c $(objpfx)rpcsvc/%.h \
162 $(objpfx)rpc-proto.d
163
164ifndef no_deps
165-include $(objpfx)rpc-proto.d
166endif
167
168$(objpfx)rpc-proto.d: $(objpfx)%.d: $(objpfx)%.c
169 $(+make-deps)
170# Special file to generate dependencies for the RPC service objects.
171# Collect all include directives from the source files.
172$(objpfx)rpc-proto.c: $(rpcsvc:%=rpcsvc/%)
4cca6b86 173 $(make-target-directory)
377a515b
UD
174 { echo '#include <rpc/types.h>'; \
175 echo '#include <rpc/xdr.h>'; \
176 echo '#include <rpc/rpc.h>'; \
177 sed -n '/^%#include/s/%//p' $^; } > $@T
178 mv -f $@T $@
This page took 0.089164 seconds and 5 git commands to generate.