.
[glibc.git] / sunrpc / Makefile
blob27c85cfe4c41eb9bfcf5a6a7834d8661f39b22f3
1 # Copyright (C) 1994, 1995 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
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.
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.
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.
20 # Sub-makefile for sunrpc portion of the library.
22 subdir := sunrpc
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:
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
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)
58 routines := auth_none auth_unix authuxprot bindrsvprt \
59 clnt_gen clnt_perr clnt_raw clnt_simp clnt_tcp \
60 clnt_udp rpc_dtable get_myaddr getrpcent getrpcport \
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
67 others := portmap rpcinfo
68 install-bin := rpcgen
69 install-sbin := rpcinfo portmap
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
72 # These headers are part of rpcgen.
73 distribute := rpc_util.h rpc_parse.h rpc_scan.h $(rpcgen-objs:.o=.c) etc.rpc
74 extra-objs = $(rpcgen-objs)
76 extra-libs := librpcsvc
77 librpcsvc-routines = $(rpcsvc:%.x=x%)
78 librpcsvc-inhibit-o = .so # Build no shared rpcsvc library.
79 omit-deps = $(librpcsvc-routines)
80 librpcsvc-no-lib-dep = t # Don't depend on this in `make lib' pass.
82 # Sun's code is not too clean.
83 override +gccwarn := -w
85 include ../Rules
87 $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(common-objpfx)libc.a
88 $(+link)
90 rpcgen-cmd = $(built-program-cmd)
92 # The proper file name is longer than 14 chars, so we install it under
93 # a shorter name. But if the filesystem can handle it, we want to
94 # install under the proper name as well.
95 $(includedir)/rpcsvc/bootparam_prot.h: $(includedir)/rpcsvc/bootparam.h
96 @echo It is safe to ignore an error here if this file name is too long.
97 -$(do-install)
99 # Install the rpc data base file.
100 $(sysconfdir)/rpc: etc.rpc
101 $(do-install)
103 defines := $(defines) -D_PATH_RPC='"$(sysconfdir)/rpc"'
105 # Generate the rpcsvc headers with rpcgen.
106 $(objpfx)rpcsvc/%.h: rpcsvc/%.x $(objpfx)rpcgen
107 $(make-target-directory)
108 $(rpcgen-cmd) -h $< -o $@
109 # Generate the rpcsvc XDR functions with rpcgen.
110 $(objpfx)x%.c: rpcsvc/%.x $(objpfx)rpcgen
111 $(rpcgen-cmd) -c $< -o $@
112 # The generated source files depend on the corresponding generated headers.
113 # Gratuitous dependency on generated .c file here just gets it mentioned to
114 # avoid being an intermediate file and getting removed.
115 $(rpcsvc:%.x=$(objpfx)x%.o): $(objpfx)x%.o: $(objpfx)x%.c $(objpfx)rpcsvc/%.h