]> git.ipfire.org Git - thirdparty/glibc.git/blob - sunrpc/Makefile
Remade for alpha-1.93
[thirdparty/glibc.git] / sunrpc / Makefile
1 # Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
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 \
60 clnt_udp rpc_dtable get_myaddr 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
66
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)
75
76 all: # Make this the default target; it will be defined in Rules.
77
78 include ../Makeconfig
79
80 ifeq (no,$(cross-compile))
81 # We can only build this library if we can run the rpcgen we build.
82 extra-libs := librpcsvc
83 extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
84 librpcsvc-routines = $(rpcsvc:%.x=x%)
85 librpcsvc-inhibit-o = .so # Build no shared rpcsvc library.
86 omit-deps = $(librpcsvc-routines)
87 endif
88
89 # Sun's code is not too clean.
90 override +gccwarn := -w
91
92 include ../Rules
93
94 $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(common-objpfx)libc.a
95 $(+link)
96
97 rpcgen-cmd = $(built-program-cmd)
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
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