This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Build rpcgen with standard build rules
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 9 Mar 2012 23:01:14 +0000 (UTC)
- Subject: Build rpcgen with standard build rules
rpcgen has its own makefile rule to build it, instead of being listed
in "others" and using a standard rule for linking executables. As far
as I can see this is only needed because there isn't a source file
called "rpcgen.c", which the standard rules would expect. I propose
this patch to rename rpc_main.c and use the standard build rule.
(Diffs for the actual renaming omitted.)
Tested x86_64.
2012-03-09 Joseph Myers <joseph@codesourcery.com>
* sunrpc/Makefile (rpc_main.c): Comment on renaming.
(rpcgen-objs): Change rpc_main.o to rpcgen.o.
(others): Add rpcgen.
($(objpfx)rpcgen): Remove special build rule and dependency on
libc.
* sunrpc/rpc_main.c: Rename to sunrpc/rpcgen.c.
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index 329d3f3..5e099d1 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -42,6 +42,9 @@ subdir := sunrpc
# rpc_dtablesize.c -> rpc_dtable.c
# svc_auth_unix.c -> svc_authux.c
# xdr_reference.c -> xdr_ref.c
+#
+# rpc_main.c was renamed to rpcgen.c to fit with glibc's normal build
+# rules for executables.
rpcsvc = bootparam_prot.x nlm_prot.x rstat.x \
yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
@@ -82,10 +85,11 @@ endif
# others := rpcinfo
# install-sbin := rpcinfo
install-bin := rpcgen
-rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
+rpcgen-objs = rpcgen.o rpc_hout.o rpc_cout.o rpc_parse.o \
rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o \
rpc_tblout.o rpc_sample.o
extra-objs = $(rpcgen-objs)
+others += rpcgen
all: # Make this the default target; it will be defined in Rules.
@@ -149,10 +153,7 @@ $(objpfx)tst-getmyaddr: $(common-objpfx)linkobj/libc.so
$(objpfx)tst-xdrmem: $(common-objpfx)linkobj/libc.so
$(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
-$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) \
- $(sort $(filter $(common-objpfx)libc%,$(link-libc))) \
- $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
- $(+link)
+$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs))
# This makes sure -DNOT_IN_libc is passed for all these modules.
cpp-srcs-left := $(rpcgen-objs:.o=.c)
--
Joseph S. Myers
joseph@codesourcery.com