Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PUSHED] gdb: store gdbtk object files into their sources directory
@ 2026-04-11 14:11 Patrick Monnerat
  2026-06-07  6:19 ` Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Monnerat @ 2026-04-11 14:11 UTC (permalink / raw)
  To: gdb-patches; +Cc: Patrick Monnerat

Do not list gdbtk required object file names, but generates them from
source file names.

Use gdb object file list rather than static library for linking insight.
---
 gdb/Makefile.in | 31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 81a601dc448..b235edf6356 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -559,29 +559,19 @@ GDBTK_LIBRARY = $(datadir)/insight$(GDBTK_VERSION)
 # the testsuite won't run properly.
 GDBTK_SRC_DIR = @GDBTK_SRC_DIR@
 
-SUBDIR_GDBTK_OBS = \
-	gdbtk.o \
-	gdbtk-bp.o \
-	gdbtk-cmds.o \
-	gdbtk-hooks.o \
-	gdbtk-interp.o \
-	gdbtk-register.o \
-	gdbtk-stack.o \
-	gdbtk-varobj.o \
-	gdbtk-wrapper.o
-
 SUBDIR_GDBTK_SRCS = \
 	gdbtk/generic/gdbtk.c \
 	gdbtk/generic/gdbtk-bp.c \
 	gdbtk/generic/gdbtk-cmds.c \
 	gdbtk/generic/gdbtk-hooks.c \
 	gdbtk/generic/gdbtk-interp.c \
-	gdbtk/generic/gdbtk-main.c \
 	gdbtk/generic/gdbtk-register.c \
 	gdbtk/generic/gdbtk-stack.c \
 	gdbtk/generic/gdbtk-varobj.c \
 	gdbtk/generic/gdbtk-wrapper.c
 
+SUBDIR_GDBTK_OBS = $(patsubst %.c,%.o,$(SUBDIR_GDBTK_SRCS))
+
 SUBDIR_GDBTK_DEPS = $(LIBGUI) $(TCL_DEPS) $(TK_DEPS)
 SUBDIR_GDBTK_LDFLAGS =
 SUBDIR_GDBTK_CFLAGS= -DGDBTK -D@TCL_PLATFORM_DEFINE@ -D@TK_PLATFORM_DEFINE@
@@ -599,7 +589,7 @@ HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
 HAVE_GSTACK = @HAVE_GSTACK@
 
 CONFIG_SRC_SUBDIR = arch cli dwarf2 mi compile tui unittests guile python \
-	target nat
+	target nat gdbtk/generic
 CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 
 # -I. for config files.
@@ -2110,10 +2100,8 @@ $(CONFIG_DEP_SUBDIR):
 # Python files need special flags.
 python/%.o: INTERNAL_CFLAGS += $(PYTHON_CFLAGS)
 
-# Rules for compiling .c files in the various source subdirectories.
-%.o: $(srcdir)/gdbtk/generic/%.c
-	$(COMPILE) $(all_gdbtk_cflags) $<
-	$(POSTCOMPILE)
+# Insight UI needs special flags.
+gdbtk/generic/%.o: INTERNAL_CFLAGS += $(all_gdbtk_cflags)
 
 installcheck:
 
@@ -2343,6 +2331,7 @@ uninstall: force $(CONFIG_UNINSTALL)
 # computing the list of source files from the list of object files.
 
 INIT_FILES_FILTER_OUT = \
+	gdbres.o \
 	init.o \
 	version.o \
 	xml-builtin.o \
@@ -2824,10 +2813,10 @@ clean-gdbtk:
 	rm -f insight$(EXEEXT)
 
 # Removing the old gdb first works better if it is running, at least on SunOS.
-insight$(EXEEXT): gdbtk-main.o libgdb.a $(CDEPS) $(TDEPLIBS)
-	rm -f insight$(EXEEXT)
+insight$(EXEEXT): gdbtk/generic/gdbtk-main.o $(LIBGDB_OBS) $(CDEPS) $(TDEPLIBS)
+	$(SILENCE) rm -f insight$(EXEEXT)
 	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
-		-o insight$(EXEEXT) gdbtk-main.o libgdb.a \
+		-o insight$(EXEEXT) gdbtk/generic/gdbtk-main.o $(LIBGDB_OBS) \
 		$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
 
 gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
@@ -2862,7 +2851,7 @@ endif
 
 # A list of all the objects we might care about in this build, for
 # dependency tracking.
-all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o
+all_object_files = gdb.o $(LIBGDB_OBS) gdbtk/generic/gdbtk-main.o
 
 # All the .deps files to include.
 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PUSHED] gdb: store gdbtk object files into their sources directory
  2026-04-11 14:11 [PUSHED] gdb: store gdbtk object files into their sources directory Patrick Monnerat
@ 2026-06-07  6:19 ` Tom de Vries
  0 siblings, 0 replies; 2+ messages in thread
From: Tom de Vries @ 2026-06-07  6:19 UTC (permalink / raw)
  To: Patrick Monnerat, gdb-patches

On 4/11/26 4:11 PM, Patrick Monnerat wrote:
> Do not list gdbtk required object file names, but generates them from
> source file names.
> 
> Use gdb object file list rather than static library for linking insight.

This breaks building gdb.pot ( 
https://sourceware.org/bugzilla/show_bug.cgi?id=34212 ).

Thanks,
- Tom

> ---
>   gdb/Makefile.in | 31 ++++++++++---------------------
>   1 file changed, 10 insertions(+), 21 deletions(-)
> 
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index 81a601dc448..b235edf6356 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -559,29 +559,19 @@ GDBTK_LIBRARY = $(datadir)/insight$(GDBTK_VERSION)
>   # the testsuite won't run properly.
>   GDBTK_SRC_DIR = @GDBTK_SRC_DIR@
>   
> -SUBDIR_GDBTK_OBS = \
> -	gdbtk.o \
> -	gdbtk-bp.o \
> -	gdbtk-cmds.o \
> -	gdbtk-hooks.o \
> -	gdbtk-interp.o \
> -	gdbtk-register.o \
> -	gdbtk-stack.o \
> -	gdbtk-varobj.o \
> -	gdbtk-wrapper.o
> -
>   SUBDIR_GDBTK_SRCS = \
>   	gdbtk/generic/gdbtk.c \
>   	gdbtk/generic/gdbtk-bp.c \
>   	gdbtk/generic/gdbtk-cmds.c \
>   	gdbtk/generic/gdbtk-hooks.c \
>   	gdbtk/generic/gdbtk-interp.c \
> -	gdbtk/generic/gdbtk-main.c \
>   	gdbtk/generic/gdbtk-register.c \
>   	gdbtk/generic/gdbtk-stack.c \
>   	gdbtk/generic/gdbtk-varobj.c \
>   	gdbtk/generic/gdbtk-wrapper.c
>   
> +SUBDIR_GDBTK_OBS = $(patsubst %.c,%.o,$(SUBDIR_GDBTK_SRCS))
> +
>   SUBDIR_GDBTK_DEPS = $(LIBGUI) $(TCL_DEPS) $(TK_DEPS)
>   SUBDIR_GDBTK_LDFLAGS =
>   SUBDIR_GDBTK_CFLAGS= -DGDBTK -D@TCL_PLATFORM_DEFINE@ -D@TK_PLATFORM_DEFINE@
> @@ -599,7 +589,7 @@ HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
>   HAVE_GSTACK = @HAVE_GSTACK@
>   
>   CONFIG_SRC_SUBDIR = arch cli dwarf2 mi compile tui unittests guile python \
> -	target nat
> +	target nat gdbtk/generic
>   CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
>   
>   # -I. for config files.
> @@ -2110,10 +2100,8 @@ $(CONFIG_DEP_SUBDIR):
>   # Python files need special flags.
>   python/%.o: INTERNAL_CFLAGS += $(PYTHON_CFLAGS)
>   
> -# Rules for compiling .c files in the various source subdirectories.
> -%.o: $(srcdir)/gdbtk/generic/%.c
> -	$(COMPILE) $(all_gdbtk_cflags) $<
> -	$(POSTCOMPILE)
> +# Insight UI needs special flags.
> +gdbtk/generic/%.o: INTERNAL_CFLAGS += $(all_gdbtk_cflags)
>   
>   installcheck:
>   
> @@ -2343,6 +2331,7 @@ uninstall: force $(CONFIG_UNINSTALL)
>   # computing the list of source files from the list of object files.
>   
>   INIT_FILES_FILTER_OUT = \
> +	gdbres.o \
>   	init.o \
>   	version.o \
>   	xml-builtin.o \
> @@ -2824,10 +2813,10 @@ clean-gdbtk:
>   	rm -f insight$(EXEEXT)
>   
>   # Removing the old gdb first works better if it is running, at least on SunOS.
> -insight$(EXEEXT): gdbtk-main.o libgdb.a $(CDEPS) $(TDEPLIBS)
> -	rm -f insight$(EXEEXT)
> +insight$(EXEEXT): gdbtk/generic/gdbtk-main.o $(LIBGDB_OBS) $(CDEPS) $(TDEPLIBS)
> +	$(SILENCE) rm -f insight$(EXEEXT)
>   	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
> -		-o insight$(EXEEXT) gdbtk-main.o libgdb.a \
> +		-o insight$(EXEEXT) gdbtk/generic/gdbtk-main.o $(LIBGDB_OBS) \
>   		$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
>   
>   gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
> @@ -2862,7 +2851,7 @@ endif
>   
>   # A list of all the objects we might care about in this build, for
>   # dependency tracking.
> -all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o
> +all_object_files = gdb.o $(LIBGDB_OBS) gdbtk/generic/gdbtk-main.o
>   
>   # All the .deps files to include.
>   all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-07  6:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-11 14:11 [PUSHED] gdb: store gdbtk object files into their sources directory Patrick Monnerat
2026-06-07  6:19 ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox