[RFA,13/13] Redefine REMOTE_OBS in terms of a list of sources

Message ID 20171121221023.23992-14-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Nov. 21, 2017, 10:10 p.m. UTC
  This introduces REMOTE_SRCS and redefines REMOTE_OBS in terms of it.

ChangeLog
2017-11-21  Tom Tromey  <tom@tromey.com>

	* Makefile.in (REMOTE_SRCS): New variable.
	(REMOTE_OBS): Redefine.
	(SFILES): Remove remote sources.  Use REMOTE_SRCS.
	(ALLDEPFILES): Remove dcache.c.
---
 gdb/ChangeLog   |  7 +++++++
 gdb/Makefile.in | 36 ++++++++++++++----------------------
 2 files changed, 21 insertions(+), 22 deletions(-)
  

Comments

Pedro Alves Nov. 22, 2017, 11:12 a.m. UTC | #1
On 11/21/2017 10:10 PM, Tom Tromey wrote:
> This introduces REMOTE_SRCS and redefines REMOTE_OBS in terms of it.
> 
> ChangeLog
> 2017-11-21  Tom Tromey  <tom@tromey.com>
> 
> 	* Makefile.in (REMOTE_SRCS): New variable.
> 	(REMOTE_OBS): Redefine.
> 	(SFILES): Remove remote sources.  Use REMOTE_SRCS.
> 	(ALLDEPFILES): Remove dcache.c.

This looks fine.

I think it'd be even better to get rid of REMOTE_SRCS and fold it into
the common sources.  The remote target is always included in the build,
no matter the target, nowadays.  There's no point in having these
in DEPFILES.  (And we used to have a ton of other/different remote
targets, using other protocols, and they're now all gone).  Also several
of those objects have code that is called directly from common code.

See "git grep REMOTE_OBS":

Mon Feb 25 16:02:35 1991  Cygnus John Gilmore  (cygnus at oldman)
...
        * Makefile.dist:  Distribute REMOTE_OBS into tconfig files.
        Separate INCLUDE_CFLAGS for use with lint.  Add LINTFILES.
        Add ieee-float.o to OBS.
        * tconfig/{nindy960,vxworks68,vxworks960}:  Include the desired
        REMOTE_OBS remote-interface files in the TDEPFILES and TM_FILE.
        * tconfig/i960:  FIXME.  Half-merge, produce warning if config'd.
...

If you want to go ahead and that, then it's pre-approved.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 6442b11103..b85201dc6d 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -616,19 +616,20 @@  XMLFILES = \
 # See configure.ac.
 SER_HARDWIRE = @SER_HARDWIRE@
 
-# The `remote' debugging target is supported for most architectures,
-# but not all (e.g. 960)
-REMOTE_OBS = \
-	ax-gdb.o \
-	ax-general.o \
-	ctf.o \
-	dcache.o \
-	remote.o \
-	remote-fileio.o \
-	remote-notif.o \
-	tracefile.o \
-	tracefile-tfile.o \
-	tracepoint.o
+# The `remote' debugging target support.
+REMOTE_SRCS = \
+	ax-gdb.c \
+	ax-general.c \
+	ctf.c \
+	dcache.c \
+	remote.c \
+	remote-fileio.c \
+	remote-notif.c \
+	tracefile.c \
+	tracefile-tfile.c \
+	tracepoint.c
+
+REMOTE_OBS = $(patsubst %.c,%.o,$(REMOTE_SRCS))
 
 # This is remote-sim.o if a simulator is to be linked in.
 SIM_OBS = @SIM_OBS@
@@ -1097,11 +1098,8 @@  COMMON_SFILES = \
 SFILES = \
 	ada-exp.y \
 	arch/i386.c \
-	ax-gdb.c \
-	ax-general.c \
 	c-exp.y \
 	cp-name-parser.y \
-	ctf.c \
 	d-exp.y \
 	dtrace-probe.c \
 	elfread.c \
@@ -1112,9 +1110,6 @@  SFILES = \
 	m2-exp.y \
 	p-exp.y \
 	proc-service.list \
-	remote.c \
-	remote-fileio.c \
-	remote-notif.c \
 	rust-exp.y \
 	ser-base.c \
 	ser-unix.c \
@@ -1122,7 +1117,6 @@  SFILES = \
 	stap-probe.c \
 	stub-termcap.c \
 	symfile-mem.c \
-	tracepoint.c \
 	ui-file.h \
 	common/agent.c \
 	common/btrace-common.c \
@@ -2235,8 +2229,6 @@  ALLDEPFILES = \
 	bsd-uthread.c \
 	core-regset.c \
 	darwin-nat.c \
-	dcache.c \
-	dcache.c \
 	dicos-tdep.c \
 	exec.c \
 	fbsd-nat.c \