[commit] Simplify subdir config

Andrew Cagney
2004-02-08T04:27:58Z

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

Hello,

This simplfies the handling of subdirectories:

- all the subdir object files now go in libgdb.a
both ./gdb and ./tui always need to link against them

- puts "main.o" in libgdb.a
again ./gdb and ./tui always link against it

- deletes CONFIG_INIT and CONFIG_LIB_OBS
as they overlap CONFIG_SRCS and CONFIG_OBS

committed,
Andrew

PS: And configures with the correct autoconf. Patch for ./tui pending.

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 6962 bytes --]

2004-02-07 Andrew Cagney <cagney@redhat.com>

* configure.in (CONFIG_INITS, CONFIG_LIB_OBS): Delete.
* configure: Re-generate (with correct autoconf).
* Makefile.in (INIT_FILES): Replace CONFIG_INITS with CONFIG_SRCS.
(CONFIG_LIB_OBS, CONFIG_INITS): Delete.
(COMMON_OBS): Add "main.o" and "annotate.o".
(ANNOTATE_OBS): Delete.
(OBS): Remove ANNOTATE_OBS.
(DEPFILES): Replace CONFIG_LIB_OBS with CONFIG_LIB_OBS, remove
CONFIG_INITS.
(gdb$(EXEEXT), insight$(EXEEXT)): Do not depend on, or link
against CONFIG_OBS and "main.o".
(SUBDIR_CLI_INITS, SUBDIR_MI_INITS): Delete.
(SUBDIR_TUI_INITS, SUBDIR_GDBTK_INITS): Delete.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.487
diff -u -r1.487 Makefile.in
--- Makefile.in 4 Feb 2004 21:49:55 -0000 1.487
+++ Makefile.in 8 Feb 2004 04:16:09 -0000
@@ -152,8 +152,6 @@
cli/cli-interp.c \
cli/cli-utils.c
SUBDIR_CLI_DEPS =
-SUBDIR_CLI_INITS = \
- $(SUBDIR_CLI_SRCS)
SUBDIR_CLI_LDFLAGS=
SUBDIR_CLI_CFLAGS=
SUBDIR_CLI_ALL=
@@ -178,8 +176,6 @@
mi/mi-interp.c \
mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c
SUBDIR_MI_DEPS =
-SUBDIR_MI_INITS = \
- $(SUBDIR_MI_SRCS)
SUBDIR_MI_LDFLAGS=
SUBDIR_MI_CFLAGS= \
-DMI_OUT=1
@@ -227,8 +223,6 @@
tui/tui-winsource.c \
tui/tui.c
SUBDIR_TUI_DEPS =
-SUBDIR_TUI_INITS = \
- $(SUBDIR_TUI_SRCS)
SUBDIR_TUI_LDFLAGS=
SUBDIR_TUI_CFLAGS= \
-DTUI=1 -I${srcdir}/tui
@@ -310,7 +304,6 @@
gdbtk/generic/gdbtk-main.c
SUBDIR_GDBTK_DEPS = \
$(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TK_DEPS) $(TCL_DEPS)
-SUBDIR_GDBTK_INITS = gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-interp.c
SUBDIR_GDBTK_LDFLAGS=
SUBDIR_GDBTK_CFLAGS= -DGDBTK
SUBDIR_GDBTK_ALL= all-gdbtk
@@ -319,10 +312,8 @@
SUBDIR_GDBTK_UNINSTALL= uninstall-gdbtk

CONFIG_OBS= @CONFIG_OBS@
-CONFIG_LIB_OBS= @CONFIG_LIB_OBS@
CONFIG_SRCS= @CONFIG_SRCS@
CONFIG_DEPS= @CONFIG_DEPS@
-CONFIG_INITS= @CONFIG_INITS@
CONFIG_LDFLAGS = @CONFIG_LDFLAGS@
ENABLE_CFLAGS= @ENABLE_CFLAGS@
CONFIG_ALL= @CONFIG_ALL@
@@ -424,8 +415,6 @@
# This is remote-sim.o if a simulator is to be linked in.
SIM_OBS =

-ANNOTATE_OBS = annotate.o
-
# Host and target-dependent makefile fragments come in here.
@host_makefile_frag@
@target_makefile_frag@
@@ -882,7 +871,7 @@
# Makefile.in

DEPFILES = $(TDEPFILES) $(SER_HARDWIRE) $(NATDEPFILES) \
- $(REMOTE_OBS) $(SIM_OBS) $(CONFIG_LIB_OBS)
+ $(REMOTE_OBS) $(SIM_OBS) $(CONFIG_OBS)

SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) $(CONFIG_SRCS)
# Don't include YYFILES (*.tab.c) because we already include *.y in SFILES,
@@ -892,6 +881,7 @@
TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)

COMMON_OBS = version.o \
+ annotate.o \
auxv.o \
bfd-target.o \
blockframe.o breakpoint.o findvar.o regcache.o \
@@ -902,6 +892,7 @@
infcmd.o infrun.o \
expprint.o environ.o stack.o thread.o \
interps.o \
+ main.o \
macrotab.o macrocmd.o macroexp.o macroscope.o \
event-loop.o event-top.o inf-loop.o completer.o \
gdbarch.o arch-utils.o gdbtypes.o osabi.o copying.o $(DEPFILES) \
@@ -934,7 +925,7 @@
reggroups.o \
trad-frame.o

-OBS = $(COMMON_OBS) $(ANNOTATE_OBS)
+OBS = $(COMMON_OBS)

TSOBS = inflow.o

@@ -1051,7 +1042,7 @@
# automatically adds the $(srcdir) prefixes when it encounters files
# in sub-directories such as cli/ and mi/.

-INIT_FILES = $(OBS) $(TSOBS) $(CONFIG_OBS) $(CONFIG_INITS)
+INIT_FILES = $(OBS) $(TSOBS) $(CONFIG_SRCS)
init.c: $(INIT_FILES)
@echo Making init.c
@rm -f init.c-tmp init.l-tmp
@@ -1092,10 +1083,10 @@
init.o: init.c $(defs_h) $(call_cmds_h)

# Removing the old gdb first works better if it is running, at least on SunOS.
-gdb$(EXEEXT): gdb.o main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
+gdb$(EXEEXT): gdb.o libgdb.a $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
rm -f gdb$(EXEEXT)
$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
- -o gdb$(EXEEXT) gdb.o main.o $(CONFIG_OBS) libgdb.a \
+ -o gdb$(EXEEXT) gdb.o libgdb.a \
$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)

nlm: force
@@ -2628,11 +2619,11 @@
rm -f insight$(EXEEXT)

# Removing the old gdb first works better if it is running, at least on SunOS.
-insight$(EXEEXT): gdbtk-main.o main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) \
+insight$(EXEEXT): gdbtk-main.o libgdb.a $(ADD_DEPS) \
$(CDEPS) $(TDEPLIBS)
rm -f insight$(EXEEXT)
$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
- -o insight$(EXEEXT) gdbtk-main.o main.o $(CONFIG_OBS) libgdb.a \
+ -o insight$(EXEEXT) gdbtk-main.o libgdb.a \
$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)

gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.141
diff -u -r1.141 configure.in
--- configure.in 29 Jan 2004 21:54:34 -0000 1.141
+++ configure.in 8 Feb 2004 04:16:30 -0000
@@ -60,10 +60,8 @@
dnl List of object files added by configure.

CONFIG_OBS=
-CONFIG_LIB_OBS=
CONFIG_DEPS=
CONFIG_SRCS=
-CONFIG_INITS=
ENABLE_CFLAGS=
CONFIG_ALL=
CONFIG_CLEAN=
@@ -114,7 +112,6 @@
CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)"
CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)"
CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)"
- CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_CLI_INITS)"
ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)"
CONFIG_ALL="$CONFIG_ALL \$(SUBDIR_CLI_ALL)"
CONFIG_CLEAN="$CONFIG_CLEAN \$(SUBDIR_CLI_CLEAN)"
@@ -138,7 +135,6 @@
CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)"
CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)"
CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)"
- CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_MI_INITS)"
ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)"
CONFIG_ALL="$CONFIG_ALL \$(SUBDIR_MI_ALL)"
CONFIG_CLEAN="$CONFIG_CLEAN \$(SUBDIR_MI_CLEAN)"
@@ -161,7 +157,6 @@
CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
- CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
CONFIG_ALL="$CONFIG_ALL \$(SUBDIR_TUI_ALL)"
CONFIG_CLEAN="$CONFIG_CLEAN \$(SUBDIR_TUI_CLEAN)"
@@ -1214,7 +1209,6 @@
CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)"
CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)"
CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)"
- CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_GDBTK_INITS)"
CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_GDBTK_ALL)"
CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_GDBTK_CLEAN)"
CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
@@ -1284,10 +1278,8 @@
AC_SUBST(PROFILE_CFLAGS)

AC_SUBST(CONFIG_OBS)
-AC_SUBST(CONFIG_LIB_OBS)
AC_SUBST(CONFIG_DEPS)
AC_SUBST(CONFIG_SRCS)
-AC_SUBST(CONFIG_INITS)
AC_SUBST(CONFIG_ALL)
AC_SUBST(CONFIG_CLEAN)
AC_SUBST(CONFIG_INSTALL)