]>
Commit | Line | Data |
---|---|---|
5f0e6fc7 | 1 | # Copyright (C) 1994, 1995, 1996 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 | |
15 | # License along with the GNU C Library; see the file COPYING.LIB. If | |
16 | # not, write to the Free Software Foundation, Inc., 675 Mass Ave, | |
17 | # Cambridge, MA 02139, USA. | |
18 | ||
19 | # | |
20 | # Sub-makefile for sunrpc portion of the library. | |
21 | # | |
22 | subdir := sunrpc | |
23 | ||
24 | # The code in this subdirectory is taken verbatim from Sun's RPCSRC-4.0 | |
25 | # distribution. A few files needed trivial modifications to compile in the | |
26 | # GNU environment; these changes are marked by comments that say | |
27 | # `roland@gnu'. All the code from Sun's rpc, etc, and rpcgen | |
28 | # subdirectories is in this directory; the rpc subdirectory contains only | |
29 | # the header files. Other than that, several files were renamed so as not | |
30 | # to exceed 14-character file name limits: | |
31 | # | |
32 | # authunix_prot.c -> authuxprot.c | |
33 | # bindresvport.c -> bindrsvprt.c | |
34 | # clnt_generic.c -> clnt_gen.c | |
35 | # clnt_perror.c -> clnt_perr.c | |
36 | # clnt_simple.c -> clnt_simp.c | |
37 | # get_myaddress.c -> get_myaddr.c | |
38 | # pmap_getmaps.c -> pm_getmaps.c | |
39 | # pmap_getport.c -> pm_getport.c | |
40 | # rpc_callmsg.c -> rpc_cmsg.c | |
41 | # rpc_commondata.c -> rpc_common.c | |
42 | # rpc_dtablesize.c -> rpc_dtable.c | |
43 | # svc_auth_unix.c -> svc_authux.c | |
44 | # xdr_reference.c -> xdr_ref.c | |
45 | # rpcsvc/bootparam_prot.x -> rpcsvc/bootparam.x | |
46 | ||
47 | headers = $(addprefix rpc/,auth.h auth_unix.h clnt.h netdb.h pmap_clnt.h \ | |
48 | pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h svc.h \ | |
49 | svc_auth.h types.h xdr.h) \ | |
50 | $(rpcsvc:%=rpcsvc/%) $(rpcsvc:%.x=rpcsvc/%.h) | |
51 | rpcsvc = bootparam.x nlm_prot.x rstat.x \ | |
52 | yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \ | |
53 | rnusers.x spray.x nfs_prot.x rquota.x yp.x | |
54 | install-others = $(includedir)/rpcsvc/bootparam_prot.h \ | |
55 | $(sysconfdir)/rpc | |
56 | generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) | |
57 | ||
58 | routines := auth_none auth_unix authuxprot bindrsvprt \ | |
59 | clnt_gen clnt_perr clnt_raw clnt_simp clnt_tcp \ | |
5f0e6fc7 | 60 | clnt_udp rpc_dtable get_myaddr getrpcport \ |
28f540f4 RM |
61 | pmap_clnt pm_getmaps pm_getport pmap_prot \ |
62 | pmap_prot2 pmap_rmt rpc_prot rpc_common rpc_cmsg \ | |
63 | svc svc_auth svc_authux svc_raw svc_run svc_simple \ | |
64 | svc_tcp svc_udp xdr xdr_array xdr_float xdr_mem \ | |
65 | xdr_rec xdr_ref xdr_stdio | |
66 | ||
693e7b96 | 67 | others := portmap rpcinfo |
28f540f4 RM |
68 | install-bin := rpcgen |
69 | install-sbin := rpcinfo portmap | |
28f540f4 RM |
70 | rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \ |
71 | rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o | |
28f540f4 RM |
72 | # These headers are part of rpcgen. |
73 | distribute := rpc_util.h rpc_parse.h rpc_scan.h $(rpcgen-objs:.o=.c) etc.rpc | |
693e7b96 RM |
74 | extra-objs = $(rpcgen-objs) |
75 | ||
e75154a6 RM |
76 | all: # Make this the default target; it will be defined in Rules. |
77 | ||
a5113b14 UD |
78 | # Sun's code is not too clean. |
79 | override +gccwarn := -w | |
80 | ||
e75154a6 RM |
81 | include ../Makeconfig |
82 | ||
a5113b14 | 83 | ifeq (no,$(cross-compiling)) |
e75154a6 | 84 | # We can only build this library if we can run the rpcgen we build. |
693e7b96 | 85 | extra-libs := librpcsvc |
dbe31b9a | 86 | extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass. |
693e7b96 RM |
87 | librpcsvc-routines = $(rpcsvc:%.x=x%) |
88 | librpcsvc-inhibit-o = .so # Build no shared rpcsvc library. | |
89 | omit-deps = $(librpcsvc-routines) | |
e75154a6 | 90 | endif |
28f540f4 | 91 | |
28f540f4 RM |
92 | include ../Rules |
93 | ||
693e7b96 | 94 | $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(common-objpfx)libc.a |
28f540f4 RM |
95 | $(+link) |
96 | ||
03a75825 | 97 | rpcgen-cmd = $(built-program-cmd) |
28f540f4 RM |
98 | |
99 | # The proper file name is longer than 14 chars, so we install it under | |
100 | # a shorter name. But if the filesystem can handle it, we want to | |
101 | # install under the proper name as well. | |
102 | $(includedir)/rpcsvc/bootparam_prot.h: $(includedir)/rpcsvc/bootparam.h | |
103 | @echo It is safe to ignore an error here if this file name is too long. | |
104 | -$(do-install) | |
105 | ||
106 | # Install the rpc data base file. | |
107 | $(sysconfdir)/rpc: etc.rpc | |
108 | $(do-install) | |
109 | ||
110 | defines := $(defines) -D_PATH_RPC='"$(sysconfdir)/rpc"' | |
111 | \f | |
28f540f4 RM |
112 | # Generate the rpcsvc headers with rpcgen. |
113 | $(objpfx)rpcsvc/%.h: rpcsvc/%.x $(objpfx)rpcgen | |
114 | $(make-target-directory) | |
115 | $(rpcgen-cmd) -h $< -o $@ | |
116 | # Generate the rpcsvc XDR functions with rpcgen. | |
117 | $(objpfx)x%.c: rpcsvc/%.x $(objpfx)rpcgen | |
118 | $(rpcgen-cmd) -c $< -o $@ | |
119 | # The generated source files depend on the corresponding generated headers. | |
120 | # Gratuitous dependency on generated .c file here just gets it mentioned to | |
121 | # avoid being an intermediate file and getting removed. | |
122 | $(rpcsvc:%.x=$(objpfx)x%.o): $(objpfx)x%.o: $(objpfx)x%.c $(objpfx)rpcsvc/%.h |