Fix 'make TAGS' in gdbserver
authorTom Tromey <tom@tromey.com>
Fri, 23 Dec 2022 20:28:20 +0000 (13:28 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 18 Jan 2023 18:12:20 +0000 (11:12 -0700)
PR build/29003 points out that "make TAGS" is broken in gdbserver.
This patch fixes the problem that is pointed out there, plus another
one I noticed while working on that -- namely that the "sed" computes
the wrong names for some source files.  Finally, a couple of obsolete
variable references are removed.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29003

gdbserver/Makefile.in

index 040f0b6faa0d3f78fa88e0fb67a57eef5246c671..39cb9e7a1512379510736a86e1ac96107f658ceb 100644 (file)
@@ -235,7 +235,7 @@ DEPFILES = @GDBSERVER_DEPFILES@
 LIBOBJS = @LIBOBJS@
 
 SOURCES = $(SFILES)
-TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
+TAGFILES = $(SOURCES)
 
 OBS = \
        alloc.o \
@@ -398,8 +398,9 @@ TAGS:       ${TAGFILES}
        etags \
          `for i in yzzy ${DEPFILES}; do \
             if [ x$$i != xyzzy ]; then \
-              echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
-                -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
+              echo ${srcdir}/$$i | \
+                sed -e 's,/\(\(arch\|nat\|target\)/.*\)\.o$$,/../gdb/\1.c,' \
+                    -e 's/\.o$$/\.cc/'; \
             fi; \
           done` \
          ${TAGFILES}