* [PATCH 0/4] Require GNU make @ 2016-11-16 16:11 Simon Marchi 2016-11-16 16:10 ` [PATCH 4/4] Makefile: Replace explicit subdir rules with pattern rules Simon Marchi ` (4 more replies) 0 siblings, 5 replies; 35+ messages in thread From: Simon Marchi @ 2016-11-16 16:11 UTC (permalink / raw) To: gdb-patches; +Cc: Simon Marchi Following the discussions in https://sourceware.org/ml/gdb-patches/2016-11/msg00326.html I am sending this patch series which makes GNU make mandatory for building GDB and GDBserver. - Patch 1 simply updates the NEWS file - Patch 2 removes code that is conditional on make being GNU make or not. - Patches 3 and 4 make use of pattern rules, a GNU make-specific feature. Patches 3 and 4 replace patches 1 and 2 in the original series. Simon Marchi (4): Document new hard requirement on GNU make Remove code that checks for GNU/non-GNU make Makefile: Replace old suffix rules with pattern rules Makefile: Replace explicit subdir rules with pattern rules gdb/Makefile.in | 835 +++++---------------------------------------- gdb/NEWS | 5 + gdb/configure | 97 ------ gdb/configure.ac | 11 - gdb/gdbserver/Makefile.in | 36 +- gdb/gdbserver/configure | 97 ------ gdb/gdbserver/configure.ac | 11 - gdb/testsuite/Makefile.in | 88 +++-- gdb/testsuite/configure | 99 ------ gdb/testsuite/configure.ac | 11 - 10 files changed, 141 insertions(+), 1149 deletions(-) -- 2.10.2 ^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 4/4] Makefile: Replace explicit subdir rules with pattern rules 2016-11-16 16:11 [PATCH 0/4] Require GNU make Simon Marchi @ 2016-11-16 16:10 ` Simon Marchi 2016-11-16 17:11 ` Pedro Alves 2016-11-16 16:12 ` [PATCH 1/4] Document new hard requirement on GNU make Simon Marchi ` (3 subsequent siblings) 4 siblings, 1 reply; 35+ messages in thread From: Simon Marchi @ 2016-11-16 16:10 UTC (permalink / raw) To: gdb-patches; +Cc: Simon Marchi From: Simon Marchi <simon.marchi@polymtl.ca> When adding a .c file in subdirectory (e.g. mi/), the current practice is to add an explicit rule, such as: mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(COMPILE) $(srcdir)/mi/mi-cmd-break.c $(POSTCOMPILE) I find it a bit verbose and cumbersome. Since we now require GNU make, we can change those rules with pattern rules, one for each subdirectory. For example, the following rule works for all files under mi: %.o: $(srcdir)/mi/%.c $(COMPILE) $< $(POSTCOMPILE) Those pattern rules assume that the source and target files have the same stem (foo.c and foo.o). In one case, common-agent.o is generated from common/agent.c, to avoid a conflict with the agent.o in gdb/. In this case, I kept the explicit rule, which takes precedence over the pattern rule. We could also rename common/agent.c to common/common-agent.c to get rid of the special case and still avoid the clash, as it is done with common/common-regcache.c, for example. This strategy was the least intrusive I found, as it only requires changing the rules, not the target names. I also considered two other solutions, which I did not like because I would have had to change target names a bit everywhere. - Replicate the source directory structure in the build directory, which would generate common/agent.o from common/agent.c. However, something was not right with the dependency tracking (the .deps directory). It's probably not hard to fix, but I did not investigate further. - Name the object files after the directory they are in, so that common/agent.c would generate common_agent.c. GDBserver can benefit from the same treatment, but I'll do it in another patch. Built-tested with --enable-targets=all. New in v2: - Regroup pattern rules for .c -> .o compilation in a single place. - Add comment about common-agent.o. gdb/ChangeLog: (PYTHON_CFLAGS): Move up. (%.o: $(srcdir)/arch/%.c): New rule. (%.o: $(srcdir)/cli/%.c): New rule. (%.o: $(srcdir)/common/%.c): New rule. (%.o: $(srcdir)/compile/%.c): New rule. (%.o: $(srcdir)/gdbtk/generic/%.c): New rule. (%.o: $(srcdir)/guile/%.c): New rule. (%.o: $(srcdir)/mi/%.c): New rule. (%.o: $(srcdir)/nat/%.c): New rule. (%.o: $(srcdir)/python/%.c): New rule. (%.o: $(srcdir)/target/%.c): New rule. (%.o: $(srcdir)/tui/%.c): New rule. (cli-cmds.o): Remove. (cli-decode.o): Likewise. (cli-dump.o): Likewise. (cli-interp.o): Likewise. (cli-logging.o): Likewise. (cli-script.o): Likewise. (cli-setshow.o): Likewise. (cli-utils.o): Likewise. (compile.o): Likewise. (compile-c-types.o): Likewise. (compile-c-symbols.o): Likewise. (compile-object-load.o): Likewise. (compile-object-run.o): Likewise. (compile-loc2c.o): Likewise. (compile-c-support.o): Likewise. (gdbtk.o): Likewise. (gdbtk-bp.o): Likewise. (gdbtk-cmds.o): Likewise. (gdbtk-hooks.o): Likewise. (gdbtk-interp.o): Likewise. (gdbtk-main.o): Likewise. (gdbtk-register.o): Likewise. (gdbtk-stack.o): Likewise. (gdbtk-varobj.o): Likewise. (gdbtk-wrapper.o): Likewise. (mi-cmd-break.o): Likewise. (mi-cmd-catch.o): Likewise. (mi-cmd-disas.o): Likewise. (mi-cmd-env.o): Likewise. (mi-cmd-file.o): Likewise. (mi-cmd-info.o): Likewise. (mi-cmds.o): Likewise. (mi-cmd-stack.o): Likewise. (mi-cmd-target.o): Likewise. (mi-cmd-var.o): Likewise. (mi-console.o): Likewise. (mi-getopt.o): Likewise. (mi-interp.o): Likewise. (mi-main.o): Likewise. (mi-out.o): Likewise. (mi-parse.o): Likewise. (mi-symbol-cmds.o): Likewise. (mi-common.o): Likewise. (signals.o): Likewise. (common-utils.o): Likewise. (gdb_vecs.o): Likewise. (xml-utils.o): Likewise. (ptid.o): Likewise. (buffer.o): Likewise. (filestuff.o): Likewise. (format.o): Likewise. (vec.o): Likewise. (print-utils.o): Likewise. (rsp-low.o): Likewise. (errors.o): Likewise. (common-debug.o): Likewise. (cleanups.o): Likewise. (common-exceptions.o (posix-strerror.o): Likewise. (mingw-strerror.o): Likewise. (btrace-common.o): Likewise. (fileio.o): Likewise. (common-regcache.o): Likewise. (signals-state-save-restore.o): Likewise. (new-op.o): Likewise. (waitstatus.o): Likewise. (arm.o): Likewise. (arm-linux.o): Likewise. (arm-get-next-pcs.o): Likewise. (x86-dregs.o): Likewise. (linux-btrace.o): Likewise. (linux-osdata.o): Likewise. (linux-procfs.o): Likewise. (linux-ptrace.o): Likewise. (linux-waitpid.o): Likewise. (mips-linux-watch.o): Likewise. (ppc-linux.o): Likewise. (linux-personality.o): Likewise. (x86-linux.o): Likewise. (x86-linux-dregs.o): Likewise. (amd64-linux-siginfo.o): Likewise. (linux-namespaces.o): Likewise. (aarch64-linux-hw-point.o): Likewise. (aarch64-linux.o): Likewise. (aarch64-insn.o): Likewise. (tui.o): Likewise. (tui-command.o): Likewise. (tui-data.o): Likewise. (tui-disasm.o): Likewise. (tui-file.o): Likewise. (tui-hooks.o): Likewise. (tui-interp.o): Likewise. (tui-io.o): Likewise. (tui-layout.o): Likewise. (tui-out.o): Likewise. (tui-regs.o): Likewise. (tui-source.o): Likewise. (tui-stack.o): Likewise. (tui-win.o): Likewise. (tui-windata.o): Likewise. (tui-wingeneral.o): Likewise. (tui-winsource.o): Likewise. (guile.o): Likewise. (scm-arch.o): Likewise. (scm-auto-load.o): Likewise. (scm-block.o): Likewise. (scm-breakpoint.o): Likewise. (scm-cmd.o): Likewise. (scm-disasm.o): Likewise. (scm-exception.o): Likewise. (scm-frame.o): Likewise. (scm-gsmob.o): Likewise. (scm-iterator.o): Likewise. (scm-lazy-string.o): Likewise. (scm-math.o): Likewise. (scm-objfile.o): Likewise. (scm-param.o): Likewise. (scm-ports.o): Likewise. (scm-pretty-print.o): Likewise. (scm-progspace.o): Likewise. (scm-safe-call.o): Likewise. (scm-string.o): Likewise. (scm-symbol.o): Likewise. (scm-symtab.o): Likewise. (scm-type.o): Likewise. (scm-utils.o): Likewise. (scm-value.o): Likewise. (python.o): Likewise. (py-arch.o): Likewise. (py-auto-load.o): Likewise. (py-block.o): Likewise. (py-bpevent.o): Likewise. (py-breakpoint.o): Likewise. (py-cmd.o): Likewise. (py-continueevent.o): Likewise. (py-xmethods.o): Likewise. (py-event.o): Likewise. (py-evtregistry.o): Likewise. (py-evts.o): Likewise. (py-exitedevent.o): Likewise. (py-finishbreakpoint.o): Likewise. (py-frame.o): Likewise. (py-framefilter.o): Likewise. (py-function.o): Likewise. (py-gdb-readline.o): Likewise. (py-inferior.o): Likewise. (py-infevents.o): Likewise. (py-infthread.o): Likewise. (py-lazy-string.o): Likewise. (py-linetable.o): Likewise. (py-newobjfileevent.o): Likewise. (py-objfile.o): Likewise. (py-param.o): Likewise. (py-prettyprint.o): Likewise. (py-progspace.o): Likewise. (py-signalevent.o): Likewise. (py-stopevent.o): Likewise. (py-symbol.o): Likewise. (py-symtab.o): Likewise. (py-threadevent.o): Likewise. (py-type.o): Likewise. (py-unwind.o): Likewise. (py-utils.o): Likewise. (py-value.o): Likewise. (py-varobj.o): Likewise. --- gdb/Makefile.in | 789 ++++---------------------------------------------------- 1 file changed, 56 insertions(+), 733 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index fe10a8d..1d6da4b 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1122,12 +1122,66 @@ DISTSTUFF = $(YYFILES) generated_files = config.h observer.h observer.inc ada-lex.c jit-reader.h \ $(GNULIB_H) $(NAT_GENERATED_FILES) gcore +# Flags needed to compile Python code +PYTHON_CFLAGS=@PYTHON_CFLAGS@ + +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 $(COMPILE) $< $(POSTCOMPILE) -all: gdb$(EXEEXT) $(CONFIG_ALL) - @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do +# Rules for compiling .c files in the various source subdirectories. +%.o: ${srcdir}/arch/%.c + $(COMPILE) $< + $(POSTCOMPILE) + +%.o: $(srcdir)/cli/%.c + $(COMPILE) $< + $(POSTCOMPILE) + +%.o: ${srcdir}/common/%.c + $(COMPILE) $< + $(POSTCOMPILE) + +%.o: $(srcdir)/compile/%.c + $(COMPILE) $< + $(POSTCOMPILE) + +%.o: $(srcdir)/gdbtk/generic/%.c + $(COMPILE) $(all_gdbtk_cflags) %< + $(POSTCOMPILE) + +%.o: $(srcdir)/guile/%.c + $(COMPILE) $< + $(POSTCOMPILE) + +%.o: $(srcdir)/mi/%.c + $(COMPILE) $< + +%.o: ${srcdir}/nat/%.c + $(COMPILE) $< + $(POSTCOMPILE) + +%.o: $(srcdir)/python/%.c + $(COMPILE) $(PYTHON_CFLAGS) $< + $(POSTCOMPILE) + +%.o: ${srcdir}/target/%.c + $(COMPILE) $< + $(POSTCOMPILE) + +%.o: $(srcdir)/tui/%.c + $(COMPILE) $< + $(POSTCOMPILE) + +# Specify an explicit rule for gdb/common/agent.c, to avoid a clash with the +# object file generate by gdb/agent.c. +common-agent.o: $(srcdir)/common/agent.c + $(COMPILE) $(srcdir)/common/agent.c + $(POSTCOMPILE) installcheck: @@ -1934,82 +1988,8 @@ stamp-xml: $(srcdir)/features/feature_to_c.sh Makefile $(XMLFILES) .PRECIOUS: xml-builtin.c # -# gdb/cli/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -cli-cmds.o: $(srcdir)/cli/cli-cmds.c - $(COMPILE) $(srcdir)/cli/cli-cmds.c - $(POSTCOMPILE) - -cli-decode.o: $(srcdir)/cli/cli-decode.c - $(COMPILE) $(srcdir)/cli/cli-decode.c - $(POSTCOMPILE) - -cli-dump.o: $(srcdir)/cli/cli-dump.c - $(COMPILE) $(srcdir)/cli/cli-dump.c - $(POSTCOMPILE) - -cli-interp.o: $(srcdir)/cli/cli-interp.c - $(COMPILE) $(srcdir)/cli/cli-interp.c - $(POSTCOMPILE) - -cli-logging.o: $(srcdir)/cli/cli-logging.c - $(COMPILE) $(srcdir)/cli/cli-logging.c - $(POSTCOMPILE) - -cli-script.o: $(srcdir)/cli/cli-script.c - $(COMPILE) $(srcdir)/cli/cli-script.c - $(POSTCOMPILE) - -cli-setshow.o: $(srcdir)/cli/cli-setshow.c - $(COMPILE) $(srcdir)/cli/cli-setshow.c - $(POSTCOMPILE) - -cli-utils.o: $(srcdir)/cli/cli-utils.c - $(COMPILE) $(srcdir)/cli/cli-utils.c - $(POSTCOMPILE) - -# GCC Compile support dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -compile.o: $(srcdir)/compile/compile.c - $(COMPILE) $(srcdir)/compile/compile.c - $(POSTCOMPILE) - -compile-c-types.o: $(srcdir)/compile/compile-c-types.c - $(COMPILE) $(srcdir)/compile/compile-c-types.c - $(POSTCOMPILE) - -compile-c-symbols.o: $(srcdir)/compile/compile-c-symbols.c - $(COMPILE) $(srcdir)/compile/compile-c-symbols.c - $(POSTCOMPILE) - -compile-object-load.o: $(srcdir)/compile/compile-object-load.c - $(COMPILE) $(srcdir)/compile/compile-object-load.c - $(POSTCOMPILE) - -compile-object-run.o: $(srcdir)/compile/compile-object-run.c - $(COMPILE) $(srcdir)/compile/compile-object-run.c - $(POSTCOMPILE) - -compile-loc2c.o: $(srcdir)/compile/compile-loc2c.c - $(COMPILE) $(srcdir)/compile/compile-loc2c.c - $(POSTCOMPILE) - -compile-c-support.o: $(srcdir)/compile/compile-c-support.c - $(COMPILE) $(srcdir)/compile/compile-c-support.c - $(POSTCOMPILE) - - -# # GDBTK sub-directory # -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the mi directory. all-gdbtk: insight$(EXEEXT) @@ -2074,663 +2054,6 @@ all_gdbtk_cflags = $(IDE_CFLAGS) $(ITCL_CFLAGS) \ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" \ -DSRC_DIR=\"$(GDBTK_SRC_DIR)\" -gdbtk.o: $(srcdir)/gdbtk/generic/gdbtk.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk.c - $(POSTCOMPILE) - -gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-bp.c - $(POSTCOMPILE) - -gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-cmds.c - $(POSTCOMPILE) - -gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-hooks.c - $(POSTCOMPILE) - -gdbtk-interp.o: $(srcdir)/gdbtk/generic/gdbtk-interp.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-interp.c - $(POSTCOMPILE) - -gdbtk-main.o: $(srcdir)/gdbtk/generic/gdbtk-main.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-main.c - $(POSTCOMPILE) - -gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-register.c - $(POSTCOMPILE) - -gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-stack.c - $(POSTCOMPILE) - -gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-varobj.c - $(POSTCOMPILE) - -gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c - $(COMPILE) $(all_gdbtk_cflags) $(srcdir)/gdbtk/generic/gdbtk-wrapper.c - $(POSTCOMPILE) - - -# -# gdb/mi/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c - $(COMPILE) $(srcdir)/mi/mi-cmd-break.c - $(POSTCOMPILE) - -mi-cmd-catch.o: $(srcdir)/mi/mi-cmd-catch.c - $(COMPILE) $(srcdir)/mi/mi-cmd-catch.c - $(POSTCOMPILE) - -mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c - $(COMPILE) $(srcdir)/mi/mi-cmd-disas.c - $(POSTCOMPILE) - -mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c - $(COMPILE) $(srcdir)/mi/mi-cmd-env.c - $(POSTCOMPILE) - -mi-cmd-file.o: $(srcdir)/mi/mi-cmd-file.c - $(COMPILE) $(srcdir)/mi/mi-cmd-file.c - $(POSTCOMPILE) - -mi-cmd-info.o: $(srcdir)/mi/mi-cmd-info.c - $(COMPILE) $(srcdir)/mi/mi-cmd-info.c - $(POSTCOMPILE) - -mi-cmds.o: $(srcdir)/mi/mi-cmds.c - $(COMPILE) $(srcdir)/mi/mi-cmds.c - $(POSTCOMPILE) - -mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c - $(COMPILE) $(srcdir)/mi/mi-cmd-stack.c - $(POSTCOMPILE) - -mi-cmd-target.o: $(srcdir)/mi/mi-cmd-target.c - $(COMPILE) $(srcdir)/mi/mi-cmd-target.c - $(POSTCOMPILE) - -mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c - $(COMPILE) $(srcdir)/mi/mi-cmd-var.c - $(POSTCOMPILE) - -mi-console.o: $(srcdir)/mi/mi-console.c - $(COMPILE) $(srcdir)/mi/mi-console.c - $(POSTCOMPILE) - -mi-getopt.o: $(srcdir)/mi/mi-getopt.c - $(COMPILE) $(srcdir)/mi/mi-getopt.c - $(POSTCOMPILE) - -mi-interp.o: $(srcdir)/mi/mi-interp.c - $(COMPILE) $(srcdir)/mi/mi-interp.c - $(POSTCOMPILE) - -mi-main.o: $(srcdir)/mi/mi-main.c - $(COMPILE) $(srcdir)/mi/mi-main.c - $(POSTCOMPILE) - -mi-out.o: $(srcdir)/mi/mi-out.c - $(COMPILE) $(srcdir)/mi/mi-out.c - $(POSTCOMPILE) - -mi-parse.o: $(srcdir)/mi/mi-parse.c - $(COMPILE) $(srcdir)/mi/mi-parse.c - $(POSTCOMPILE) - -mi-symbol-cmds.o: $(srcdir)/mi/mi-symbol-cmds.c - $(COMPILE) $(srcdir)/mi/mi-symbol-cmds.c - $(POSTCOMPILE) - -mi-common.o: $(srcdir)/mi/mi-common.c - $(COMPILE) $(srcdir)/mi/mi-common.c - $(POSTCOMPILE) - -# gdb/common/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -signals.o: $(srcdir)/common/signals.c - $(COMPILE) $(srcdir)/common/signals.c - $(POSTCOMPILE) - -common-utils.o: ${srcdir}/common/common-utils.c - $(COMPILE) $(srcdir)/common/common-utils.c - $(POSTCOMPILE) - -gdb_vecs.o: ${srcdir}/common/gdb_vecs.c - $(COMPILE) $(srcdir)/common/gdb_vecs.c - $(POSTCOMPILE) - -xml-utils.o: ${srcdir}/common/xml-utils.c - $(COMPILE) $(srcdir)/common/xml-utils.c - $(POSTCOMPILE) - -ptid.o: ${srcdir}/common/ptid.c - $(COMPILE) $(srcdir)/common/ptid.c - $(POSTCOMPILE) - -buffer.o: ${srcdir}/common/buffer.c - $(COMPILE) $(srcdir)/common/buffer.c - $(POSTCOMPILE) - -filestuff.o: $(srcdir)/common/filestuff.c - $(COMPILE) $(srcdir)/common/filestuff.c - $(POSTCOMPILE) - -format.o: ${srcdir}/common/format.c - $(COMPILE) $(srcdir)/common/format.c - $(POSTCOMPILE) - -common-agent.o: $(srcdir)/common/agent.c - $(COMPILE) $(srcdir)/common/agent.c - $(POSTCOMPILE) - -vec.o: ${srcdir}/common/vec.c - $(COMPILE) $(srcdir)/common/vec.c - $(POSTCOMPILE) - -print-utils.o: ${srcdir}/common/print-utils.c - $(COMPILE) $(srcdir)/common/print-utils.c - $(POSTCOMPILE) - -rsp-low.o: ${srcdir}/common/rsp-low.c - $(COMPILE) $(srcdir)/common/rsp-low.c - $(POSTCOMPILE) - -errors.o: ${srcdir}/common/errors.c - $(COMPILE) $(srcdir)/common/errors.c - $(POSTCOMPILE) - -common-debug.o: ${srcdir}/common/common-debug.c - $(COMPILE) $(srcdir)/common/common-debug.c - $(POSTCOMPILE) - -cleanups.o: ${srcdir}/common/cleanups.c - $(COMPILE) $(srcdir)/common/cleanups.c - $(POSTCOMPILE) - -common-exceptions.o: ${srcdir}/common/common-exceptions.c - $(COMPILE) $(srcdir)/common/common-exceptions.c - $(POSTCOMPILE) - -posix-strerror.o: ${srcdir}/common/posix-strerror.c - $(COMPILE) $(srcdir)/common/posix-strerror.c - $(POSTCOMPILE) - -mingw-strerror.o: ${srcdir}/common/mingw-strerror.c - $(COMPILE) $(srcdir)/common/mingw-strerror.c - $(POSTCOMPILE) - -btrace-common.o: ${srcdir}/common/btrace-common.c - $(COMPILE) $(srcdir)/common/btrace-common.c - $(POSTCOMPILE) - -fileio.o: ${srcdir}/common/fileio.c - $(COMPILE) $(srcdir)/common/fileio.c - $(POSTCOMPILE) - -common-regcache.o: ${srcdir}/common/common-regcache.c - $(COMPILE) $(srcdir)/common/common-regcache.c - $(POSTCOMPILE) - -signals-state-save-restore.o: $(srcdir)/common/signals-state-save-restore.c - $(COMPILE) $(srcdir)/common/signals-state-save-restore.c - $(POSTCOMPILE) - -new-op.o: ${srcdir}/common/new-op.c - $(COMPILE) $(srcdir)/common/new-op.c - $(POSTCOMPILE) - -# -# gdb/target/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -waitstatus.o: ${srcdir}/target/waitstatus.c - $(COMPILE) $(srcdir)/target/waitstatus.c - $(POSTCOMPILE) - -# -# gdb/arch/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -arm.o: ${srcdir}/arch/arm.c - $(COMPILE) $(srcdir)/arch/arm.c - $(POSTCOMPILE) - -arm-linux.o: ${srcdir}/arch/arm-linux.c - $(COMPILE) $(srcdir)/arch/arm-linux.c - $(POSTCOMPILE) - -arm-get-next-pcs.o: ${srcdir}/arch/arm-get-next-pcs.c - $(COMPILE) $(srcdir)/arch/arm-get-next-pcs.c - $(POSTCOMPILE) - -# gdb/nat/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -x86-dregs.o: ${srcdir}/nat/x86-dregs.c - $(COMPILE) $(srcdir)/nat/x86-dregs.c - $(POSTCOMPILE) - -linux-btrace.o: ${srcdir}/nat/linux-btrace.c - $(COMPILE) $(srcdir)/nat/linux-btrace.c - $(POSTCOMPILE) - -linux-osdata.o: ${srcdir}/nat/linux-osdata.c - $(COMPILE) $(srcdir)/nat/linux-osdata.c - $(POSTCOMPILE) - -linux-procfs.o: $(srcdir)/nat/linux-procfs.c - $(COMPILE) $(srcdir)/nat/linux-procfs.c - $(POSTCOMPILE) - -linux-ptrace.o: $(srcdir)/nat/linux-ptrace.c - $(COMPILE) $(srcdir)/nat/linux-ptrace.c - $(POSTCOMPILE) - -linux-waitpid.o: ${srcdir}/nat/linux-waitpid.c - $(COMPILE) $(srcdir)/nat/linux-waitpid.c - $(POSTCOMPILE) - -mips-linux-watch.o: ${srcdir}/nat/mips-linux-watch.c - $(COMPILE) $(srcdir)/nat/mips-linux-watch.c - $(POSTCOMPILE) - -ppc-linux.o: ${srcdir}/nat/ppc-linux.c - $(COMPILE) $(srcdir)/nat/ppc-linux.c - $(POSTCOMPILE) - -linux-personality.o: ${srcdir}/nat/linux-personality.c - $(COMPILE) $(srcdir)/nat/linux-personality.c - $(POSTCOMPILE) - -x86-linux.o: ${srcdir}/nat/x86-linux.c - $(COMPILE) $(srcdir)/nat/x86-linux.c - $(POSTCOMPILE) - -x86-linux-dregs.o: ${srcdir}/nat/x86-linux-dregs.c - $(COMPILE) $(srcdir)/nat/x86-linux-dregs.c - $(POSTCOMPILE) - -amd64-linux-siginfo.o: ${srcdir}/nat/amd64-linux-siginfo.c - $(COMPILE) $(srcdir)/nat/amd64-linux-siginfo.c - $(POSTCOMPILE) - -linux-namespaces.o: ${srcdir}/nat/linux-namespaces.c - $(COMPILE) $(srcdir)/nat/linux-namespaces.c - $(POSTCOMPILE) - -aarch64-linux-hw-point.o: ${srcdir}/nat/aarch64-linux-hw-point.c - $(COMPILE) $(srcdir)/nat/aarch64-linux-hw-point.c - $(POSTCOMPILE) - -aarch64-linux.o: ${srcdir}/nat/aarch64-linux.c - $(COMPILE) $(srcdir)/nat/aarch64-linux.c - $(POSTCOMPILE) - -# gdb/arch/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -aarch64-insn.o: ${srcdir}/arch/aarch64-insn.c - $(COMPILE) $(srcdir)/arch/aarch64-insn.c - $(POSTCOMPILE) - -# -# gdb/tui/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -tui.o: $(srcdir)/tui/tui.c - $(COMPILE) $(srcdir)/tui/tui.c - $(POSTCOMPILE) - -tui-command.o: $(srcdir)/tui/tui-command.c - $(COMPILE) $(srcdir)/tui/tui-command.c - $(POSTCOMPILE) - -tui-data.o: $(srcdir)/tui/tui-data.c - $(COMPILE) $(srcdir)/tui/tui-data.c - $(POSTCOMPILE) - -tui-disasm.o: $(srcdir)/tui/tui-disasm.c - $(COMPILE) $(srcdir)/tui/tui-disasm.c - $(POSTCOMPILE) - -tui-file.o: $(srcdir)/tui/tui-file.c - $(COMPILE) $(srcdir)/tui/tui-file.c - $(POSTCOMPILE) - -tui-hooks.o: $(srcdir)/tui/tui-hooks.c - $(COMPILE) $(srcdir)/tui/tui-hooks.c - $(POSTCOMPILE) - -tui-interp.o: $(srcdir)/tui/tui-interp.c - $(COMPILE) $(srcdir)/tui/tui-interp.c - $(POSTCOMPILE) - -tui-io.o: $(srcdir)/tui/tui-io.c - $(COMPILE) $(srcdir)/tui/tui-io.c - $(POSTCOMPILE) - -tui-layout.o: $(srcdir)/tui/tui-layout.c - $(COMPILE) $(srcdir)/tui/tui-layout.c - $(POSTCOMPILE) - -tui-out.o: $(srcdir)/tui/tui-out.c - $(COMPILE) $(srcdir)/tui/tui-out.c - $(POSTCOMPILE) - -tui-regs.o: $(srcdir)/tui/tui-regs.c - $(COMPILE) $(srcdir)/tui/tui-regs.c - $(POSTCOMPILE) - -tui-source.o: $(srcdir)/tui/tui-source.c - $(COMPILE) $(srcdir)/tui/tui-source.c - $(POSTCOMPILE) - -tui-stack.o: $(srcdir)/tui/tui-stack.c - $(COMPILE) $(srcdir)/tui/tui-stack.c - $(POSTCOMPILE) - -tui-win.o: $(srcdir)/tui/tui-win.c - $(COMPILE) $(srcdir)/tui/tui-win.c - $(POSTCOMPILE) - -tui-windata.o: $(srcdir)/tui/tui-windata.c - $(COMPILE) $(srcdir)/tui/tui-windata.c - $(POSTCOMPILE) - -tui-wingeneral.o: $(srcdir)/tui/tui-wingeneral.c - $(COMPILE) $(srcdir)/tui/tui-wingeneral.c - $(POSTCOMPILE) - -tui-winsource.o: $(srcdir)/tui/tui-winsource.c - $(COMPILE) $(srcdir)/tui/tui-winsource.c - $(POSTCOMPILE) - -# gdb/guile dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -guile.o: $(srcdir)/guile/guile.c - $(COMPILE) $(srcdir)/guile/guile.c - $(POSTCOMPILE) - -scm-arch.o: $(srcdir)/guile/scm-arch.c - $(COMPILE) $(srcdir)/guile/scm-arch.c - $(POSTCOMPILE) - -scm-auto-load.o: $(srcdir)/guile/scm-auto-load.c - $(COMPILE) $(srcdir)/guile/scm-auto-load.c - $(POSTCOMPILE) - -scm-block.o: $(srcdir)/guile/scm-block.c - $(COMPILE) $(srcdir)/guile/scm-block.c - $(POSTCOMPILE) - -scm-breakpoint.o: $(srcdir)/guile/scm-breakpoint.c - $(COMPILE) $(srcdir)/guile/scm-breakpoint.c - $(POSTCOMPILE) - -scm-cmd.o: $(srcdir)/guile/scm-cmd.c - $(COMPILE) $(srcdir)/guile/scm-cmd.c - $(POSTCOMPILE) - -scm-disasm.o: $(srcdir)/guile/scm-disasm.c - $(COMPILE) $(srcdir)/guile/scm-disasm.c - $(POSTCOMPILE) - -scm-exception.o: $(srcdir)/guile/scm-exception.c - $(COMPILE) $(srcdir)/guile/scm-exception.c - $(POSTCOMPILE) - -scm-frame.o: $(srcdir)/guile/scm-frame.c - $(COMPILE) $(srcdir)/guile/scm-frame.c - $(POSTCOMPILE) - -scm-gsmob.o: $(srcdir)/guile/scm-gsmob.c - $(COMPILE) $(srcdir)/guile/scm-gsmob.c - $(POSTCOMPILE) - -scm-iterator.o: $(srcdir)/guile/scm-iterator.c - $(COMPILE) $(srcdir)/guile/scm-iterator.c - $(POSTCOMPILE) - -scm-lazy-string.o: $(srcdir)/guile/scm-lazy-string.c - $(COMPILE) $(srcdir)/guile/scm-lazy-string.c - $(POSTCOMPILE) - -scm-math.o: $(srcdir)/guile/scm-math.c - $(COMPILE) $(srcdir)/guile/scm-math.c - $(POSTCOMPILE) - -scm-objfile.o: $(srcdir)/guile/scm-objfile.c - $(COMPILE) $(srcdir)/guile/scm-objfile.c - $(POSTCOMPILE) - -scm-param.o: $(srcdir)/guile/scm-param.c - $(COMPILE) $(srcdir)/guile/scm-param.c - $(POSTCOMPILE) - -scm-ports.o: $(srcdir)/guile/scm-ports.c - $(COMPILE) $(srcdir)/guile/scm-ports.c - $(POSTCOMPILE) - -scm-pretty-print.o: $(srcdir)/guile/scm-pretty-print.c - $(COMPILE) $(srcdir)/guile/scm-pretty-print.c - $(POSTCOMPILE) - -scm-progspace.o: $(srcdir)/guile/scm-progspace.c - $(COMPILE) $(srcdir)/guile/scm-progspace.c - $(POSTCOMPILE) - -scm-safe-call.o: $(srcdir)/guile/scm-safe-call.c - $(COMPILE) $(srcdir)/guile/scm-safe-call.c - $(POSTCOMPILE) - -scm-string.o: $(srcdir)/guile/scm-string.c - $(COMPILE) $(srcdir)/guile/scm-string.c - $(POSTCOMPILE) - -scm-symbol.o: $(srcdir)/guile/scm-symbol.c - $(COMPILE) $(srcdir)/guile/scm-symbol.c - $(POSTCOMPILE) - -scm-symtab.o: $(srcdir)/guile/scm-symtab.c - $(COMPILE) $(srcdir)/guile/scm-symtab.c - $(POSTCOMPILE) - -scm-type.o: $(srcdir)/guile/scm-type.c - $(COMPILE) $(srcdir)/guile/scm-type.c - $(POSTCOMPILE) - -scm-utils.o: $(srcdir)/guile/scm-utils.c - $(COMPILE) $(srcdir)/guile/scm-utils.c - $(POSTCOMPILE) - -scm-value.o: $(srcdir)/guile/scm-value.c - $(COMPILE) $(srcdir)/guile/scm-value.c - $(POSTCOMPILE) - -# gdb/python/ dependencies -# -# Need to explicitly specify the compile rule as make will do nothing -# or try to compile the object file into the sub-directory. - -# Flags needed to compile Python code -PYTHON_CFLAGS=@PYTHON_CFLAGS@ - -python.o: $(srcdir)/python/python.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python.c - $(POSTCOMPILE) - -py-arch.o: $(srcdir)/python/py-arch.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-arch.c - $(POSTCOMPILE) - -py-auto-load.o: $(srcdir)/python/py-auto-load.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-auto-load.c - $(POSTCOMPILE) - -py-block.o: $(srcdir)/python/py-block.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-block.c - $(POSTCOMPILE) - -py-bpevent.o: $(srcdir)/python/py-bpevent.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-bpevent.c - $(POSTCOMPILE) - -py-breakpoint.o: $(srcdir)/python/py-breakpoint.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-breakpoint.c - $(POSTCOMPILE) - -py-cmd.o: $(srcdir)/python/py-cmd.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-cmd.c - $(POSTCOMPILE) - -py-continueevent.o: $(srcdir)/python/py-continueevent.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-continueevent.c - $(POSTCOMPILE) - -py-xmethods.o: $(srcdir)/python/py-xmethods.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-xmethods.c - $(POSTCOMPILE) - -py-event.o: $(srcdir)/python/py-event.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-event.c - $(POSTCOMPILE) - -py-evtregistry.o: $(srcdir)/python/py-evtregistry.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-evtregistry.c - $(POSTCOMPILE) - -py-evts.o: $(srcdir)/python/py-evts.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-evts.c - $(POSTCOMPILE) - -py-exitedevent.o: $(srcdir)/python/py-exitedevent.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-exitedevent.c - $(POSTCOMPILE) - -py-finishbreakpoint.o: $(srcdir)/python/py-finishbreakpoint.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-finishbreakpoint.c - $(POSTCOMPILE) - -py-frame.o: $(srcdir)/python/py-frame.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-frame.c - $(POSTCOMPILE) - -py-framefilter.o: $(srcdir)/python/py-framefilter.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-framefilter.c - $(POSTCOMPILE) - -py-function.o: $(srcdir)/python/py-function.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-function.c - $(POSTCOMPILE) - -py-gdb-readline.o: $(srcdir)/python/py-gdb-readline.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-gdb-readline.c - $(POSTCOMPILE) - -py-inferior.o: $(srcdir)/python/py-inferior.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-inferior.c - $(POSTCOMPILE) - -py-infevents.o: $(srcdir)/python/py-infevents.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-infevents.c - $(POSTCOMPILE) - -py-infthread.o: $(srcdir)/python/py-infthread.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-infthread.c - $(POSTCOMPILE) - -py-lazy-string.o: $(srcdir)/python/py-lazy-string.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-lazy-string.c - $(POSTCOMPILE) - -py-linetable.o: $(srcdir)/python/py-linetable.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-linetable.c - $(POSTCOMPILE) - -py-newobjfileevent.o: $(srcdir)/python/py-newobjfileevent.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-newobjfileevent.c - $(POSTCOMPILE) - -py-objfile.o: $(srcdir)/python/py-objfile.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-objfile.c - $(POSTCOMPILE) - -py-param.o: $(srcdir)/python/py-param.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-param.c - $(POSTCOMPILE) - -py-prettyprint.o: $(srcdir)/python/py-prettyprint.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-prettyprint.c - $(POSTCOMPILE) - -py-progspace.o: $(srcdir)/python/py-progspace.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-progspace.c - $(POSTCOMPILE) - -py-signalevent.o: $(srcdir)/python/py-signalevent.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-signalevent.c - $(POSTCOMPILE) - -py-stopevent.o: $(srcdir)/python/py-stopevent.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-stopevent.c - $(POSTCOMPILE) - -py-symbol.o: $(srcdir)/python/py-symbol.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-symbol.c - $(POSTCOMPILE) - -py-symtab.o: $(srcdir)/python/py-symtab.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-symtab.c - $(POSTCOMPILE) - -py-threadevent.o: $(srcdir)/python/py-threadevent.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-threadevent.c - $(POSTCOMPILE) - -py-type.o: $(srcdir)/python/py-type.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-type.c - $(POSTCOMPILE) - -py-unwind.o: $(srcdir)/python/py-unwind.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-unwind.c - $(POSTCOMPILE) - -py-utils.o: $(srcdir)/python/py-utils.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-utils.c - $(POSTCOMPILE) - -py-value.o: $(srcdir)/python/py-value.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-value.c - $(POSTCOMPILE) - -py-varobj.o: $(srcdir)/python/py-varobj.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-varobj.c - $(POSTCOMPILE) - # # Dependency tracking. # -- 2.10.2 ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 4/4] Makefile: Replace explicit subdir rules with pattern rules 2016-11-16 16:10 ` [PATCH 4/4] Makefile: Replace explicit subdir rules with pattern rules Simon Marchi @ 2016-11-16 17:11 ` Pedro Alves 0 siblings, 0 replies; 35+ messages in thread From: Pedro Alves @ 2016-11-16 17:11 UTC (permalink / raw) To: Simon Marchi, gdb-patches; +Cc: Simon Marchi On 11/16/2016 04:08 PM, Simon Marchi wrote: > gdb/Makefile.in | 789 ++++---------------------------------------------------- > 1 file changed, 56 insertions(+), 733 deletions(-) Nice... LGTM. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 1/4] Document new hard requirement on GNU make 2016-11-16 16:11 [PATCH 0/4] Require GNU make Simon Marchi 2016-11-16 16:10 ` [PATCH 4/4] Makefile: Replace explicit subdir rules with pattern rules Simon Marchi @ 2016-11-16 16:12 ` Simon Marchi 2016-11-16 16:29 ` Eli Zaretskii 2016-11-16 16:12 ` [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules Simon Marchi ` (2 subsequent siblings) 4 siblings, 1 reply; 35+ messages in thread From: Simon Marchi @ 2016-11-16 16:12 UTC (permalink / raw) To: gdb-patches; +Cc: Simon Marchi From: Simon Marchi <simon.marchi@polymtl.ca> As discussed in [1], it would be benificial for the GDB project to start requiring GNU make to build its software. It would allow using useful GNU-specific constructs, such as pattern rules. It would also allow removing the alternative code paths in the Makefiles (guarded by GMAKE_TRUE/GMAKE_FALSE), simplifying the Makefile code. [1] https://sourceware.org/ml/gdb-patches/2016-11/msg00331.html gdb/ChangeLog: * NEWS: Mention requirement of GNU make. --- gdb/NEWS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/NEWS b/gdb/NEWS index a6b1282..d76ea81 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -11,6 +11,11 @@ compiler. The --disable-build-with-cxx configure option has been removed. +* Building GDB and GDBserver now requires GNU make. + + It is no longer supported to build GDB or GDBserver with another + implementation of the make program. + * Native debugging on MS-Windows supports command-line redirection Command-line arguments used for starting programs on MS-Windows can -- 2.10.2 ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-16 16:12 ` [PATCH 1/4] Document new hard requirement on GNU make Simon Marchi @ 2016-11-16 16:29 ` Eli Zaretskii 2016-11-16 17:05 ` Simon Marchi 0 siblings, 1 reply; 35+ messages in thread From: Eli Zaretskii @ 2016-11-16 16:29 UTC (permalink / raw) To: Simon Marchi; +Cc: gdb-patches > From: Simon Marchi <simon.marchi@ericsson.com> > CC: Simon Marchi <simon.marchi@polymtl.ca> > Date: Wed, 16 Nov 2016 11:08:05 -0500 > > As discussed in [1], it would be benificial for the GDB project to start > requiring GNU make to build its software. It would allow using useful > GNU-specific constructs, such as pattern rules. It would also allow > removing the alternative code paths in the Makefiles (guarded by > GMAKE_TRUE/GMAKE_FALSE), simplifying the Makefile code. > > [1] https://sourceware.org/ml/gdb-patches/2016-11/msg00331.html > > gdb/ChangeLog: > > * NEWS: Mention requirement of GNU make. > --- > gdb/NEWS | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/gdb/NEWS b/gdb/NEWS > index a6b1282..d76ea81 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -11,6 +11,11 @@ > compiler. The --disable-build-with-cxx configure option has been > removed. > > +* Building GDB and GDBserver now requires GNU make. > + > + It is no longer supported to build GDB or GDBserver with another > + implementation of the make program. > + OK. Should we decide which oldest version of GNU Make we are willing to support? IOW, which features do we need for the build? Thanks. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-16 16:29 ` Eli Zaretskii @ 2016-11-16 17:05 ` Simon Marchi 2016-11-16 17:23 ` Eli Zaretskii 0 siblings, 1 reply; 35+ messages in thread From: Simon Marchi @ 2016-11-16 17:05 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Simon Marchi, gdb-patches On 2016-11-16 11:29, Eli Zaretskii wrote: > OK. > > Should we decide which oldest version of GNU Make we are willing to > support? IOW, which features do we need for the build? > > Thanks. Probably, yes, but I'm not aware of the exact features/bugfix we have to rely on. From what I can see, pattern rules have been around since forever (I checked out a commit of make from 1993, and it was already in the doc). However, if there is a particular bug about pattern rules in some versions of make we want to avoid, I am not aware of it. While trying to make GDBserver use pattern rules as well, I was reading this: http://stackoverflow.com/questions/11455182/when-multiple-pattern-rules-match-a-target I wanted to know which rule would get chosen if you wanted to build foo-ipa.o from foo-ipa.c, and you had the two rules: %.o: %.c <generic compilation commands> %-ipa.o: %-ipa.c <ipa-specific compilation commands> With make >= 3.82, it would do the right thing (choose the second one), by choosing the rule with the shorter stem. Before that, it used the order of definition (the first that matches wins). So it would be nice for that reason to require >= 3.82, but it's also possible to work around if that's too recent. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-16 17:05 ` Simon Marchi @ 2016-11-16 17:23 ` Eli Zaretskii 2016-11-16 22:05 ` Simon Marchi 0 siblings, 1 reply; 35+ messages in thread From: Eli Zaretskii @ 2016-11-16 17:23 UTC (permalink / raw) To: Simon Marchi; +Cc: gdb-patches > Date: Wed, 16 Nov 2016 12:05:02 -0500 > From: Simon Marchi <simon.marchi@polymtl.ca> > Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org > > > Should we decide which oldest version of GNU Make we are willing to > > support? IOW, which features do we need for the build? > > > > Thanks. > > Probably, yes, but I'm not aware of the exact features/bugfix we have to > rely on. From what I can see, pattern rules have been around since > forever (I checked out a commit of make from 1993, and it was already in > the doc). However, if there is a particular bug about pattern rules in > some versions of make we want to avoid, I am not aware of it. If all we want to use is pattern rules, then there's no problem. But I envision that soon enough we'd want to use more, like target-specific variables, functions like $(eval) and $(file), variables like $(MAKE_HOST), etc. > %.o: %.c > <generic compilation commands> > > %-ipa.o: %-ipa.c > <ipa-specific compilation commands> > > With make >= 3.82, it would do the right thing (choose the second one), > by choosing the rule with the shorter stem. Before that, it used the > order of definition (the first that matches wins). So it would be nice > for that reason to require >= 3.82, but it's also possible to work > around if that's too recent. 3.82 shouldn't be a problem, I think. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-16 17:23 ` Eli Zaretskii @ 2016-11-16 22:05 ` Simon Marchi 2016-11-16 23:34 ` Pedro Alves 2016-11-17 3:35 ` Eli Zaretskii 0 siblings, 2 replies; 35+ messages in thread From: Simon Marchi @ 2016-11-16 22:05 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches On 2016-11-16 12:23, Eli Zaretskii wrote: >> With make >= 3.82, it would do the right thing (choose the second >> one), >> by choosing the rule with the shorter stem. Before that, it used the >> order of definition (the first that matches wins). So it would be >> nice >> for that reason to require >= 3.82, but it's also possible to work >> around if that's too recent. > > 3.82 shouldn't be a problem, I think. Oops, I said that without even checking the version I have on my system. Ubuntu 14.04, strangely, has make 3.81. Apparently that was because of a critical bug on Debian with 3.82, which stayed open for a long time, preventing the upgrade. Debian and its derivatives, including Ubuntu, were stuck with that for a long time. Refs: http://stackoverflow.com/questions/31912233/how-to-update-make-3-81-linux https://lwn.net/Articles/569920/ I don't think it's worth complicating the lives of those users just to get the benefit of the behaviour change I mentioned. So I'm back at having no idea what version we should require. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-16 22:05 ` Simon Marchi @ 2016-11-16 23:34 ` Pedro Alves 2016-11-17 12:39 ` Pedro Alves 2016-11-17 3:35 ` Eli Zaretskii 1 sibling, 1 reply; 35+ messages in thread From: Pedro Alves @ 2016-11-16 23:34 UTC (permalink / raw) To: Simon Marchi, Eli Zaretskii; +Cc: gdb-patches On 11/16/2016 10:04 PM, Simon Marchi wrote: > On 2016-11-16 12:23, Eli Zaretskii wrote: >>> With make >= 3.82, it would do the right thing (choose the second one), >>> by choosing the rule with the shorter stem. Before that, it used the >>> order of definition (the first that matches wins). So it would be nice >>> for that reason to require >= 3.82, but it's also possible to work >>> around if that's too recent. >> >> 3.82 shouldn't be a problem, I think. > > Oops, I said that without even checking the version I have on my system. > Ubuntu 14.04, strangely, has make 3.81. Apparently that was because of > a critical bug on Debian with 3.82, which stayed open for a long time, > preventing the upgrade. Debian and its derivatives, including Ubuntu, > were stuck with that for a long time. > > Refs: > http://stackoverflow.com/questions/31912233/how-to-update-make-3-81-linux > https://lwn.net/Articles/569920/ > > I don't think it's worth complicating the lives of those users just to > get the benefit of the behaviour change I mentioned. > > So I'm back at having no idea what version we should require. I think we should go with the same requirement as gcc (3.80), as seen on the top level Makefile.in: @if gcc ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty. $(error GNU make version 3.80 or newer is required.) endif @endif gcc ... and listed on their prerequisites page: https://gcc.gnu.org/install/prerequisites.html (I'd be very nice to have a page like that for gdb. Currently we're not very organized wrt to prerequisite tracking.) Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-16 23:34 ` Pedro Alves @ 2016-11-17 12:39 ` Pedro Alves 2016-11-17 13:39 ` Simon Marchi 0 siblings, 1 reply; 35+ messages in thread From: Pedro Alves @ 2016-11-17 12:39 UTC (permalink / raw) To: Simon Marchi, Eli Zaretskii; +Cc: gdb-patches [-- Attachment #1: Type: text/plain, Size: 2705 bytes --] On 11/16/2016 11:34 PM, Pedro Alves wrote: > On 11/16/2016 10:04 PM, Simon Marchi wrote: >> On 2016-11-16 12:23, Eli Zaretskii wrote: >>>> With make >= 3.82, it would do the right thing (choose the second one), >>>> by choosing the rule with the shorter stem. Before that, it used the >>>> order of definition (the first that matches wins). So it would be nice >>>> for that reason to require >= 3.82, but it's also possible to work >>>> around if that's too recent. >>> >>> 3.82 shouldn't be a problem, I think. >> >> Oops, I said that without even checking the version I have on my system. >> Ubuntu 14.04, strangely, has make 3.81. Apparently that was because of >> a critical bug on Debian with 3.82, which stayed open for a long time, >> preventing the upgrade. Debian and its derivatives, including Ubuntu, >> were stuck with that for a long time. >> >> Refs: >> http://stackoverflow.com/questions/31912233/how-to-update-make-3-81-linux >> https://lwn.net/Articles/569920/ >> >> I don't think it's worth complicating the lives of those users just to >> get the benefit of the behaviour change I mentioned. >> >> So I'm back at having no idea what version we should require. > > I think we should go with the same requirement as gcc (3.80), as > seen on the top level Makefile.in: > > @if gcc > ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never > empty. > $(error GNU make version 3.80 or newer is required.) > endif > @endif gcc Actually, I take that back. I was just using "makes it easier to have a single top level check", but that's not really a good rationale. I wouldn't want to be stuck if gcc decides to move at a glacial pace. Probably a policy similar to the C++NN one makes more sense. I see now that 3.81 was released in 2006, so should not be a problem to require it. OOC, I wrote a quick&dirty script (attached) to check for GNU Make availability in the GCC compile farm. It tries all gcc*.fsffrance.org from 1 to 250. I don't have access to all machines setup, as some are multiplexed on a single IP with different ports, requiring tweaking the local ssh config. However, what I found was already interesting, I believe. Here's the result: Number of accessible hostnames: 66 Number of inaccessible hostnames: 184 Hostnames with GNU Make: 66 Hostnames without GNU Make: 0 Distribution: 56 GNU Make 3.81 2 GNU Make 3.82 7 GNU Make 4.0 1 GNU Make 4.1 Unique hosts with GNU Make: 20 Unique hosts without GNU Make: 0 Distribution: 10 GNU Make 3.81 2 GNU Make 3.82 7 GNU Make 4.0 1 GNU Make 4.1 I.e., I didn't find a single machine still stuck with GNU Make 3.80. Thanks, Pedro Alves [-- Attachment #2: check-make-ver --] [-- Type: text/plain, Size: 2064 bytes --] #!/bin/bash rm -f make-ver.gcc*.fsffrance.org function kill_ssh() { ps | grep ssh | awk '{print $1}' | xargs kill } function ctrl_c() { kill_ssh } trap ctrl_c INT function do_ssh() { cmd="sh -c '[ -f /etc/os-release ] && cat /etc/os-release; printf \"hostname: \"; hostname; printf \"uname: \"; uname -a; ((make -v 2>&1 | grep -q GNU) && make -v) || ((gmake -v 2>&1 | grep -q GNU) && gmake -v)' 2>&1" # Retry 5 times, wait 5 seconds between attempts. for i in {1..5} do ssh -q -o UserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -oBatchMode=yes gcc$h.fsffrance.org "$cmd" >make-ver.gcc$h.fsffrance.org 2>&1 && break || sleep 5; done } for h in `seq 1 250` do do_ssh & done echo "waiting 30s..." sleep 30 kill_ssh # Move inaccessible hosts out of the way. mkdir -p nohost find . -maxdepth 1 -size 0 | while read line; do mv $line nohost/; done grep -l "Network is unreachable" make-ver.gcc* | while read line; do mv $line nohost/; done grep -l "Connection timed out" make-ver.gcc* | while read line; do mv $line nohost/; done grep -l "Permission denied" make-ver.gcc* | while read line; do mv $line nohost/; done grep -l "Could not resolve hostname" make-ver.gcc* | while read line; do mv $line nohost/; done grep -l "Connection refused" make-ver.gcc* | while read line; do mv $line nohost/; done printf "Number of accessible hostnames: " ls make-ver.gcc* | wc -l printf "Number of inaccessible hostnames: " ls nohost/make-ver.gcc* | wc -l printf "Hostnames with GNU Make: " grep -l "GNU Make" make-ver.gcc* | wc -l printf "Hostnames without GNU Make: " grep -L "GNU Make" make-ver.gcc* | wc -l echo "Distribution: " grep -h "GNU Make" make-ver.gcc* | sort | uniq -c # Kill dups (found via uname in the ssh command) (fdupes -f . | grep -v '^$' | xargs rm -v)2>&1 >/dev/null printf "Unique hosts with GNU Make: " grep -l "GNU Make" make-ver.gcc* | wc -l printf "Unique hosts without GNU Make: " grep -L "GNU Make" make-ver.gcc* | wc -l echo "Distribution: " grep -h "GNU Make" make-ver.gcc* | sort | uniq -c ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-17 12:39 ` Pedro Alves @ 2016-11-17 13:39 ` Simon Marchi 2016-11-17 16:10 ` Eli Zaretskii 0 siblings, 1 reply; 35+ messages in thread From: Simon Marchi @ 2016-11-17 13:39 UTC (permalink / raw) To: Pedro Alves; +Cc: Eli Zaretskii, gdb-patches On 2016-11-17 07:39, Pedro Alves wrote: > Actually, I take that back. I was just using "makes it easier > to have a single top level check", but that's not really a good > rationale. I wouldn't want to be stuck if gcc decides to > move at a glacial pace. > > Probably a policy similar to the C++NN one makes more sense. > > I see now that 3.81 was released in 2006, so should not be > a problem to require it. > > OOC, I wrote a quick&dirty script (attached) to check for GNU Make > availability in the GCC compile farm. It tries all gcc*.fsffrance.org > from 1 to 250. I don't have access to all machines setup, as some are > multiplexed on a single IP with different ports, requiring tweaking > the local ssh config. However, what I found was already interesting, > I believe. Here's the result: > > Number of accessible hostnames: 66 > Number of inaccessible hostnames: 184 > Hostnames with GNU Make: 66 > Hostnames without GNU Make: 0 > Distribution: > 56 GNU Make 3.81 > 2 GNU Make 3.82 > 7 GNU Make 4.0 > 1 GNU Make 4.1 > Unique hosts with GNU Make: 20 > Unique hosts without GNU Make: 0 > Distribution: > 10 GNU Make 3.81 > 2 GNU Make 3.82 > 7 GNU Make 4.0 > 1 GNU Make 4.1 > > I.e., I didn't find a single machine still stuck with GNU Make 3.80. > > Thanks, > Pedro Alves Thanks for doing this! That, gives us some data on which to base ourselves to require make 3.81. Eli, I would update the NEWS entry to: * Building GDB and GDBserver now requires GNU make >= 3.81. It is no longer supported to build GDB or GDBserver with another implementation of the make program or en earlier GNU make version. Does it look good to you? Where else should that dependency be documented? ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-17 13:39 ` Simon Marchi @ 2016-11-17 16:10 ` Eli Zaretskii 0 siblings, 0 replies; 35+ messages in thread From: Eli Zaretskii @ 2016-11-17 16:10 UTC (permalink / raw) To: Simon Marchi; +Cc: palves, gdb-patches > Date: Thu, 17 Nov 2016 08:38:47 -0500 > From: Simon Marchi <simon.marchi@polymtl.ca> > Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org > > Eli, I would update the NEWS entry to: > > * Building GDB and GDBserver now requires GNU make >= 3.81. > > It is no longer supported to build GDB or GDBserver with another > implementation of the make program or en earlier GNU make version. > > Does it look good to you? Yes, thanks. > Where else should that dependency be documented? On the wiki, perhaps? ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-16 22:05 ` Simon Marchi 2016-11-16 23:34 ` Pedro Alves @ 2016-11-17 3:35 ` Eli Zaretskii 2016-11-17 10:06 ` Jonas Maebe 1 sibling, 1 reply; 35+ messages in thread From: Eli Zaretskii @ 2016-11-17 3:35 UTC (permalink / raw) To: Simon Marchi; +Cc: gdb-patches > Date: Wed, 16 Nov 2016 17:04:59 -0500 > From: Simon Marchi <simon.marchi@polymtl.ca> > Cc: gdb-patches@sourceware.org > > > 3.82 shouldn't be a problem, I think. > > Oops, I said that without even checking the version I have on my system. > Ubuntu 14.04, strangely, has make 3.81. Apparently that was because of > a critical bug on Debian with 3.82, which stayed open for a long time, > preventing the upgrade. Debian and its derivatives, including Ubuntu, > were stuck with that for a long time. > > Refs: > > http://stackoverflow.com/questions/31912233/how-to-update-make-3-81-linux > https://lwn.net/Articles/569920/ > > I don't think it's worth complicating the lives of those users just to > get the benefit of the behaviour change I mentioned. > > So I'm back at having no idea what version we should require. I guess that'd be 3.81, then. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-17 3:35 ` Eli Zaretskii @ 2016-11-17 10:06 ` Jonas Maebe 2016-11-17 12:43 ` Pedro Alves 0 siblings, 1 reply; 35+ messages in thread From: Jonas Maebe @ 2016-11-17 10:06 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches Eli Zaretskii wrote on Thu, 17 Nov 2016: >> Date: Wed, 16 Nov 2016 17:04:59 -0500 >> From: Simon Marchi <simon.marchi@polymtl.ca> >> Cc: gdb-patches@sourceware.org >> >> So I'm back at having no idea what version we should require. > > I guess that'd be 3.81, then. (Mac) OS X/macOS also ships with 3.81. Although that one will presumably never be updated to anything newer due to the switch to GPLv3, so it may not make sense to limit yourself based on that. Jonas ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 1/4] Document new hard requirement on GNU make 2016-11-17 10:06 ` Jonas Maebe @ 2016-11-17 12:43 ` Pedro Alves 0 siblings, 0 replies; 35+ messages in thread From: Pedro Alves @ 2016-11-17 12:43 UTC (permalink / raw) To: Jonas Maebe, Eli Zaretskii; +Cc: gdb-patches On 11/17/2016 10:05 AM, Jonas Maebe wrote: > > Eli Zaretskii wrote on Thu, 17 Nov 2016: > >>> Date: Wed, 16 Nov 2016 17:04:59 -0500 >>> From: Simon Marchi <simon.marchi@polymtl.ca> >>> Cc: gdb-patches@sourceware.org >>> >>> So I'm back at having no idea what version we should require. >> >> I guess that'd be 3.81, then. > > (Mac) OS X/macOS also ships with 3.81. Although that one will presumably > never be updated to anything newer due to the switch to GPLv3, so it may > not make sense to limit yourself based on that. I believe https://www.macports.org/ should make it easy to install whatever newer dependency than what ships built in with the OS. (I don't use MacOS, though.) According to: https://trac.macports.org/browser/trunk/dports/devel/gmake/Portfile they have 4.1 available. So I think macOS wouldn't be a problem if we wanted to require something newer. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 16:11 [PATCH 0/4] Require GNU make Simon Marchi 2016-11-16 16:10 ` [PATCH 4/4] Makefile: Replace explicit subdir rules with pattern rules Simon Marchi 2016-11-16 16:12 ` [PATCH 1/4] Document new hard requirement on GNU make Simon Marchi @ 2016-11-16 16:12 ` Simon Marchi 2016-11-16 16:35 ` Eli Zaretskii 2016-11-16 19:11 ` Pedro Alves 2016-11-16 16:12 ` [PATCH 2/4] Remove code that checks for GNU/non-GNU make Simon Marchi 2016-11-17 17:05 ` [PATCH 0/4] Require GNU make Simon Marchi 4 siblings, 2 replies; 35+ messages in thread From: Simon Marchi @ 2016-11-16 16:12 UTC (permalink / raw) To: gdb-patches; +Cc: Simon Marchi From: Simon Marchi <simon.marchi@polymtl.ca> As mentioned here [1], suffix rules are obsolete and have been superseeded with pattern rules. People (myself included, before writing this patch) are more likely to know what pattern rules are than suffix rules. AFAIK, .SUFFIXES targets are only used for those rules, and can be removed as well. New in v2: - Replace rule in gdbserver/Makefile.in as well. [1] https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html gdb/ChangeLog: * Makefile.in (.c.o): Replace rule with ... (%.o: %.c): ... this one. (.po.gmo): Replace rule with ... (%.gmo: %.po): ... this one. (.po.pox): Replace rule with ... (%.pox: %.po): ... this one. (.y.c): Replace rule with ... (%.c: %.y): ... this one. (.l.c): Replace rule with ... (%.c: %.l): ... this one. (.SUFFIXES): Remove all instances. gdb/gdbserver/ChangeLog: * Makefile.in (.c.o): Replace rule with ... (%.o: %.c): ... this one. --- gdb/Makefile.in | 12 +++++------- gdb/gdbserver/Makefile.in | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index f53b121..fe10a8d 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1122,7 +1122,7 @@ DISTSTUFF = $(YYFILES) generated_files = config.h observer.h observer.inc ada-lex.c jit-reader.h \ $(GNULIB_H) $(NAT_GENERATED_FILES) gcore -.c.o: +%.o: %.c $(COMPILE) $< $(POSTCOMPILE) @@ -1801,7 +1801,6 @@ ada-exp.o: ada-exp.c # Rules for generating translated message descriptions. Disabled by # autoconf if the tools are not available. -.SUFFIXES: .po .gmo .pox .pot .PHONY: all-po install-po uninstall-po clean-po update-po $(PACKAGE).pot all-po: $(CATALOGS) @@ -1812,14 +1811,14 @@ update-po: $(CATALOGS:.gmo=.pox) # N.B. We do not attempt to copy these into $(srcdir). The snapshot # script does that. -.po.gmo: +%.gmo: %.po -test -d po || mkdir po $(GMSGFMT) --statistics -o $@ $< # The new .po has to be gone over by hand, so we deposit it into # build/po with a different extension. If build/po/$(PACKAGE).pot # exists, use it (it was just created), else use the one in srcdir. -.po.pox: +%.pox: %.po -test -d po || mkdir po $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \ then echo po/$(PACKAGE).pot; \ @@ -1880,8 +1879,7 @@ po/$(PACKAGE).pot: force # Strictly speaking c-exp.c should therefore depend on # Makefile.in, but that was a pretty big annoyance. -.SUFFIXES: .y .l -.y.c: +%.c: %.y rm -f $@ $@.tmp $(SHELL) $(YLWRAP) $< y.tab.c $@ -- $(YACC) $(YFLAGS) && mv $@ $@.tmp \ || (rm -f $@; false) @@ -1897,7 +1895,7 @@ po/$(PACKAGE).pot: force -e 's/YY_NULL/YY_NULLPTR/g' \ < $@.tmp > $@ rm -f $@.tmp -.l.c: +%.c: %.l if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \ $(FLEX) -o$@ $< && \ rm -f $@.new && \ diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index a1f4675..c25d21e 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -256,7 +256,7 @@ FLAGS_TO_PASS = \ # All generated files which can be included by another file. generated_files = config.h $(GNULIB_H) -.c.o: +%.o: %.c $(COMPILE) $< $(POSTCOMPILE) -- 2.10.2 ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 16:12 ` [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules Simon Marchi @ 2016-11-16 16:35 ` Eli Zaretskii 2016-11-16 16:56 ` Pedro Alves 2016-11-16 19:11 ` Pedro Alves 1 sibling, 1 reply; 35+ messages in thread From: Eli Zaretskii @ 2016-11-16 16:35 UTC (permalink / raw) To: Simon Marchi; +Cc: gdb-patches > From: Simon Marchi <simon.marchi@ericsson.com> > CC: Simon Marchi <simon.marchi@polymtl.ca> > Date: Wed, 16 Nov 2016 11:08:07 -0500 > > AFAIK, .SUFFIXES targets are only used for those rules, and can be > removed as well. AFAIK, .SUFFIXES affects built-in rules, and so having there only suffixes relevant to our build will make the build faster, sometimes much faster, because Make doesn't need to consider irrelevant built-in rules. When in doubt, we can ask the GNU Make maintainer to help us. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 16:35 ` Eli Zaretskii @ 2016-11-16 16:56 ` Pedro Alves 2016-11-16 17:14 ` Eli Zaretskii 2016-11-16 19:38 ` Simon Marchi 0 siblings, 2 replies; 35+ messages in thread From: Pedro Alves @ 2016-11-16 16:56 UTC (permalink / raw) To: Eli Zaretskii, Simon Marchi; +Cc: gdb-patches On 11/16/2016 04:34 PM, Eli Zaretskii wrote: >> From: Simon Marchi <simon.marchi@ericsson.com> >> CC: Simon Marchi <simon.marchi@polymtl.ca> >> Date: Wed, 16 Nov 2016 11:08:07 -0500 >> >> AFAIK, .SUFFIXES targets are only used for those rules, and can be >> removed as well. > > AFAIK, .SUFFIXES affects built-in rules, and so having there only > suffixes relevant to our build will make the build faster, sometimes > much faster, because Make doesn't need to consider irrelevant built-in > rules. > Given the shared ancestry, and the fact that GCC nowadays requires GNU make, I think it may be worth it to take a look at what does GCC's Makefile.in do. In this case, it has: ~~~ # Suppress smart makes who think they know how to automake yacc and flex file .y.c: .l.c: # The only suffixes we want for implicit rules are .c and .o, so clear # the list and add them. This speeds up GNU Make, and allows -r to work. # For i18n support, we also need .gmo, .po, .pox. # This must come before the language makefile fragments to allow them to # add suffixes and rules of their own. .SUFFIXES: .SUFFIXES: .c .cc .o .po .pox .gmo ~~~ I don't know why they still add some suffixes instead of relying on the pattern rules. Might just be legacy. > When in doubt, we can ask the GNU Make maintainer to help us. Here's what he was saying in an internal GNU list (about speeding up make and emptying '.SUFFIXES'): ~~~ This doesn't get rid of all the implicit rules in GNU make, however, because some default rules are pattern rules which are not affected by the .SUFFIXES special target. To get rid of all implicit rules in GNU make you have to either invoke make with the -r option [...], or else add this to your makefile: .SUFFIXES: %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% ~~~ I'd be curious if this makes any difference in a "make" invocation that ends up building nothing (because all targets are already up to date). Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 16:56 ` Pedro Alves @ 2016-11-16 17:14 ` Eli Zaretskii 2016-11-16 17:32 ` Pedro Alves 2016-11-16 19:38 ` Simon Marchi 1 sibling, 1 reply; 35+ messages in thread From: Eli Zaretskii @ 2016-11-16 17:14 UTC (permalink / raw) To: Pedro Alves; +Cc: simon.marchi, gdb-patches > Cc: gdb-patches@sourceware.org > From: Pedro Alves <palves@redhat.com> > Date: Wed, 16 Nov 2016 16:56:02 +0000 > > Given the shared ancestry, and the fact that GCC nowadays requires > GNU make, I think it may be worth it to take a look at what > does GCC's Makefile.in do. > > In this case, it has: > > ~~~ > # Suppress smart makes who think they know how to automake yacc and flex file > .y.c: > .l.c: > > # The only suffixes we want for implicit rules are .c and .o, so clear > # the list and add them. This speeds up GNU Make, and allows -r to work. > # For i18n support, we also need .gmo, .po, .pox. > # This must come before the language makefile fragments to allow them to > # add suffixes and rules of their own. > .SUFFIXES: > .SUFFIXES: .c .cc .o .po .pox .gmo > ~~~ > > I don't know why they still add some suffixes instead of relying > on the pattern rules. Might just be legacy. No, it's because of the built-in rules. They are by default considered no matter which pattern rules you have in the Makefile, because theoretically each .c file can be built from some other file in any number of ways. > This doesn't get rid of all the implicit rules in GNU make, however, > because some default rules are pattern rules which are not affected by > the .SUFFIXES special target. > > To get rid of all implicit rules in GNU make you have to either invoke > make with the -r option [...], or else add this to your makefile: > > .SUFFIXES: > %:: %,v > %:: RCS/%,v > %:: RCS/% > %:: s.% > %:: SCCS/s.% > ~~~ > > I'd be curious if this makes any difference in a "make" invocation > that ends up building nothing (because all targets are already > up to date). It might produce a significant difference, but of course the interesting case is when a small number of files need to be recompiled. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 17:14 ` Eli Zaretskii @ 2016-11-16 17:32 ` Pedro Alves 2016-11-16 17:49 ` Eli Zaretskii 0 siblings, 1 reply; 35+ messages in thread From: Pedro Alves @ 2016-11-16 17:32 UTC (permalink / raw) To: Eli Zaretskii; +Cc: simon.marchi, gdb-patches On 11/16/2016 05:14 PM, Eli Zaretskii wrote: >> Cc: gdb-patches@sourceware.org >> From: Pedro Alves <palves@redhat.com> >> Date: Wed, 16 Nov 2016 16:56:02 +0000 >> >> Given the shared ancestry, and the fact that GCC nowadays requires >> GNU make, I think it may be worth it to take a look at what >> does GCC's Makefile.in do. >> >> In this case, it has: >> >> ~~~ >> # Suppress smart makes who think they know how to automake yacc and flex file >> .y.c: >> .l.c: >> >> # The only suffixes we want for implicit rules are .c and .o, so clear >> # the list and add them. This speeds up GNU Make, and allows -r to work. >> # For i18n support, we also need .gmo, .po, .pox. >> # This must come before the language makefile fragments to allow them to >> # add suffixes and rules of their own. >> .SUFFIXES: >> .SUFFIXES: .c .cc .o .po .pox .gmo >> ~~~ >> >> I don't know why they still add some suffixes instead of relying >> on the pattern rules. Might just be legacy. > > No, it's because of the built-in rules. They are by default > considered no matter which pattern rules you have in the Makefile, > because theoretically each .c file can be built from some other file > in any number of ways. I still don't understand. The question is why they add back some suffixes _after_ having deleted all the implicit rules. I.e., why do: .SUFFIXES: .SUFFIXES: .c instead of: .SUFFIXES: %.o: %.c They use pattern rules for other, more specific cases, AFAICS. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 17:32 ` Pedro Alves @ 2016-11-16 17:49 ` Eli Zaretskii 2016-11-16 17:58 ` Pedro Alves 0 siblings, 1 reply; 35+ messages in thread From: Eli Zaretskii @ 2016-11-16 17:49 UTC (permalink / raw) To: Pedro Alves; +Cc: simon.marchi, gdb-patches > Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org > From: Pedro Alves <palves@redhat.com> > Date: Wed, 16 Nov 2016 17:32:28 +0000 > > >> # The only suffixes we want for implicit rules are .c and .o, so clear > >> # the list and add them. This speeds up GNU Make, and allows -r to work. > >> # For i18n support, we also need .gmo, .po, .pox. > >> # This must come before the language makefile fragments to allow them to > >> # add suffixes and rules of their own. > >> .SUFFIXES: > >> .SUFFIXES: .c .cc .o .po .pox .gmo > >> ~~~ > >> > >> I don't know why they still add some suffixes instead of relying > >> on the pattern rules. Might just be legacy. > > > > No, it's because of the built-in rules. They are by default > > considered no matter which pattern rules you have in the Makefile, > > because theoretically each .c file can be built from some other file > > in any number of ways. > > I still don't understand. The question is why they add back > some suffixes _after_ having deleted all the implicit rules. > I.e., why do: > > .SUFFIXES: > .SUFFIXES: .c > > instead of: > > .SUFFIXES: > %.o: %.c > > They use pattern rules for other, more specific cases, AFAICS. Doesn't the comment explain that? And who said you should use pattern rules for everything? Suffix rules are not a dirty word. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 17:49 ` Eli Zaretskii @ 2016-11-16 17:58 ` Pedro Alves 0 siblings, 0 replies; 35+ messages in thread From: Pedro Alves @ 2016-11-16 17:58 UTC (permalink / raw) To: Eli Zaretskii; +Cc: simon.marchi, gdb-patches On 11/16/2016 05:49 PM, Eli Zaretskii wrote: > And who said you should use pattern rules for everything? Suffix > rules are not a dirty word. Of course not. The point was --- is there is perhaps some odd reason for adding back the default rules, when you have pattern rules that would match anyway. I don't know of one, but ... Anyway, doesn't really matter. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 16:56 ` Pedro Alves 2016-11-16 17:14 ` Eli Zaretskii @ 2016-11-16 19:38 ` Simon Marchi 2016-11-16 19:58 ` Pedro Alves 1 sibling, 1 reply; 35+ messages in thread From: Simon Marchi @ 2016-11-16 19:38 UTC (permalink / raw) To: Pedro Alves; +Cc: Eli Zaretskii, Simon Marchi, gdb-patches On 2016-11-16 11:56, Pedro Alves wrote: > # Suppress smart makes who think they know how to automake yacc and > flex file > .y.c: > .l.c: I don't understand how that can be useful. According to the GNU make doc: Suffix rules with no recipe are also meaningless. They do not remove previous rules as do pattern rules with no recipe (see Canceling Implicit Rules). They simply enter the suffix or pair of suffixes concatenated as a target in the data base. Source: https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html So those two would be meaningless? > ~~~ > This doesn't get rid of all the implicit rules in GNU make, however, > because some default rules are pattern rules which are not affected by > the .SUFFIXES special target. > > To get rid of all implicit rules in GNU make you have to either invoke > make with the -r option [...], or else add this to your makefile: > > .SUFFIXES: > %:: %,v > %:: RCS/%,v > %:: RCS/% > %:: s.% > %:: SCCS/s.% > ~~~ > > I'd be curious if this makes any difference in a "make" invocation > that ends up building nothing (because all targets are already > up to date). When looking at the make debug output (make -d), I think it becomes obvious: http://pastebin.com/raw/cETk9W3v That's taken without .SUFFIXES or other means to disable implicit rules. For _each_ .c file, make tries to determine if it was generated somehow, and you can see the lines which the rules you mentioned would suppress. In our case, most C files are not generated, and those that are have an explicit rule. I don't think we rely on implicit rules. Since we don't use them, I think it makes sense to disable then as much as possible. Plus, I can imagine them being a possible source of "bugs". If you happen to have a file called infrun.l by accident, the the build will fail and you'll wonder why. I did some experiments, here's the time it takes to run make in the gdb/ directory with nothing to re-build. The other number is the number of lines printed when running make -d. It gives a rough idea of the amount of operations make does. Note that these results are by changing both gdb/Makefile.in and gdb/gdbserver/Makefile.in. That's fair, since the -r applies recursively as well. Baseline: 2.5 seconds, 2306335 lines With .SUFFIXES: 0.7 seconds, 307706 lines With .SUFFIXES and the other %:: rules: 0.6 seconds, 255386 lines With -r flag (make -r): 0.5 seconds, 160682 lines So I think it shows that it wouldn't hurt to use ".SUFFIXES =" and the other rules from the gcc Makefile. I couldn't manage to get rid of the %.{y,l,w} -> %.c implicit rules though no matter what I tried. Calling make with the -r flag was the only way. At this point the returns are minimal though, so I don't think we should worry about it. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 19:38 ` Simon Marchi @ 2016-11-16 19:58 ` Pedro Alves 2016-11-16 20:18 ` Simon Marchi 0 siblings, 1 reply; 35+ messages in thread From: Pedro Alves @ 2016-11-16 19:58 UTC (permalink / raw) To: Simon Marchi; +Cc: Eli Zaretskii, Simon Marchi, gdb-patches On 11/16/2016 07:38 PM, Simon Marchi wrote: > I did some experiments, here's the time it takes to run make in the gdb/ > directory with nothing to re-build. The other number is the number of > lines printed when running make -d. It gives a rough idea of the amount > of operations make does. > > Note that these results are by changing both gdb/Makefile.in and > gdb/gdbserver/Makefile.in. That's fair, since the -r applies > recursively as well. > > Baseline: 2.5 seconds, 2306335 lines > With .SUFFIXES: 0.7 seconds, 307706 lines > With .SUFFIXES and the other %:: rules: 0.6 seconds, 255386 lines > With -r flag (make -r): 0.5 seconds, 160682 lines That's a nice speedup. Presumably if you change gdb/doc/ and gdb/testsuite/ too, the number without -r gets even closer to the -r number. If it works, I think it'll be nice to put the ".SUFFIXES and the other %:: rules" bits in a shared makefile fragment that is included (with the include directive) by all the main Makefile.in files. > So I think it shows that it wouldn't hurt to use ".SUFFIXES =" and the > other rules from the gcc Makefile. I couldn't manage to get rid of the > %.{y,l,w} -> %.c implicit rules though no matter what I tried. Calling > make with the -r flag was the only way. At this point the returns are > minimal though, so I don't think we should worry about it. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 19:58 ` Pedro Alves @ 2016-11-16 20:18 ` Simon Marchi 0 siblings, 0 replies; 35+ messages in thread From: Simon Marchi @ 2016-11-16 20:18 UTC (permalink / raw) To: Pedro Alves; +Cc: Eli Zaretskii, Simon Marchi, gdb-patches On 2016-11-16 14:58, Pedro Alves wrote: > On 11/16/2016 07:38 PM, Simon Marchi wrote: > >> I did some experiments, here's the time it takes to run make in the >> gdb/ >> directory with nothing to re-build. The other number is the number of >> lines printed when running make -d. It gives a rough idea of the >> amount >> of operations make does. >> >> Note that these results are by changing both gdb/Makefile.in and >> gdb/gdbserver/Makefile.in. That's fair, since the -r applies >> recursively as well. >> >> Baseline: 2.5 seconds, 2306335 lines >> With .SUFFIXES: 0.7 seconds, 307706 lines >> With .SUFFIXES and the other %:: rules: 0.6 seconds, 255386 lines >> With -r flag (make -r): 0.5 seconds, 160682 lines > > That's a nice speedup. Presumably if you change gdb/doc/ and > gdb/testsuite/ too, the number without -r gets even closer to > the -r number. Right, but not by much I think. The implicit rules are mostly for yacc, lex and c files. There isn't much target matching those in testsuite and doc. > If it works, I think it'll be nice to put the > ".SUFFIXES and the other %:: rules" bits in a shared makefile fragment > that > is included (with the include directive) by all the main Makefile.in > files. Good idea. ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 16:12 ` [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules Simon Marchi 2016-11-16 16:35 ` Eli Zaretskii @ 2016-11-16 19:11 ` Pedro Alves 2016-11-17 16:52 ` Simon Marchi 1 sibling, 1 reply; 35+ messages in thread From: Pedro Alves @ 2016-11-16 19:11 UTC (permalink / raw) To: Simon Marchi, gdb-patches; +Cc: Simon Marchi On 11/16/2016 04:08 PM, Simon Marchi wrote: > From: Simon Marchi <simon.marchi@polymtl.ca> > > As mentioned here [1], suffix rules are obsolete and have been > superseeded with pattern rules. People (myself included, before writing > this patch) are more likely to know what pattern rules are than suffix > rules. > > AFAIK, .SUFFIXES targets are only used for those rules, and can be > removed as well. > > New in v2: > > - Replace rule in gdbserver/Makefile.in as well. > > [1] https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html > > gdb/ChangeLog: > > * Makefile.in (.c.o): Replace rule with ... > (%.o: %.c): ... this one. > (.po.gmo): Replace rule with ... > (%.gmo: %.po): ... this one. > (.po.pox): Replace rule with ... > (%.pox: %.po): ... this one. > (.y.c): Replace rule with ... > (%.c: %.y): ... this one. > (.l.c): Replace rule with ... > (%.c: %.l): ... this one. > (.SUFFIXES): Remove all instances. > > gdb/gdbserver/ChangeLog: > > * Makefile.in (.c.o): Replace rule with ... > (%.o: %.c): ... this one. IMO, whether to explicitly remove default suffixes from the the implicit rule suffixes list for efficiency is a separate subject, since we're not currently doing it either. Just to be sure none of the default suffix rules is necessary, can you confirm: 1. that "make -r" (from scratch) still works. 2. that "make -r diststuff" in the gdb build dir still works. If the above work, then this is OK with me to push in. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-16 19:11 ` Pedro Alves @ 2016-11-17 16:52 ` Simon Marchi 2016-11-17 16:57 ` Pedro Alves 0 siblings, 1 reply; 35+ messages in thread From: Simon Marchi @ 2016-11-17 16:52 UTC (permalink / raw) To: Pedro Alves; +Cc: Simon Marchi, gdb-patches On 2016-11-16 14:10, Pedro Alves wrote: > IMO, whether to explicitly remove default suffixes from the > the implicit rule suffixes list for efficiency is a separate > subject, since we're not currently doing it either. > > Just to be sure none of the default suffix rules is necessary, > can you confirm: > > 1. that "make -r" (from scratch) still works. "make -r" from scratch from the top-level fails in the readline directory: ar: readline.o: No such file or directory It seems like readline relies on implicit rules. It shouldn't be affected by gdb disabling them though. I did a "make" in the readline directory to make it build, then resume the top-level build with "make -r", and it finished cleanly. > 2. that "make -r diststuff" in the gdb build dir still works. The commands completes successfully, so it looks good. Still, perhaps Joel should be a little bit more careful when doing the next release to make sure nothing it missing. > If the above work, then this is OK with me to push in. Just to be clear, this patchset does not disable the default suffix rules, so I don't think it was really necessary to check that for this patch. But at least we know it's safe for when we'll want to disable them. Thanks, Simon ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules 2016-11-17 16:52 ` Simon Marchi @ 2016-11-17 16:57 ` Pedro Alves 0 siblings, 0 replies; 35+ messages in thread From: Pedro Alves @ 2016-11-17 16:57 UTC (permalink / raw) To: Simon Marchi; +Cc: Simon Marchi, gdb-patches On 11/17/2016 04:52 PM, Simon Marchi wrote: > On 2016-11-16 14:10, Pedro Alves wrote: >> IMO, whether to explicitly remove default suffixes from the >> the implicit rule suffixes list for efficiency is a separate >> subject, since we're not currently doing it either. >> >> Just to be sure none of the default suffix rules is necessary, >> can you confirm: >> >> 1. that "make -r" (from scratch) still works. > > "make -r" from scratch from the top-level fails in the readline directory: > > ar: readline.o: No such file or directory > > It seems like readline relies on implicit rules. It shouldn't be > affected by gdb disabling them though. I did a "make" in the readline > directory to make it build, then resume the top-level build with "make > -r", and it finished cleanly. > >> 2. that "make -r diststuff" in the gdb build dir still works. > > The commands completes successfully, so it looks good. Still, perhaps > Joel should be a little bit more careful when doing the next release to > make sure nothing it missing. > >> If the above work, then this is OK with me to push in. > > Just to be clear, this patchset does not disable the default suffix > rules, so I don't think it was really necessary to check that for this > patch. But at least we know it's safe for when we'll want to disable them. You've changed .pot etc. rules which aren't triggered by a normal build, so I wanted to be sure that they weren't now working after the patch just because we'd happen to pick the default rules instead of the new patterns. So I think it was useful testing. In any case, it works, so I'm happy. :-) Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 2/4] Remove code that checks for GNU/non-GNU make 2016-11-16 16:11 [PATCH 0/4] Require GNU make Simon Marchi ` (2 preceding siblings ...) 2016-11-16 16:12 ` [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules Simon Marchi @ 2016-11-16 16:12 ` Simon Marchi 2016-11-16 16:32 ` Eli Zaretskii 2016-11-16 17:09 ` Pedro Alves 2016-11-17 17:05 ` [PATCH 0/4] Require GNU make Simon Marchi 4 siblings, 2 replies; 35+ messages in thread From: Simon Marchi @ 2016-11-16 16:12 UTC (permalink / raw) To: gdb-patches; +Cc: Simon Marchi From: Simon Marchi <simon.marchi@polymtl.ca> Since GNU make is now required to build GDB, we can remove everything that checks whether the current make implemention is the GNU one or not. I simply removed the @GMAKE_TRUE@ prefixes and removed the whole lines that were prefixed with @GMAKE_FALSE@. I removed the code in the configure scripts that set those variables. I also removed the following bits from the configure scripts: AC_CHECK_PROGS(MAKE, make): GNU make already defines a MAKE variable internally to be used when invoking Makefiles recursively. I don't see this variable being used anywhere else (in scripts for example), so I think it's safe for removal. AC_PROG_MAKE_SET: This macro defines a SET_MAKE output variable, which is meant to be used in Makefiles to define the MAKE variable when using an implementation of make that doesn't already define it. Since we are now requiring GNU make, we don't need it anymore. Plus, I don't see SET_MAKE being used anywhere, so I don't think it was actually doing anything... gdb/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate. gdbserver/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate. testsuite/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate. --- gdb/Makefile.in | 34 ++++++++-------- gdb/configure | 97 --------------------------------------------- gdb/configure.ac | 11 ------ gdb/gdbserver/Makefile.in | 34 ++++++++-------- gdb/gdbserver/configure | 97 --------------------------------------------- gdb/gdbserver/configure.ac | 11 ------ gdb/testsuite/Makefile.in | 88 ++++++++++++++++++++--------------------- gdb/testsuite/configure | 99 ---------------------------------------------- gdb/testsuite/configure.ac | 11 ------ 9 files changed, 74 insertions(+), 408 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 3876cd9..f53b121 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -2734,26 +2734,24 @@ py-varobj.o: $(srcdir)/python/py-varobj.c $(POSTCOMPILE) # -# Dependency tracking. Most of this is conditional on GNU Make being -# found by configure; if GNU Make is not found, we fall back to a -# simpler scheme. +# Dependency tracking. # -@GMAKE_TRUE@ifeq ($(DEPMODE),depmode=gcc3) +ifeq ($(DEPMODE),depmode=gcc3) # Note that we put the dependencies into a .Tpo file, then move them # into place if the compile succeeds. We need this because gcc does # not atomically write the dependency output file. -@GMAKE_TRUE@override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \ -@GMAKE_TRUE@ -MF $(DEPDIR)/$(basename $(@F)).Tpo -@GMAKE_TRUE@override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \ -@GMAKE_TRUE@ $(DEPDIR)/$(basename $(@F)).Po -@GMAKE_TRUE@else -@GMAKE_TRUE@override COMPILE.pre = source='$<' object='$@' libtool=no \ -@GMAKE_TRUE@ DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC) +override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \ + -MF $(DEPDIR)/$(basename $(@F)).Tpo +override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \ + $(DEPDIR)/$(basename $(@F)).Po +else +override COMPILE.pre = source='$<' object='$@' libtool=no \ + DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC) # depcomp handles atomicity for us, so we don't need a postcompile # step. -@GMAKE_TRUE@override POSTCOMPILE = -@GMAKE_TRUE@endif +override POSTCOMPILE = +endif # A list of all the objects we might care about in this build, for # dependency tracking. @@ -2763,13 +2761,13 @@ all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o \ # Ensure that generated files are created early. Use order-only # dependencies if available. They require GNU make 3.80 or newer, # and the .VARIABLES variable was introduced at the same time. -@GMAKE_TRUE@ifdef .VARIABLES -@GMAKE_TRUE@$(all_object_files): | $(generated_files) -@GMAKE_TRUE@else +ifdef .VARIABLES +$(all_object_files): | $(generated_files) +else $(all_object_files) : $(generated_files) -@GMAKE_TRUE@endif +endif # Dependencies. -@GMAKE_TRUE@-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files)) +-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files)) ### end of the gdb Makefile.in. diff --git a/gdb/configure b/gdb/configure index cf80bef..2abfbff 100755 --- a/gdb/configure +++ b/gdb/configure @@ -725,10 +725,6 @@ INCINTL LIBINTL_DEP LIBINTL USE_NLS -SET_MAKE -GMAKE_FALSE -GMAKE_TRUE -MAKE CCDEPMODE DEPDIR am__leading_dot @@ -6043,95 +6039,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type fi -# Check for the 'make' the user wants to use. -for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MAKE"; then - ac_cv_prog_MAKE="$MAKE" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MAKE="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MAKE=$ac_cv_prog_MAKE -if test -n "$MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 -$as_echo "$MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MAKE" && break -done - -MAKE_IS_GNU= -case "`$MAKE --version 2>&1 | sed 1q`" in - *GNU*) - MAKE_IS_GNU=yes - ;; -esac - if test "$MAKE_IS_GNU" = yes; then - GMAKE_TRUE= - GMAKE_FALSE='#' -else - GMAKE_TRUE='#' - GMAKE_FALSE= -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - - gnulib_extra_configure_args= # If large-file support is disabled, make sure gnulib does the same. if test "$enable_largefile" = no; then @@ -17627,10 +17534,6 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then - as_fn_error "conditional \"GMAKE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then as_fn_error "conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/gdb/configure.ac b/gdb/configure.ac index 592b1be..585f147 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -46,17 +46,6 @@ AX_CXX_COMPILE_STDCXX(11, , mandatory) ZW_CREATE_DEPDIR ZW_PROG_COMPILER_DEPENDENCIES([CC]) -# Check for the 'make' the user wants to use. -AC_CHECK_PROGS(MAKE, make) -MAKE_IS_GNU= -case "`$MAKE --version 2>&1 | sed 1q`" in - *GNU*) - MAKE_IS_GNU=yes - ;; -esac -AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes) -AC_PROG_MAKE_SET - gnulib_extra_configure_args= # If large-file support is disabled, make sure gnulib does the same. if test "$enable_largefile" = no; then diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 5ba559c..a1f4675 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -974,26 +974,24 @@ reg-tilegx32.c : $(srcdir)/../regformats/reg-tilegx32.dat $(regdat_sh) $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-tilegx32.dat reg-tilegx32.c # -# Dependency tracking. Most of this is conditional on GNU Make being -# found by configure; if GNU Make is not found, we fall back to a -# simpler scheme. +# Dependency tracking. # -@GMAKE_TRUE@ifeq ($(DEPMODE),depmode=gcc3) +ifeq ($(DEPMODE),depmode=gcc3) # Note that we put the dependencies into a .Tpo file, then move them # into place if the compile succeeds. We need this because gcc does # not atomically write the dependency output file. -@GMAKE_TRUE@override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \ -@GMAKE_TRUE@ -MF $(DEPDIR)/$(basename $(@F)).Tpo -@GMAKE_TRUE@override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \ -@GMAKE_TRUE@ $(DEPDIR)/$(basename $(@F)).Po -@GMAKE_TRUE@else -@GMAKE_TRUE@override COMPILE.pre = source='$<' object='$@' libtool=no \ -@GMAKE_TRUE@ DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC) +override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \ + -MF $(DEPDIR)/$(basename $(@F)).Tpo +override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \ + $(DEPDIR)/$(basename $(@F)).Po +else +override COMPILE.pre = source='$<' object='$@' libtool=no \ + DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC) # depcomp handles atomicity for us, so we don't need a postcompile # step. -@GMAKE_TRUE@override POSTCOMPILE = -@GMAKE_TRUE@endif +override POSTCOMPILE = +endif # A list of all the objects we might care about in this build, for # dependency tracking. @@ -1002,13 +1000,13 @@ all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS) # Ensure that generated files are created early. Use order-only # dependencies if available. They require GNU make 3.80 or newer, # and the .VARIABLES variable was introduced at the same time. -@GMAKE_TRUE@ifdef .VARIABLES -@GMAKE_TRUE@$(all_object_files): | $(generated_files) -@GMAKE_TRUE@else +ifdef .VARIABLES +$(all_object_files): | $(generated_files) +else $(all_object_files) : $(generated_files) -@GMAKE_TRUE@endif +endif # Dependencies. -@GMAKE_TRUE@-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files)) +-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files)) # This is the end of "Makefile.in". diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index bbce742..53c26f3 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -606,10 +606,6 @@ WARN_CFLAGS ustinc ustlibs ALLOCA -SET_MAKE -GMAKE_FALSE -GMAKE_TRUE -MAKE CCDEPMODE DEPDIR am__leading_dot @@ -5949,95 +5945,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type fi -# Check for the 'make' the user wants to use. -for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MAKE"; then - ac_cv_prog_MAKE="$MAKE" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MAKE="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MAKE=$ac_cv_prog_MAKE -if test -n "$MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 -$as_echo "$MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MAKE" && break -done - -MAKE_IS_GNU= -case "`$MAKE --version 2>&1 | sed 1q`" in - *GNU*) - MAKE_IS_GNU=yes - ;; -esac - if test "$MAKE_IS_GNU" = yes; then - GMAKE_TRUE= - GMAKE_FALSE='#' -else - GMAKE_TRUE='#' - GMAKE_FALSE= -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - - gnulib_extra_configure_args= # If large-file support is disabled, make sure gnulib does the same. if test "$enable_largefile" = no; then @@ -8615,10 +8522,6 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then - as_fn_error "conditional \"GMAKE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 11d8c79..6858e519 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -63,17 +63,6 @@ ACX_NONCANONICAL_HOST ZW_CREATE_DEPDIR ZW_PROG_COMPILER_DEPENDENCIES([CC]) -# Check for the 'make' the user wants to use. -AC_CHECK_PROGS(MAKE, make) -MAKE_IS_GNU= -case "`$MAKE --version 2>&1 | sed 1q`" in - *GNU*) - MAKE_IS_GNU=yes - ;; -esac -AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes) -AC_PROG_MAKE_SET - gnulib_extra_configure_args= # If large-file support is disabled, make sure gnulib does the same. if test "$enable_largefile" = no; then diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in index 7853275..29897ab 100644 --- a/gdb/testsuite/Makefile.in +++ b/gdb/testsuite/Makefile.in @@ -140,15 +140,13 @@ installcheck: # See whether -j was given to make. Either it was given with no # arguments, and appears as "j" in the first word, or it was given an # argument and appears as "-j" in a separate word. -@GMAKE_TRUE@saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j,$(MAKEFLAGS))) +saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j,$(MAKEFLAGS))) -# For GNU make, try to run the tests in parallel if any -j option is -# given. If RUNTESTFLAGS is not empty, then by default the tests will -# be serialized. This can be overridden by setting FORCE_PARALLEL to -# any non-empty value. For a non-GNU make, do not parallelize. -@GMAKE_TRUE@CHECK_TARGET_TMP = $(if $(FORCE_PARALLEL),check-parallel,$(if $(RUNTESTFLAGS),check-single,$(if $(saw_dash_j),check-parallel,check-single))) -@GMAKE_TRUE@CHECK_TARGET = $(if $(RACY_ITER),$(addsuffix -racy,$(CHECK_TARGET_TMP)),$(CHECK_TARGET_TMP)) -@GMAKE_FALSE@CHECK_TARGET = check-single +# Try to run the tests in parallel if any -j option is given. If RUNTESTFLAGS +# is not empty, then by default the tests will be serialized. This can be +# overridden by setting FORCE_PARALLEL to any non-empty value. +CHECK_TARGET_TMP = $(if $(FORCE_PARALLEL),check-parallel,$(if $(RUNTESTFLAGS),check-single,$(if $(saw_dash_j),check-parallel,check-single))) +CHECK_TARGET = $(if $(RACY_ITER),$(addsuffix -racy,$(CHECK_TARGET_TMP)),$(CHECK_TARGET_TMP)) # Note that we must resort to a recursive make invocation here, # because GNU make 3.82 has a bug preventing MAKEFLAGS from being used @@ -179,20 +177,18 @@ DO_RUNTEST = \ # of tests. For consistency we support it for check-single as well. # To specify all tests in a subdirectory, use TESTS=gdb.subdir/*.exp. # E.g., make check TESTS="gdb.server/*.exp gdb.threads/*.exp". -@GMAKE_TRUE@TESTS := -@GMAKE_FALSE@TESTS = +TESTS := -@GMAKE_TRUE@ifeq ($(strip $(TESTS)),) -@GMAKE_TRUE@expanded_tests_or_none := -@GMAKE_TRUE@else -@GMAKE_TRUE@expanded_tests := $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/,$(TESTS)))) -@GMAKE_TRUE@expanded_tests_or_none := $(or $(expanded_tests),no-matching-tests-found) -@GMAKE_TRUE@endif -@GMAKE_FALSE@expanded_tests_or_none = $(TESTS) +ifeq ($(strip $(TESTS)),) +expanded_tests_or_none := +else +expanded_tests := $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/,$(TESTS)))) +expanded_tests_or_none := $(or $(expanded_tests),no-matching-tests-found) +endif # Shorthand for running all the tests in a single directory. -@GMAKE_TRUE@check-gdb.%: -@GMAKE_TRUE@ $(MAKE) check TESTS="gdb.$*/*.exp" +check-gdb.%: + $(MAKE) check TESTS="gdb.$*/*.exp" check-single: $(DO_RUNTEST) $(RUNTESTFLAGS) $(expanded_tests_or_none) @@ -261,31 +257,31 @@ check-parallel-racy: # them to the front of the list to try to lessen the overall time # taken by the test suite -- if one of these tests happens to be run # late, it will cause the overall time to increase. -@GMAKE_TRUE@ifeq ($(strip $(TESTS)),) +ifeq ($(strip $(TESTS)),) slow_tests = gdb.base/break-interp.exp gdb.base/interp.exp \ gdb.base/multi-forks.exp -@GMAKE_TRUE@all_tests := $(shell cd $(srcdir) && find gdb.* -name '*.exp' -print) -@GMAKE_TRUE@reordered_tests := $(slow_tests) $(filter-out $(slow_tests),$(all_tests)) -@GMAKE_TRUE@TEST_TARGETS := $(addprefix $(if $(RACY_ITER),check-racy,check)/,$(reordered_tests)) -@GMAKE_TRUE@else -@GMAKE_TRUE@TEST_TARGETS := $(addprefix $(if $(RACY_ITER),check-racy,check)/,$(expanded_tests_or_none)) -@GMAKE_TRUE@endif +all_tests := $(shell cd $(srcdir) && find gdb.* -name '*.exp' -print) +reordered_tests := $(slow_tests) $(filter-out $(slow_tests),$(all_tests)) +TEST_TARGETS := $(addprefix $(if $(RACY_ITER),check-racy,check)/,$(reordered_tests)) +else +TEST_TARGETS := $(addprefix $(if $(RACY_ITER),check-racy,check)/,$(expanded_tests_or_none)) +endif do-check-parallel: $(TEST_TARGETS) @: -@GMAKE_TRUE@check/%.exp: -@GMAKE_TRUE@ -mkdir -p outputs/$* -@GMAKE_TRUE@ @$(DO_RUNTEST) GDB_PARALLEL=yes --outdir=outputs/$* $*.exp $(RUNTESTFLAGS) +check/%.exp: + -mkdir -p outputs/$* + @$(DO_RUNTEST) GDB_PARALLEL=yes --outdir=outputs/$* $*.exp $(RUNTESTFLAGS) do-check-parallel-racy: $(TEST_TARGETS) @: -@GMAKE_TRUE@check-racy/%.exp: -@GMAKE_TRUE@ -mkdir -p racy_outputs/$(RACY_OUTPUT_N)/$* -@GMAKE_TRUE@ $(DO_RUNTEST) GDB_PARALLEL=yes \ -@GMAKE_TRUE@ --outdir=racy_outputs/$(RACY_OUTPUT_N)/$* $*.exp \ -@GMAKE_TRUE@ $(RUNTESTFLAGS) +check-racy/%.exp: + -mkdir -p racy_outputs/$(RACY_OUTPUT_N)/$* + $(DO_RUNTEST) GDB_PARALLEL=yes \ + --outdir=racy_outputs/$(RACY_OUTPUT_N)/$* $*.exp \ + $(RUNTESTFLAGS) check/no-matching-tests-found: @echo "" @@ -293,9 +289,9 @@ check/no-matching-tests-found: @echo "" # Utility rule invoked by step 2 of the build-perf rule. -@GMAKE_TRUE@workers/%.worker: -@GMAKE_TRUE@ mkdir -p gdb.perf/outputs/$* -@GMAKE_TRUE@ $(DO_RUNTEST) --outdir=gdb.perf/outputs/$* lib/build-piece.exp WORKER=$* GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=build-pieces +workers/%.worker: + mkdir -p gdb.perf/outputs/$* + $(DO_RUNTEST) --outdir=gdb.perf/outputs/$* lib/build-piece.exp WORKER=$* GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=build-pieces # Utility rule to build tests that support it in parallel. # The build is broken into 3 steps distinguished by GDB_PERFTEST_SUBMODE: @@ -311,15 +307,15 @@ check/no-matching-tests-found: # The point of step 1 is to construct the set of worker tasks for step 2. # All of the information needed by build-piece.exp is contained in the name # of the generated .worker file. -@GMAKE_TRUE@build-perf: $(abs_builddir)/site.exp -@GMAKE_TRUE@ rm -rf gdb.perf/workers -@GMAKE_TRUE@ mkdir -p gdb.perf/workers -@GMAKE_TRUE@ @: Step 1: Generate the build .worker files. -@GMAKE_TRUE@ $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf/workers GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=gen-workers -@GMAKE_TRUE@ @: Step 2: Compile the pieces. Here is the build parallelism. -@GMAKE_TRUE@ $(MAKE) $$(cd gdb.perf && echo workers/*/*.worker) -@GMAKE_TRUE@ @: Step 3: Do the final link. -@GMAKE_TRUE@ $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=final +build-perf: $(abs_builddir)/site.exp + rm -rf gdb.perf/workers + mkdir -p gdb.perf/workers + @: Step 1: Generate the build .worker files. + $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf/workers GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=gen-workers + @: Step 2: Compile the pieces. Here is the build parallelism. + $(MAKE) $$(cd gdb.perf && echo workers/*/*.worker) + @: Step 3: Do the final link. + $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=final # The default is to both compile and run the tests. GDB_PERFTEST_MODE = both diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure index 976dbe8..5ea3cb1 100755 --- a/gdb/testsuite/configure +++ b/gdb/testsuite/configure @@ -608,10 +608,6 @@ CFLAGS CC RPATH_ENVVAR subdirs -SET_MAKE -GMAKE_FALSE -GMAKE_TRUE -MAKE target_noncanonical target_os target_vendor @@ -2130,97 +2126,6 @@ esac -# Check for the 'make' the user wants to use. -for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MAKE"; then - ac_cv_prog_MAKE="$MAKE" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MAKE="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MAKE=$ac_cv_prog_MAKE -if test -n "$MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 -$as_echo "$MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MAKE" && break -done - -MAKE_IS_GNU= -case "`$MAKE --version 2>&1 | sed 1q`" in - *GNU*) - MAKE_IS_GNU=yes - ;; -esac - - -if test "$MAKE_IS_GNU" = yes; then - GMAKE_TRUE= - GMAKE_FALSE='#' -else - GMAKE_TRUE='#' - GMAKE_FALSE= -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - - # Enable gdbtk. # Check whether --enable-gdbtk was given. if test "${enable_gdbtk+set}" = set; then : @@ -3647,10 +3552,6 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs -if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then - as_fn_error "conditional \"GMAKE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 diff --git a/gdb/testsuite/configure.ac b/gdb/testsuite/configure.ac index 91e5d22..2915a18 100644 --- a/gdb/testsuite/configure.ac +++ b/gdb/testsuite/configure.ac @@ -25,17 +25,6 @@ AC_CANONICAL_TARGET ACX_NONCANONICAL_TARGET -# Check for the 'make' the user wants to use. -AC_CHECK_PROGS(MAKE, make) -MAKE_IS_GNU= -case "`$MAKE --version 2>&1 | sed 1q`" in - *GNU*) - MAKE_IS_GNU=yes - ;; -esac -AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes) -AC_PROG_MAKE_SET - # Enable gdbtk. AC_ARG_ENABLE(gdbtk, [ --enable-gtk enable gdbtk graphical user interface (GUI)],, -- 2.10.2 ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/4] Remove code that checks for GNU/non-GNU make 2016-11-16 16:12 ` [PATCH 2/4] Remove code that checks for GNU/non-GNU make Simon Marchi @ 2016-11-16 16:32 ` Eli Zaretskii 2016-11-16 16:39 ` Andreas Schwab 2016-11-16 17:09 ` Pedro Alves 1 sibling, 1 reply; 35+ messages in thread From: Eli Zaretskii @ 2016-11-16 16:32 UTC (permalink / raw) To: Simon Marchi; +Cc: gdb-patches > From: Simon Marchi <simon.marchi@ericsson.com> > CC: Simon Marchi <simon.marchi@polymtl.ca> > Date: Wed, 16 Nov 2016 11:08:06 -0500 > > From: Simon Marchi <simon.marchi@polymtl.ca> > > Since GNU make is now required to build GDB, we can remove everything > that checks whether the current make implemention is the GNU one or > not. I simply removed the @GMAKE_TRUE@ prefixes and removed the whole > lines that were prefixed with @GMAKE_FALSE@. Since GDB is built by first running Make in sibling directories, which don't require a GNU Make yet, what does this mean in case the user runs a non-GNU Make? Will they have strange errors half way through the build? Should we detect this early on and bail out? ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/4] Remove code that checks for GNU/non-GNU make 2016-11-16 16:32 ` Eli Zaretskii @ 2016-11-16 16:39 ` Andreas Schwab 2016-11-16 17:12 ` Simon Marchi 2016-11-16 17:12 ` Pedro Alves 0 siblings, 2 replies; 35+ messages in thread From: Andreas Schwab @ 2016-11-16 16:39 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Simon Marchi, gdb-patches On Nov 16 2016, Eli Zaretskii <eliz@gnu.org> wrote: > Since GDB is built by first running Make in sibling directories, which > don't require a GNU Make yet, what does this mean in case the user > runs a non-GNU Make? Will they have strange errors half way through > the build? Should we detect this early on and bail out? The toplevel makefile already has such a check, only enabled for gcc for now. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/4] Remove code that checks for GNU/non-GNU make 2016-11-16 16:39 ` Andreas Schwab @ 2016-11-16 17:12 ` Simon Marchi 2016-11-16 17:12 ` Pedro Alves 1 sibling, 0 replies; 35+ messages in thread From: Simon Marchi @ 2016-11-16 17:12 UTC (permalink / raw) To: Andreas Schwab; +Cc: Eli Zaretskii, Simon Marchi, gdb-patches On 2016-11-16 11:39, Andreas Schwab wrote: > On Nov 16 2016, Eli Zaretskii <eliz@gnu.org> wrote: > >> Since GDB is built by first running Make in sibling directories, which >> don't require a GNU Make yet, what does this mean in case the user >> runs a non-GNU Make? Will they have strange errors half way through >> the build? Should we detect this early on and bail out? > > The toplevel makefile already has such a check, only enabled for gcc > for > now. Ah, great. In the discussion [1] linked by Pedro in the order thread, no one seemed to have an objection about switching binutils-gdb to require GNU make. So we can probably just make that check unconditional. Note that it's not a check for GNU make per-se, but a check for the .VARIABLES. It's equivalent if GNU make is the only one to provide the .VARIABLES variable, but I don't know if that's the case. 27 @if gcc 28 ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty. 29 $(error GNU make version 3.80 or newer is required.) 30 endif 31 @endif gcc [1] https://sourceware.org/ml/binutils/2014-05/msg00263.html ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/4] Remove code that checks for GNU/non-GNU make 2016-11-16 16:39 ` Andreas Schwab 2016-11-16 17:12 ` Simon Marchi @ 2016-11-16 17:12 ` Pedro Alves 1 sibling, 0 replies; 35+ messages in thread From: Pedro Alves @ 2016-11-16 17:12 UTC (permalink / raw) To: Andreas Schwab, Eli Zaretskii; +Cc: Simon Marchi, gdb-patches On 11/16/2016 04:39 PM, Andreas Schwab wrote: > On Nov 16 2016, Eli Zaretskii <eliz@gnu.org> wrote: > >> Since GDB is built by first running Make in sibling directories, which >> don't require a GNU Make yet, what does this mean in case the user >> runs a non-GNU Make? Will they have strange errors half way through >> the build? Should we detect this early on and bail out? > > The toplevel makefile already has such a check, only enabled for gcc for > now. Might be worth it to ask the binutils@ folks if they're OK with requiring GNU make, and just making that unconditional. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/4] Remove code that checks for GNU/non-GNU make 2016-11-16 16:12 ` [PATCH 2/4] Remove code that checks for GNU/non-GNU make Simon Marchi 2016-11-16 16:32 ` Eli Zaretskii @ 2016-11-16 17:09 ` Pedro Alves 1 sibling, 0 replies; 35+ messages in thread From: Pedro Alves @ 2016-11-16 17:09 UTC (permalink / raw) To: Simon Marchi, gdb-patches; +Cc: Simon Marchi On 11/16/2016 04:08 PM, Simon Marchi wrote: > From: Simon Marchi <simon.marchi@polymtl.ca> > > Since GNU make is now required to build GDB, we can remove everything > that checks whether the current make implemention is the GNU one or > not. I simply removed the @GMAKE_TRUE@ prefixes and removed the whole > lines that were prefixed with @GMAKE_FALSE@. > > I removed the code in the configure scripts that set those variables. > > I also removed the following bits from the configure scripts: > > AC_CHECK_PROGS(MAKE, make): GNU make already defines a MAKE variable > internally to be used when invoking Makefiles recursively. I don't see > this variable being used anywhere else (in scripts for example), so I > think it's safe for removal. > > AC_PROG_MAKE_SET: This macro defines a SET_MAKE output variable, which > is meant to be used in Makefiles to define the MAKE variable when > using an implementation of make that doesn't already define it. > Since we are now requiring GNU make, we don't need it anymore. > Plus, I don't see SET_MAKE being used anywhere, so I don't think it > was actually doing anything... > > gdb/ChangeLog: > > * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines > prefixed with @GMAKE_FALSE@. Update comment related to non-GNU > make. > * configure.ac: Remove checks for the make program. > * configure: Re-generate. > > gdbserver/ChangeLog: > > * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines > prefixed with @GMAKE_FALSE@. Update comment related to non-GNU > make. > * configure.ac: Remove checks for the make program. > * configure: Re-generate. > > testsuite/ChangeLog: > > * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines > prefixed with @GMAKE_FALSE@. Update comment related to non-GNU > make. > * configure.ac: Remove checks for the make program. > * configure: Re-generate. LGTM. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 0/4] Require GNU make 2016-11-16 16:11 [PATCH 0/4] Require GNU make Simon Marchi ` (3 preceding siblings ...) 2016-11-16 16:12 ` [PATCH 2/4] Remove code that checks for GNU/non-GNU make Simon Marchi @ 2016-11-17 17:05 ` Simon Marchi 4 siblings, 0 replies; 35+ messages in thread From: Simon Marchi @ 2016-11-17 17:05 UTC (permalink / raw) To: Simon Marchi; +Cc: gdb-patches On 2016-11-16 11:08, Simon Marchi wrote: > Following the discussions in > > https://sourceware.org/ml/gdb-patches/2016-11/msg00326.html > > I am sending this patch series which makes GNU make mandatory for > building GDB > and GDBserver. > > - Patch 1 simply updates the NEWS file > - Patch 2 removes code that is conditional on make being GNU make or > not. > - Patches 3 and 4 make use of pattern rules, a GNU make-specific > feature. > > Patches 3 and 4 replace patches 1 and 2 in the original series. > > Simon Marchi (4): > Document new hard requirement on GNU make > Remove code that checks for GNU/non-GNU make > Makefile: Replace old suffix rules with pattern rules > Makefile: Replace explicit subdir rules with pattern rules > > gdb/Makefile.in | 835 > +++++---------------------------------------- > gdb/NEWS | 5 + > gdb/configure | 97 ------ > gdb/configure.ac | 11 - > gdb/gdbserver/Makefile.in | 36 +- > gdb/gdbserver/configure | 97 ------ > gdb/gdbserver/configure.ac | 11 - > gdb/testsuite/Makefile.in | 88 +++-- > gdb/testsuite/configure | 99 ------ > gdb/testsuite/configure.ac | 11 - > 10 files changed, 141 insertions(+), 1149 deletions(-) Thanks everybody for the reviews and comments, I have now pushed this series. I'll follow-up with: - See if binutils can require GNU make as well, and perhaps have a check in the top-level makefile - Disable default implicit rules with .SUFFIXES. Simon ^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2016-11-17 17:05 UTC | newest] Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-11-16 16:11 [PATCH 0/4] Require GNU make Simon Marchi 2016-11-16 16:10 ` [PATCH 4/4] Makefile: Replace explicit subdir rules with pattern rules Simon Marchi 2016-11-16 17:11 ` Pedro Alves 2016-11-16 16:12 ` [PATCH 1/4] Document new hard requirement on GNU make Simon Marchi 2016-11-16 16:29 ` Eli Zaretskii 2016-11-16 17:05 ` Simon Marchi 2016-11-16 17:23 ` Eli Zaretskii 2016-11-16 22:05 ` Simon Marchi 2016-11-16 23:34 ` Pedro Alves 2016-11-17 12:39 ` Pedro Alves 2016-11-17 13:39 ` Simon Marchi 2016-11-17 16:10 ` Eli Zaretskii 2016-11-17 3:35 ` Eli Zaretskii 2016-11-17 10:06 ` Jonas Maebe 2016-11-17 12:43 ` Pedro Alves 2016-11-16 16:12 ` [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules Simon Marchi 2016-11-16 16:35 ` Eli Zaretskii 2016-11-16 16:56 ` Pedro Alves 2016-11-16 17:14 ` Eli Zaretskii 2016-11-16 17:32 ` Pedro Alves 2016-11-16 17:49 ` Eli Zaretskii 2016-11-16 17:58 ` Pedro Alves 2016-11-16 19:38 ` Simon Marchi 2016-11-16 19:58 ` Pedro Alves 2016-11-16 20:18 ` Simon Marchi 2016-11-16 19:11 ` Pedro Alves 2016-11-17 16:52 ` Simon Marchi 2016-11-17 16:57 ` Pedro Alves 2016-11-16 16:12 ` [PATCH 2/4] Remove code that checks for GNU/non-GNU make Simon Marchi 2016-11-16 16:32 ` Eli Zaretskii 2016-11-16 16:39 ` Andreas Schwab 2016-11-16 17:12 ` Simon Marchi 2016-11-16 17:12 ` Pedro Alves 2016-11-16 17:09 ` Pedro Alves 2016-11-17 17:05 ` [PATCH 0/4] Require GNU make Simon Marchi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).