]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix dependency tracking on cross-rpcgen-objs
authorAndreas Schwab <schwab@linux-m68k.org>
Sat, 12 May 2012 06:40:20 +0000 (08:40 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Wed, 16 May 2012 12:09:23 +0000 (14:09 +0200)
ChangeLog
Makerules
sunrpc/Makefile

index 615ea849c1997f3a5aea633c6537ea19195d2e5f..629a31a170d4c7e12e265f3232dd772ce07e8d0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-16  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * Makerules (native-compile-mkdep-flags): Define.
+       * sunrpc/Makefile (extra-objs): Add $(addprefix
+       cross-,$(rpcgen-objs)), don't add $(cross-rpcgen-objs).
+       ($(cross-rpcgen-objs)): Use $(native-compile-mkdep-flags) instead
+       of $(compile-mkdep-flags).  Depend on $(before-compile) instead of
+       calling $(make-target-directory).
+
 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        * bits/types.h (__snseconds_t): Removed.
index b069763a7299383e817187c1005ff310815ce658..a897d4ea656213144206bb0f4edb639fac199ce4 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -369,6 +369,11 @@ compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
 compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
 compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
 
+# Like compile-mkdep-flags, but for use with $(BUILD_CC).  We don't want to
+# track system includes here, they may spuriously trigger an install rule,
+# and would cause the check-local-headers test to fail.
+native-compile-mkdep-flags = -MMD -MP -MF $@.dt -MT $@
+
 # GCC can grok options after the file name, and it looks nicer that way.
 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
 compile.cc = $(CXX) $< -c $(CXXFLAGS) $(CPPFLAGS)
index 3b79dcdb72cfbdba1fc81129ea78bd812524f429..48a458a0c0b53336ce9758ecf50ab577c9fddd85 100644 (file)
@@ -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,13 @@ $(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
 $(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
 # <http://sourceware.org/bugzilla/show_bug.cgi?id=14087>.
-$(cross-rpcgen-objs): $(objpfx)cross-%.o: %.c
-       $(make-target-directory)
+$(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 $@