From b22c88c2ca013cc25d7a8fcbc748122bb1a349bb Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 21 Nov 2017 12:15:33 -0700 Subject: [PATCH] A simpler way to make the "arch" build directory This implements a simpler way to make the "arch" build directory -- namely, now it is done as an order-only dependency in the Makefile, rather than being created when config.status is run. This simpler because it means that the build directories can be changed without re-running autoconf. ChangeLog 2017-11-27 Tom Tromey * configure.ac (CONFIG_SRC_SUBDIR): Don't subst. * configure: Rebuild. * Makefile.in (CONFIG_SRC_SUBDIR): Redefine. (CONFIG_DEP_SUBDIR): New variable. (%.o): Add order-only dependency. ($(CONFIG_DEP_SUBDIR)): New target. --- gdb/ChangeLog | 9 +++++++++ gdb/Makefile.in | 10 ++++++++-- gdb/configure | 15 --------------- gdb/configure.ac | 11 ----------- 4 files changed, 17 insertions(+), 28 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6134efc..e3c5063 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2017-11-27 Tom Tromey + + * configure.ac (CONFIG_SRC_SUBDIR): Don't subst. + * configure: Rebuild. + * Makefile.in (CONFIG_SRC_SUBDIR): Redefine. + (CONFIG_DEP_SUBDIR): New variable. + (%.o): Add order-only dependency. + ($(CONFIG_DEP_SUBDIR)): New target. + 2017-11-26 Dominik Czarnota PR gdb/21945 diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 7198556..bbe4287 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -645,9 +645,11 @@ CONFIG_ALL = @CONFIG_ALL@ CONFIG_CLEAN = @CONFIG_CLEAN@ CONFIG_INSTALL = @CONFIG_INSTALL@ CONFIG_UNINSTALL = @CONFIG_UNINSTALL@ -CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@ HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@ +CONFIG_SRC_SUBDIR = arch +CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR)) + # -I. for config files. # -I$(srcdir) for gdb internal headers. # -I$(srcdir)/config for more generic config files. @@ -1927,10 +1929,14 @@ all: gdb$(EXEEXT) $(CONFIG_ALL) @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do # Rule for compiling .c files in the top-level gdb directory. -%.o: %.c +# The order-only dependencies ensure that we create the build subdirectories. +%.o: %.c | $(CONFIG_DEP_SUBDIR) $(COMPILE) $< $(POSTCOMPILE) +$(CONFIG_DEP_SUBDIR): + $(SHELL) $(srcdir)/../mkinstalldirs $@ + # Rules for compiling .c files in the various source subdirectories. %.o: $(srcdir)/cli/%.c $(COMPILE) $< diff --git a/gdb/configure b/gdb/configure index 55544fb..7655b45 100755 --- a/gdb/configure +++ b/gdb/configure @@ -736,7 +736,6 @@ LIBINTL_DEP LIBINTL USE_NLS CCDEPMODE -CONFIG_SRC_SUBDIR DEPDIR am__leading_dot CXX_DIALECT @@ -5958,13 +5957,6 @@ DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depdir" -# Create sub-directories for objects and dependencies. -CONFIG_SRC_SUBDIR="arch" - - -ac_config_commands="$ac_config_commands gdbdepdir" - - depcc="$CC" am_compiler_list= am_depcomp=$ac_aux_dir/depcomp @@ -18512,7 +18504,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # INIT-COMMANDS # ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR -ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR" _ACEOF @@ -18524,7 +18515,6 @@ do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;; - "gdbdepdir") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbdepdir" ;; "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;; "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;; "gcore") CONFIG_FILES="$CONFIG_FILES gcore" ;; @@ -19148,11 +19138,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;; - "gdbdepdir":C) - for subdir in ${CONFIG_SRC_SUBDIR} - do - $SHELL $ac_aux_dir/mkinstalldirs $subdir/$DEPDIR - done ;; "gcore":F) chmod +x gcore ;; "Makefile":F) case x$CONFIG_HEADERS in diff --git a/gdb/configure.ac b/gdb/configure.ac index d43899c..5ded21a 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -44,17 +44,6 @@ AX_CXX_COMPILE_STDCXX(11, , mandatory) # Dependency checking. ZW_CREATE_DEPDIR -# Create sub-directories for objects and dependencies. -CONFIG_SRC_SUBDIR="arch" -AC_SUBST(CONFIG_SRC_SUBDIR) - -AC_CONFIG_COMMANDS([gdbdepdir],[ - for subdir in ${CONFIG_SRC_SUBDIR} - do - $SHELL $ac_aux_dir/mkinstalldirs $subdir/$DEPDIR - done], - [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR"]) - ZW_PROG_COMPILER_DEPENDENCIES([CC]) gnulib_extra_configure_args= -- 2.7.4