[autodeps] gnu-nat, autogenerated files

Pedro Alves
2008-09-09T15:07:35Z

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

Hi,

Another patch I had here laying around, from my recent all-targets
excursions.

Pre auto-dependencies, gnu-nat.o had these, among others, in its
dependency list:

gnu-nat.o: ... $(exc_request_S_h) $(notify_S_h) $(process_reply_S_h) \
$(msg_reply_S_h) $(exc_request_U_h) $(msg_U_h)

But, we no longer specify those explicit dependencies, so
currently, the build fails when trying to compile gnu-nat.c, claiming
exc_request_S.h, etc, are nowhere to be found.

These are generated headers, built from the corresponding .defs files in
the tree. Their build rules are in config/i386/i386gnu.mh.

With this patch I was able to build GDB on i686-unknown-gnu0.3 again
successfully.

Is this the right approach? If so, OK?

--
Pedro Alves

[-- Attachment #2: hurd_gen_files.diff --]
[-- Type: text/x-diff, Size: 1487 bytes --]

2008-09-09 Pedro Alves <pedro@codesourcery.com>

* Makefile.in (generated_files): Add $(host_generated_files).
* config/i386/i386gnu.mh (host_generated_files): New.

---
gdb/Makefile.in | 3 ++-
gdb/config/i386/i386gnu.mh | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)

Index: src/gdb/Makefile.in
===================================================================
--- src.orig/gdb/Makefile.in 2008-09-09 15:10:33.000000000 +0100
+++ src/gdb/Makefile.in 2008-09-09 15:39:00.000000000 +0100
@@ -831,7 +831,8 @@ DISTSTUFF = $(YYFILES)

# All generated files which can be included by another file.
-generated_files = config.h observer.h observer.inc ada-lex.c $(GNULIB_H)
+generated_files = config.h observer.h observer.inc ada-lex.c \
+ $(GNULIB_H) $(host_generated_files)

.c.o:
$(COMPILE) $<
Index: src/gdb/config/i386/i386gnu.mh
===================================================================
--- src.orig/gdb/config/i386/i386gnu.mh 2008-09-09 15:24:54.000000000 +0100
+++ src/gdb/config/i386/i386gnu.mh 2008-09-09 15:37:11.000000000 +0100
@@ -29,3 +29,7 @@ MIGCOM = $(MIG) -cc cat - /dev/null
%_U.h %_U.c: %.defs
$(CPP) $(CPPFLAGS) $($*-MIGUFLAGS) -x c $< \
| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
+
+host_generated_files = notify_S.h notify_S.c process_reply_S.h process_reply_S.c \
+ msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
+ exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c