This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cross-rpcgen patch, version 6

That didn't work out.  The dependency on system includes triggers the
install targets.  For native compiles it is better not to track system


	* sunrpc/Makefile (extra-objs): Add $(addprefix
	cross-,$(rpcgen-objs)), don't add $(cross-rpcgen-objs).
	(native-compile-mkdep-flags): Define.
	($(cross-rpcgen-objs)): Use it instead of $(compile-mkdep-flags).
	Depend on $(before-compile) instead of calling
 sunrpc/Makefile |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index 3b79dcd..0d95e79 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -91,7 +91,7 @@ install-bin := rpcgen
 rpcgen-objs = rpc_main.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)
+extra-objs = $(rpcgen-objs) $(addprefix cross-,$(rpcgen-objs))
 others += rpcgen
 all: # Make this the default target; it will be defined in Rules.
@@ -157,15 +157,14 @@ $(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/
 $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs))
 cross-rpcgen-objs := $(addprefix $(objpfx)cross-,$(rpcgen-objs))
-extra-objs += $(cross-rpcgen-objs)
 # When generic makefile support for build system programs is
 # available, it should replace this code.  See
 # <>.
-$(cross-rpcgen-objs): $(objpfx)cross-%.o: %.c
-	$(make-target-directory)
+native-compile-mkdep-flags = -MMD -MP -MF $@.dt -MT $@
+$(cross-rpcgen-objs): $(objpfx)cross-%.o: %.c $(before-compile)
 	$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) $< \
-		$(OUTPUT_OPTION) $(compile-mkdep-flags) -c
+		$(OUTPUT_OPTION) $(native-compile-mkdep-flags) -c
 $(objpfx)cross-rpcgen: $(cross-rpcgen-objs)
 	$(BUILD_CC) $^ $(BUILD_LDFLAGS) -o $@

Andreas Schwab,
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]