diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2018-03-16 16:06:23 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-03-16 16:30:25 -0400 |
commit | 39be3c7e98728df57cfddd37fb7747f1339a319b (patch) | |
tree | 4b4e7ecde12deb8986d87a71d37903d3216483cd /gdb/gdbserver | |
parent | 37e136b1684929df204ddd09c38978c705fa7228 (diff) | |
download | gdb-39be3c7e98728df57cfddd37fb7747f1339a319b.zip gdb-39be3c7e98728df57cfddd37fb7747f1339a319b.tar.gz gdb-39be3c7e98728df57cfddd37fb7747f1339a319b.tar.bz2 |
Add silent Makefile rules
Many projects (e.g. the Linux kernel) and build systems use "silent"
rules, which means that they'll only print a summary of what's being
done instead of printing all the detailed command lines. While chatting
on the #gdb IRC channel, I realized a few people (including me) thought
it would be nice to have it in GDB too.
The idea is that too much text is not useful, the important information
gets lost. If there's only the essential information, it's more likely
to be useful. Most of the time, when I look at the build output, it's
to see how it's progressing. By just printing a brief summary of each
operation, I can easily spot what's currently being compiled and
therefore how the build progresses (with time you know the order in
which files are compiled almost by heart).
As with other projects (Linux, automake-based things, probably others),
it's possible to print the complete command lines by passing V=1 to make
(or any other non-zero value).
I had one hesitation about this: when people report build failures, we
are more likely to miss the full compile command line. We'll probably
sometimes need to ask people to include the build log with "make V=1".
I don't think it's a big downside, if other projects the size of the
Linux kernel can live with it, I'm sure we can too.
gdb/ChangeLog:
* silent-rules.mk: New.
* Makefile.in: Include silent-rules.mk
(srcdir, VPATH, top_srcdir): Move up.
(COMPILE): Add ECHO_CXX.
(test-cp-name-parser$(EXEEXT)): Add ECHO_CXXLD.
(init.c): Add ECHO_INIT_C.
(gdb$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
(version.c): Add ECHO_GEN.
(printcmd.o): Add ECHO_CXX.
(target-float.o): Add ECHO_CXX.
(ada-exp.o): Add ECHO_CXX.
(stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN.
(insight$(EXEEXT)): Add ECHO_CXXLD.
* gnulib/configure.ac: Add AM_SILENT_RULES.
* gnulib/aclocal.m4: Re-generate.
* gnulib/configure: Re-generate.
* gnulib/import/Makefile.in: Re-generate.
gdb/gdbserver/ChangeLog:
* Makefile.in: Include silent-rules.mk.
(srcdir, abs_top_srcdir, abs_srcdir, VPATH): Move up.
(COMPILE): Add ECHO_CXX.
(gdbserver$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
(gdbreplay$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
($(IPA_LIB)): Add SILENCE and ECHO_CXXLD.
(version-generated.c): Add ECHO_GEN.
(stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN_GENERATED.
(IPAGENT_COMPILE): Add ECHO_CXX.
(%-generated.c): Add ECHO_REGDAT.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 13 | ||||
-rw-r--r-- | gdb/gdbserver/Makefile.in | 60 |
2 files changed, 46 insertions, 27 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 2be87a6..961127d 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,16 @@ +2018-03-16 Simon Marchi <simon.marchi@polymtl.ca> + + * Makefile.in: Include silent-rules.mk. + (srcdir, abs_top_srcdir, abs_srcdir, VPATH): Move up. + (COMPILE): Add ECHO_CXX. + (gdbserver$(EXEEXT)): Add SILENCE and ECHO_CXXLD. + (gdbreplay$(EXEEXT)): Add SILENCE and ECHO_CXXLD. + ($(IPA_LIB)): Add SILENCE and ECHO_CXXLD. + (version-generated.c): Add ECHO_GEN. + (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN_GENERATED. + (IPAGENT_COMPILE): Add ECHO_CXX. + (%-generated.c): Add ECHO_REGDAT. + 2018-03-14 Tom Tromey <tom@tromey.com> PR cli/14977: diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index f293692..75fbf7e 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -64,13 +64,6 @@ DEPMODE = @CCDEPMODE@ DEPDIR = @DEPDIR@ depcomp = $(SHELL) $(srcdir)/../depcomp -# Note that these are overridden by GNU make-specific code below if -# GNU make is used. The overrides implement dependency tracking. -COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT) -COMPILE.post = -c -o $@ -COMPILE = $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post) -POSTCOMPILE = @true - # Directory containing source files. Don't clean up the spacing, # this exact string is matched for by the "configure" script. srcdir = @srcdir@ @@ -78,6 +71,15 @@ abs_top_srcdir = @abs_top_srcdir@ abs_srcdir = @abs_srcdir@ VPATH = @srcdir@ +include $(srcdir)/../silent-rules.mk + +# Note that these are overridden by GNU make-specific code below if +# GNU make is used. The overrides implement dependency tracking. +COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT) +COMPILE.post = -c -o $@ +COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post) +POSTCOMPILE = @true + # It is also possible that you will need to add -I/usr/include/sys to the # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which # is where it should be according to Posix). @@ -378,9 +380,10 @@ clean-info: force @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU) $(LIBIBERTY) - rm -f gdbserver$(EXEEXT) - $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \ - $(LIBGNU) $(LIBIBERTY) $(GDBSERVER_LIBS) $(XM_CLIBS) + $(SILENCE) rm -f gdbserver$(EXEEXT) + $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ + -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \ + $(GDBSERVER_LIBS) $(XM_CLIBS) $(LIBGNU) $(LIBIBERTY) $(GNULIB_H): all-lib all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile @@ -388,9 +391,10 @@ all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile .PHONY: all-lib gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) $(LIBGNU) $(LIBIBERTY) - rm -f gdbreplay$(EXEEXT) - $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \ - $(XM_CLIBS) $(LIBGNU) $(LIBIBERTY) + $(SILENCE) rm -f gdbreplay$(EXEEXT) + $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ + -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \ + $(LIBIBERTY) IPA_OBJS = \ ax-ipa.o \ @@ -410,9 +414,10 @@ IPA_OBJS = \ IPA_LIB = libinproctrace.so $(IPA_LIB): $(IPA_OBJS) ${ADD_DEPS} ${CDEPS} - rm -f $(IPA_LIB) - $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) -Wl,--no-undefined $(INTERNAL_CFLAGS) \ - $(INTERNAL_LDFLAGS) -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread + $(SILENCE) rm -f $(IPA_LIB) + $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \ + -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ + -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread # Put the proper machine-specific files first, so M-. on a machine # specific routine gets the one for the correct machine. @@ -494,15 +499,16 @@ am--refresh: force: version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh - $(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \ - $(host_alias) $(target_alias) $@ + $(ECHO_GEN) $(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \ + $(host_alias) $(target_alias) $@ xml-builtin-generated.c: stamp-xml; @true stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES) - rm -f xml-builtin.tmp - $(SHELL) $(XML_DIR)/feature_to_c.sh xml-builtin.tmp $(XML_FILES) - $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c - echo stamp > stamp-xml + $(SILENCE) rm -f xml-builtin.tmp + $(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \ + xml-builtin.tmp $(XML_FILES) + $(SILENCE) $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c + $(SILENCE) echo stamp > stamp-xml .PRECIOUS: xml-builtin.c @@ -527,7 +533,7 @@ IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \ -fPIC -DIN_PROCESS_AGENT \ -fvisibility=hidden -IPAGENT_COMPILE = $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post) +IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post) # Rules for special cases. @@ -598,16 +604,16 @@ common/%.o: ../common/%.c # -generated to identify and clean them easily. %-generated.c: ../regformats/%.dat | $(regdat_sh) - $(SHELL) $(regdat_sh) $< $@ + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ %-generated.c: ../regformats/arm/%.dat | $(regdat_sh) - $(SHELL) $(regdat_sh) $< $@ + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ %-generated.c: ../regformats/i386/%.dat | $(regdat_sh) - $(SHELL) $(regdat_sh) $< $@ + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ %-generated.c: ../regformats/rs6000/%.dat | $(regdat_sh) - $(SHELL) $(regdat_sh) $< $@ + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ # # Dependency tracking. |