* [PATCH] gdb/doc: use silent-rules.mk in the Makefile
@ 2024-04-12 17:00 Andrew Burgess
2024-04-12 18:31 ` Eli Zaretskii
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Burgess @ 2024-04-12 17:00 UTC (permalink / raw)
To: gdb-patches; +Cc: Andrew Burgess
Make use of silent-rules.mk when building the GDB docs.
Most of these are pretty straight forward, adding ECHO_GEN and then
lots of SILENCE prefixes.
I added a new SILENT_QUIET_FLAG to silent-rules.mk, this is like
SILENT_FLAG, but is set to '-q' when in silent mode, this can be used
with the 'dvips' and 'texi2dvi' commands, both of which use '-q' to
mean: only report errors.
As with the rest of the GDB makefiles, I've only converted the
"generation" rules to use silent-rules.mk, the install / uninstall
rules are left unchanged.
There are still a few "generation" targets that produce output, there
seems to be no flag to silence the 'tex' and 'pdftex' commands which
some recipes use, I've not worried about these for now, e.g. the
refcard.dvi and refcard.pdf targets still produce some output.
Luckily, when doing a 'make all' in the gdb/ directory, we only build
the info docs by default, and those rules are now nice and silent, so
a complete GDB build is now looking nice and quiet by default.
---
gdb/doc/Makefile.in | 158 ++++++++++++++++++++++++--------------------
gdb/silent-rules.mk | 1 +
2 files changed, 86 insertions(+), 73 deletions(-)
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 8007f6373d4..b999e3ffd3b 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -33,6 +33,8 @@ man5dir = $(mandir)/man5
transform = @program_transform_name@
+include $(srcdir)/../silent-rules.mk
+
SHELL = @SHELL@
LN_S = @LN_S@
@@ -406,55 +408,58 @@ de-stage3: force
# GDB QUICK REFERENCE (dvi output)
refcard.dvi : refcard.tex $(REFEDITS)
- echo > tmp.sed
- for f in x $(REFEDITS) ; do \
+ $(ECHO_GEN)
+ $(SILENCE) echo > tmp.sed
+ $(SILENCE) for f in x $(REFEDITS) ; do \
test x$$f = xx && continue ; \
cat $(srcdir)/$$f >>tmp.sed ; \
done
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
- $(SET_TEXINPUTS) $(TEX) sedref.tex
- mv sedref.dvi refcard.dvi
- rm -f sedref.log sedref.tex tmp.sed
+ $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+ $(SILENCE) $(SET_TEXINPUTS) $(TEX) sedref.tex
+ $(SILENCE) mv sedref.dvi refcard.dvi
+ $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
refcard.ps : refcard.dvi
- $(DVIPS) -t landscape -o $@ $?
+ $(ECHO_GEN) $(DVIPS) $(SILENT_QUIET_FLAG) -t landscape -o $@ $?
refcard.pdf : refcard.tex $(REFEDITS)
- echo > tmp.sed
- for f in x $(REFEDITS) ; do \
+ $(ECHO_GEN)
+ $(SILENCE) echo > tmp.sed
+ $(SILENCE) for f in x $(REFEDITS) ; do \
test x$$f = xx && continue ; \
cat $(srcdir)/$$f >>tmp.sed ; \
done
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
- $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
- mv sedref.pdf refcard.pdf
- rm -f sedref.log sedref.tex tmp.sed
+ $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+ $(SILENCE) $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
+ $(SILENCE) mv sedref.pdf refcard.pdf
+ $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
# File to record current GDB version number.
GDBvn.texi : version.subst
- echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
- if [ -n "$(PKGVERSION)" ]; then \
+ $(ECHO_GEN)
+ $(SILENCE) echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
+ $(SILENCE) if [ -n "$(PKGVERSION)" ]; then \
echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \
fi
- echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
- if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
+ $(SILENCE) echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
+ $(SILENCE) if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
echo "@set BUGURL_DEFAULT" >> ./GDBvn.new; \
fi
- if test -z "$(READLINE_TEXI_INCFLAG)"; then \
+ $(SILENCE) if test -z "$(READLINE_TEXI_INCFLAG)"; then \
echo "@set SYSTEM_READLINE" >> ./GDBvn.new; \
fi
- if [ -n "$(SYSTEM_GDBINIT)" ]; then \
+ $(SILENCE) if [ -n "$(SYSTEM_GDBINIT)" ]; then \
escaped_system_gdbinit=`echo $(SYSTEM_GDBINIT) | sed 's/@/@@/g'`; \
echo "@set SYSTEM_GDBINIT $$escaped_system_gdbinit" >> ./GDBvn.new; \
fi
- if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
+ $(SILENCE) if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
escaped_system_gdbinit_dir=`echo $(SYSTEM_GDBINIT_DIR) | sed 's/@/@@/g'`; \
echo "@set SYSTEM_GDBINIT_DIR $$escaped_system_gdbinit_dir" >> ./GDBvn.new; \
fi
- mv GDBvn.new GDBvn.texi
+ $(SILENCE) mv GDBvn.new GDBvn.texi
version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
- date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
+ $(ECHO_GEN) date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
sed -e "s/DATE/$$date/" < $(gdbdir)/version.in > version.subst
# Updated atomically
@@ -465,7 +470,7 @@ version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
# not one for their binary config---which may not be specifically
# defined anyways).
gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
- (test "$(LN_S)" = "ln -s" && \
+ $(ECHO_GEN) (test "$(LN_S)" = "ln -s" && \
ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
@@ -487,29 +492,32 @@ GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
# GDB MANUAL: TeX dvi file
gdb.dvi: ${GDB_DOC_FILES}
- if [ ! -f ./GDBvn.texi ]; then \
+ $(ECHO_GEN)
+ $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- rm -f $(GDB_TEX_TMPS)
- $(TEXI2DVI) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
- $(srcdir)/gdb.texinfo
+ $(SILENCE) rm -f $(GDB_TEX_TMPS)
+ $(SILENCE) $(TEXI2DVI) $(SILENT_QUIET_FLAG) $(READLINE_TEXI_INCFLAG) \
+ -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
gdb.ps: gdb.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_GEN) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
gdb.pdf: ${GDB_DOC_FILES}
- if [ ! -f ./GDBvn.texi ]; then \
+ $(ECHO_GEN)
+ $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- rm -f $(GDB_TEX_TMPS)
- $(TEXI2DVI) --pdf $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+ $(SILENCE) rm -f $(GDB_TEX_TMPS)
+ $(SILENCE) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf \
+ $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
$(srcdir)/gdb.texinfo
# GDB MANUAL: info file
gdb.info: ${GDB_DOC_FILES}
- $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+ $(ECHO_GEN) $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
-o gdb.info $(srcdir)/gdb.texinfo
# GDB MANUAL: roff translations
@@ -527,16 +535,16 @@ gdb.info: ${GDB_DOC_FILES}
# it out for gdb manual's include files---but only if not configured
# in main sourcedir.
links2roff: $(GDB_DOC_SOURCE_INCLUDES)
- if [ ! -f gdb.texinfo ]; then \
+ $(ECHO_GEN) if [ ! -f gdb.texinfo ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \
ln $(GDB_DOC_SOURCE_INCLUDES) . || \
cp $(GDB_DOC_SOURCE_INCLUDES) . ; \
fi
- touch links2roff
+ $(SILENCE) touch links2roff
# gdb manual suitable for [gtn]roff -me
gdb.me: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -551,7 +559,7 @@ gdb.me: $(GDB_DOC_FILES) links2roff
# gdb manual suitable for [gtn]roff -ms
gdb.ms: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -568,7 +576,7 @@ gdb.ms: $(GDB_DOC_FILES) links2roff
# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
# try leaving them in
gdb.mm: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -585,18 +593,18 @@ gdb.mm: $(GDB_DOC_FILES) links2roff
# GDB MANUAL: HTML file
gdb/index.html: ${GDB_DOC_FILES}
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o gdb \
$(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
$(srcdir)/gdb.texinfo
stabs.info: $(STABS_DOC_FILES)
- $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
+ $(ECHO_GEN) $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
# STABS DOCUMENTATION: HTML file
stabs/index.html: $(STABS_DOC_FILES)
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o stabs \
-I $(srcdir) \
$(srcdir)/stabs.texinfo
@@ -609,15 +617,17 @@ STABS_TEX_TMPS = stabs.aux stabs.cp* stabs.fn* stabs.ky* \
# STABS DOCUMENTATION: TeX dvi file
stabs.dvi : $(STABS_DOC_FILES)
- rm -f $(STABS_TEX_TMPS)
- $(TEXI2DVI) -I $(srcdir) $(srcdir)/stabs.texinfo
+ $(ECHO_GEN) rm -f $(STABS_TEX_TMPS)
+ $(SILENCE) $(TEXI2DVI) $(SILENT_QUIET_FLAG) -I $(srcdir) \
+ $(srcdir)/stabs.texinfo
stabs.ps: stabs.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_GEN) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
stabs.pdf: $(STABS_DOC_FILES)
- rm -f $(STABS_TEX_TMPS)
- $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/stabs.texinfo
+ $(ECHO_GEN) rm -f $(STABS_TEX_TMPS)
+ $(SILENCE) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf -I $(srcdir) \
+ $(srcdir)/stabs.texinfo
# Clean these up before each run. Avoids a catch 22 with not being
# able to re-generate these files (to fix a corruption) because these
@@ -627,65 +637,67 @@ ANNOTATE_TEX_TMPS = annotate.aux annotate.cp* annotate.fn* annotate.ky* \
# ANNOTATE DOCUMENTATION: TeX dvi file
annotate.dvi : $(ANNOTATE_DOC_FILES)
- rm -f $(ANNOTATE_TEX_TMPS)
- $(TEXI2DVI) -I $(srcdir) $(srcdir)/annotate.texinfo
+ $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
+ $(ECHO_GEN) $(TEXI2DVI) $(SILENT_QUIET_FLAG) -I $(srcdir) \
+ $(srcdir)/annotate.texinfo
annotate.ps: annotate.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_GEN) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
annotate.pdf: $(ANNOTATE_DOC_FILES)
- rm -f $(ANNOTATE_TEX_TMPS)
- $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/annotate.texinfo
+ $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
+ $(ECHO_GEN) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf -I $(srcdir) \
+ $(srcdir)/annotate.texinfo
annotate.info: $(ANNOTATE_DOC_FILES)
- $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
+ $(ECHO_GEN) $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
annotate/index.html: $(ANNOTATE_DOC_FILES)
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o annotate \
-I $(srcdir) \
$(srcdir)/annotate.texinfo
# Man pages
gdb.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
- -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(ECHO_GEN) touch $@
+ $(SILENCE) -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
+ $(SILENCE) -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdb.pod
+ $(SILENCE) rm -f gdb.pod
gdbserver.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbserver < $(srcdir)/gdb.texinfo > gdbserver.pod
- -($(POD2MAN1) gdbserver.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(ECHO_GEN) touch $@
+ $(SILENCE) -$(TEXI2POD) $(MANCONF) -Dgdbserver < $(srcdir)/gdb.texinfo > gdbserver.pod
+ $(SILENCE) -($(POD2MAN1) gdbserver.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdbserver.pod
+ $(SILENCE) rm -f gdbserver.pod
gcore.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgcore < $(srcdir)/gdb.texinfo > gcore.pod
- -($(POD2MAN1) gcore.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(ECHO_GEN) touch $@
+ $(SILENCE) -$(TEXI2POD) $(MANCONF) -Dgcore < $(srcdir)/gdb.texinfo > gcore.pod
+ $(SILENCE) -($(POD2MAN1) gcore.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gcore.pod
+ $(SILENCE) rm -f gcore.pod
gdb-add-index.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
- -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(ECHO_GEN) touch $@
+ $(SILENCE) -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
+ $(SILENCE) -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdb-add-index.pod
+ $(SILENCE) rm -f gdb-add-index.pod
gdbinit.5: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
- -($(POD2MAN5) gdbinit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(ECHO_GEN) touch $@
+ $(SILENCE) -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
+ $(SILENCE) -($(POD2MAN5) gdbinit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdbinit.pod
+ $(SILENCE) rm -f gdbinit.pod
force:
Makefile: Makefile.in $(host_makefile_frag) ../config.status
- cd .. && $(SHELL) ./config.status doc/Makefile
+ $(ECHO_GEN) cd .. && $(SHELL) ./config.status $(SILENT_FLAG) doc/Makefile
# The "least clean" level of cleaning. Get rid of files which are
diff --git a/gdb/silent-rules.mk b/gdb/silent-rules.mk
index 43dc2bf3aca..324dae52954 100644
--- a/gdb/silent-rules.mk
+++ b/gdb/silent-rules.mk
@@ -20,6 +20,7 @@ ECHO_RANLIB = @echo " RANLIB $@";
SILENCE = @
# Silence libtool.
SILENT_FLAG = --silent
+SILENT_QUIET_FLAG = -q
# Used in shell snippets instead of 'echo'.
SILENT_ECHO = true
else
base-commit: 032e5e0c0c08977e8109e8482cd944bac8572d92
--
2.25.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-12 17:00 [PATCH] gdb/doc: use silent-rules.mk in the Makefile Andrew Burgess
@ 2024-04-12 18:31 ` Eli Zaretskii
2024-04-12 22:32 ` Andrew Burgess
0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-12 18:31 UTC (permalink / raw)
To: Andrew Burgess; +Cc: gdb-patches
> From: Andrew Burgess <aburgess@redhat.com>
> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Fri, 12 Apr 2024 18:00:23 +0100
>
> Make use of silent-rules.mk when building the GDB docs.
>
> Most of these are pretty straight forward, adding ECHO_GEN and then
> lots of SILENCE prefixes.
>
> I added a new SILENT_QUIET_FLAG to silent-rules.mk, this is like
> SILENT_FLAG, but is set to '-q' when in silent mode, this can be used
> with the 'dvips' and 'texi2dvi' commands, both of which use '-q' to
> mean: only report errors.
>
> As with the rest of the GDB makefiles, I've only converted the
> "generation" rules to use silent-rules.mk, the install / uninstall
> rules are left unchanged.
>
> There are still a few "generation" targets that produce output, there
> seems to be no flag to silence the 'tex' and 'pdftex' commands which
> some recipes use, I've not worried about these for now, e.g. the
> refcard.dvi and refcard.pdf targets still produce some output.
>
> Luckily, when doing a 'make all' in the gdb/ directory, we only build
> the info docs by default, and those rules are now nice and silent, so
> a complete GDB build is now looking nice and quiet by default.
> ---
> gdb/doc/Makefile.in | 158 ++++++++++++++++++++++++--------------------
> gdb/silent-rules.mk | 1 +
> 2 files changed, 86 insertions(+), 73 deletions(-)
Doesn't this silence too much? Can you should the output of each rule
after the changes?
Thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-12 18:31 ` Eli Zaretskii
@ 2024-04-12 22:32 ` Andrew Burgess
2024-04-13 7:02 ` Eli Zaretskii
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Burgess @ 2024-04-12 22:32 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andrew Burgess <aburgess@redhat.com>
>> Cc: Andrew Burgess <aburgess@redhat.com>
>> Date: Fri, 12 Apr 2024 18:00:23 +0100
>>
>> Make use of silent-rules.mk when building the GDB docs.
>>
>> Most of these are pretty straight forward, adding ECHO_GEN and then
>> lots of SILENCE prefixes.
>>
>> I added a new SILENT_QUIET_FLAG to silent-rules.mk, this is like
>> SILENT_FLAG, but is set to '-q' when in silent mode, this can be used
>> with the 'dvips' and 'texi2dvi' commands, both of which use '-q' to
>> mean: only report errors.
>>
>> As with the rest of the GDB makefiles, I've only converted the
>> "generation" rules to use silent-rules.mk, the install / uninstall
>> rules are left unchanged.
>>
>> There are still a few "generation" targets that produce output, there
>> seems to be no flag to silence the 'tex' and 'pdftex' commands which
>> some recipes use, I've not worried about these for now, e.g. the
>> refcard.dvi and refcard.pdf targets still produce some output.
>>
>> Luckily, when doing a 'make all' in the gdb/ directory, we only build
>> the info docs by default, and those rules are now nice and silent, so
>> a complete GDB build is now looking nice and quiet by default.
>> ---
>> gdb/doc/Makefile.in | 158 ++++++++++++++++++++++++--------------------
>> gdb/silent-rules.mk | 1 +
>> 2 files changed, 86 insertions(+), 73 deletions(-)
>
> Doesn't this silence too much? Can you should the output of each rule
> after the changes?
Yes you can. As with the rest of GDB, if you do:
make all-gdb V=1
or
make -C gdb/doc all-doc V=1
then you'll get everything back, just as it was before.
For the commands that now get '-q' passed to them, the manual pages
claim that errors will still be printed. So if something goes wrong you
should still see the output required to fix the problem (without having
to pass V=1).
Some commands, like 'tex' and 'pdftex' don't have a -q option. In these
cases I've not tried to silence the command as I assume any errors will
arrive on stdout mixed in with the general noise.
Thanks,
Andrew
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-12 22:32 ` Andrew Burgess
@ 2024-04-13 7:02 ` Eli Zaretskii
2024-04-15 13:55 ` Andrew Burgess
0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-13 7:02 UTC (permalink / raw)
To: Andrew Burgess; +Cc: gdb-patches
> From: Andrew Burgess <aburgess@redhat.com>
> Cc: gdb-patches@sourceware.org
> Date: Fri, 12 Apr 2024 23:32:28 +0100
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> gdb/doc/Makefile.in | 158 ++++++++++++++++++++++++--------------------
> >> gdb/silent-rules.mk | 1 +
> >> 2 files changed, 86 insertions(+), 73 deletions(-)
> >
> > Doesn't this silence too much? Can you should the output of each rule
> > after the changes?
>
> Yes you can. As with the rest of GDB, if you do:
>
> make all-gdb V=1
Yes, I know. But that's not what I meant, sorry for being unclear. I
meant to ask _you_ to show the output of each rule that you change to
be silent, so that I could compare that with what it outputs
un-silenced, and decide whether we remove too much from the output.
I've now tried to figure that out by reading the silent-rules.mk
macros, and I feel that, indeed, in some cases we silence too much,
without (IMO) a good reason. For example:
> gdb.1: $(GDB_DOC_FILES)
> - touch $@
> - -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
> - -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
> + $(ECHO_GEN) touch $@
> + $(SILENCE) -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
> + $(SILENCE) -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
> mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
> - rm -f gdb.pod
> + $(SILENCE) rm -f gdb.pod
This completely conceals the fact that we run texi2pod and pod2man,
ending with just a single vague
GEN gdb.1
I think significant commands should be shown to the user, for better
"situational awareness". The analogy with compilation and linking
here, if that's what served the model for these changes, is IMO
incomplete: when we compile or link, seeing just "CXX foo.o" or
"CXXLD gdb" is enough to tell us what happens, whereas with the
generic "GEN foo" we don't really know what happens at all.
So my preference would be for having the above emit something like the
below instead
TEXI2POD gdb.pod
POD2MAN1 gdb.1
And similarly with the likes of
> annotate.pdf: $(ANNOTATE_DOC_FILES)
> - rm -f $(ANNOTATE_TEX_TMPS)
> - $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/annotate.texinfo
> + $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
> + $(ECHO_GEN) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf -I $(srcdir) \
> + $(srcdir)/annotate.texinfo
Why emit just
GEN annotate.pdf
? I'd prefer something like
TEXI2DVI annotate.pdf
instead.
Does this make sense?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-13 7:02 ` Eli Zaretskii
@ 2024-04-15 13:55 ` Andrew Burgess
2024-04-15 14:18 ` Simon Marchi
2024-04-15 14:37 ` Eli Zaretskii
0 siblings, 2 replies; 16+ messages in thread
From: Andrew Burgess @ 2024-04-15 13:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andrew Burgess <aburgess@redhat.com>
>> Cc: gdb-patches@sourceware.org
>> Date: Fri, 12 Apr 2024 23:32:28 +0100
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> gdb/doc/Makefile.in | 158 ++++++++++++++++++++++++--------------------
>> >> gdb/silent-rules.mk | 1 +
>> >> 2 files changed, 86 insertions(+), 73 deletions(-)
>> >
>> > Doesn't this silence too much? Can you should the output of each rule
>> > after the changes?
>>
>> Yes you can. As with the rest of GDB, if you do:
>>
>> make all-gdb V=1
>
> Yes, I know. But that's not what I meant, sorry for being unclear. I
> meant to ask _you_ to show the output of each rule that you change to
> be silent, so that I could compare that with what it outputs
> un-silenced, and decide whether we remove too much from the output.
>
> I've now tried to figure that out by reading the silent-rules.mk
> macros, and I feel that, indeed, in some cases we silence too much,
> without (IMO) a good reason. For example:
>
>> gdb.1: $(GDB_DOC_FILES)
>> - touch $@
>> - -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
>> - -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
>> + $(ECHO_GEN) touch $@
>> + $(SILENCE) -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
>> + $(SILENCE) -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
>> mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
>> - rm -f gdb.pod
>> + $(SILENCE) rm -f gdb.pod
>
> This completely conceals the fact that we run texi2pod and pod2man,
> ending with just a single vague
>
> GEN gdb.1
>
> I think significant commands should be shown to the user, for better
> "situational awareness". The analogy with compilation and linking
> here, if that's what served the model for these changes, is IMO
> incomplete: when we compile or link, seeing just "CXX foo.o" or
> "CXXLD gdb" is enough to tell us what happens, whereas with the
> generic "GEN foo" we don't really know what happens at all.
>
> So my preference would be for having the above emit something like the
> below instead
>
> TEXI2POD gdb.pod
> POD2MAN1 gdb.1
That one's harder. The target information comes from make's $@
variable, so it's easy enough to do:
TEXI2POD gdb.1
POD2MAN gdb.1
which isn't exactly what you asked for.
Anyway an updated patch is below. I've then included the output of
'make -C gdb/doc all-doc diststuff' with and without V=1 flag.
Let me know if this is acceptable or not.
Thanks,
Andrew
--- Updated Patch ---
commit ffcabda2a2c7fef79fc3999b0d31828990731838
Author: Andrew Burgess <aburgess@redhat.com>
Date: Fri Apr 12 17:47:20 2024 +0100
gdb/doc: use silent-rules.mk in the Makefile
Make use of silent-rules.mk when building the GDB docs.
During review it was requested that there be more specific rules than
just reusing the general 'GEN' rule everywhere in the doc/ directory,
so I've added:
ECHO_DVIPS = @echo " DVIPS $@";
ECHO_TEX = @echo " TEX $@";
ECHO_PDFTEX = @echo " PDFTEX $@";
ECHO_TEXI2DVI = @echo " TEXI2DVI $@";
ECHO_MAKEHTML = @echo " MAKEHTML $@";
ECHO_TEXI2POD = @echo " TEXI2POD $@";
ECHO_TEXI2MAN = @echo " TEXI2MAN $@";
ECHO_MAKEINFO = @echo " MAKEINFO $@";
Then I've made use of these new silent rules and added lots of uses of
SILENT to reduce additional clutter.
I've also added a new SILENT_QUIET_FLAG to silent-rules.mk, this is
like SILENT_FLAG, but is set to '-q' when in silent mode, this can be
used with the 'dvips' and 'texi2dvi' commands, both of which use '-q'
to mean: only report errors.
As with the rest of the GDB makefiles, I've only converted the
"generation" rules to use silent-rules.mk, the install / uninstall
rules are left unchanged.
There are still a few "generation" targets that produce output, there
seems to be no flag to silence the 'tex' and 'pdftex' commands which
some recipes use, I've not worried about these for now, e.g. the
refcard.dvi and refcard.pdf targets still produce some output.
Luckily, when doing a 'make all' in the gdb/ directory, we only build
the info docs by default, and those rules are now nice and silent, so
a complete GDB build is now looking nice and quiet by default.
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 8007f6373d4..09769fbff10 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -33,6 +33,8 @@ man5dir = $(mandir)/man5
transform = @program_transform_name@
+include $(srcdir)/../silent-rules.mk
+
SHELL = @SHELL@
LN_S = @LN_S@
@@ -238,7 +240,7 @@ Doxyfile-gdbserver: $(srcdir)/Doxyfile-gdbserver.in
all-doc: info dvi ps pdf
diststuff: info man
- rm -f gdb-cfg.texi
+ $(SILENCE) rm -f gdb-cfg.texi
install-info: $(INFO_DEPS)
$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(infodir)
@@ -406,55 +408,56 @@ de-stage3: force
# GDB QUICK REFERENCE (dvi output)
refcard.dvi : refcard.tex $(REFEDITS)
- echo > tmp.sed
- for f in x $(REFEDITS) ; do \
+ $(SILENCE) echo > tmp.sed
+ $(SILENCE) for f in x $(REFEDITS) ; do \
test x$$f = xx && continue ; \
cat $(srcdir)/$$f >>tmp.sed ; \
done
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
- $(SET_TEXINPUTS) $(TEX) sedref.tex
- mv sedref.dvi refcard.dvi
- rm -f sedref.log sedref.tex tmp.sed
+ $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+ $(ECHO_TEX) $(SET_TEXINPUTS) $(TEX) sedref.tex
+ $(SILENCE) mv sedref.dvi refcard.dvi
+ $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
refcard.ps : refcard.dvi
- $(DVIPS) -t landscape -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_QUIET_FLAG) -t landscape -o $@ $?
refcard.pdf : refcard.tex $(REFEDITS)
- echo > tmp.sed
- for f in x $(REFEDITS) ; do \
+ $(SILENCE) echo > tmp.sed
+ $(SILENCE) for f in x $(REFEDITS) ; do \
test x$$f = xx && continue ; \
cat $(srcdir)/$$f >>tmp.sed ; \
done
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
- $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
- mv sedref.pdf refcard.pdf
- rm -f sedref.log sedref.tex tmp.sed
+ $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+ $(ECHO_PDFTEX) $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
+ $(SILENCE) mv sedref.pdf refcard.pdf
+ $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
# File to record current GDB version number.
GDBvn.texi : version.subst
- echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
- if [ -n "$(PKGVERSION)" ]; then \
+ $(ECHO_GEN)
+ $(SILENCE) echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
+ $(SILENCE) if [ -n "$(PKGVERSION)" ]; then \
echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \
fi
- echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
- if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
+ $(SILENCE) echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
+ $(SILENCE) if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
echo "@set BUGURL_DEFAULT" >> ./GDBvn.new; \
fi
- if test -z "$(READLINE_TEXI_INCFLAG)"; then \
+ $(SILENCE) if test -z "$(READLINE_TEXI_INCFLAG)"; then \
echo "@set SYSTEM_READLINE" >> ./GDBvn.new; \
fi
- if [ -n "$(SYSTEM_GDBINIT)" ]; then \
+ $(SILENCE) if [ -n "$(SYSTEM_GDBINIT)" ]; then \
escaped_system_gdbinit=`echo $(SYSTEM_GDBINIT) | sed 's/@/@@/g'`; \
echo "@set SYSTEM_GDBINIT $$escaped_system_gdbinit" >> ./GDBvn.new; \
fi
- if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
+ $(SILENCE) if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
escaped_system_gdbinit_dir=`echo $(SYSTEM_GDBINIT_DIR) | sed 's/@/@@/g'`; \
echo "@set SYSTEM_GDBINIT_DIR $$escaped_system_gdbinit_dir" >> ./GDBvn.new; \
fi
- mv GDBvn.new GDBvn.texi
+ $(SILENCE) mv GDBvn.new GDBvn.texi
version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
- date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
+ $(ECHO_GEN) date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
sed -e "s/DATE/$$date/" < $(gdbdir)/version.in > version.subst
# Updated atomically
@@ -465,7 +468,7 @@ version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
# not one for their binary config---which may not be specifically
# defined anyways).
gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
- (test "$(LN_S)" = "ln -s" && \
+ $(ECHO_GEN) (test "$(LN_S)" = "ln -s" && \
ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
@@ -487,29 +490,30 @@ GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
# GDB MANUAL: TeX dvi file
gdb.dvi: ${GDB_DOC_FILES}
- if [ ! -f ./GDBvn.texi ]; then \
+ $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- rm -f $(GDB_TEX_TMPS)
- $(TEXI2DVI) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
- $(srcdir)/gdb.texinfo
+ $(SILENCE) rm -f $(GDB_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) $(READLINE_TEXI_INCFLAG) \
+ -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
gdb.ps: gdb.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
gdb.pdf: ${GDB_DOC_FILES}
- if [ ! -f ./GDBvn.texi ]; then \
+ $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- rm -f $(GDB_TEX_TMPS)
- $(TEXI2DVI) --pdf $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+ $(SILENCE) rm -f $(GDB_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf \
+ $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
$(srcdir)/gdb.texinfo
# GDB MANUAL: info file
gdb.info: ${GDB_DOC_FILES}
- $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
-o gdb.info $(srcdir)/gdb.texinfo
# GDB MANUAL: roff translations
@@ -527,16 +531,16 @@ gdb.info: ${GDB_DOC_FILES}
# it out for gdb manual's include files---but only if not configured
# in main sourcedir.
links2roff: $(GDB_DOC_SOURCE_INCLUDES)
- if [ ! -f gdb.texinfo ]; then \
+ $(ECHO_GEN) if [ ! -f gdb.texinfo ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \
ln $(GDB_DOC_SOURCE_INCLUDES) . || \
cp $(GDB_DOC_SOURCE_INCLUDES) . ; \
fi
- touch links2roff
+ $(SILENCE) touch links2roff
# gdb manual suitable for [gtn]roff -me
gdb.me: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -551,7 +555,7 @@ gdb.me: $(GDB_DOC_FILES) links2roff
# gdb manual suitable for [gtn]roff -ms
gdb.ms: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -568,7 +572,7 @@ gdb.ms: $(GDB_DOC_FILES) links2roff
# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
# try leaving them in
gdb.mm: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -585,18 +589,18 @@ gdb.mm: $(GDB_DOC_FILES) links2roff
# GDB MANUAL: HTML file
gdb/index.html: ${GDB_DOC_FILES}
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o gdb \
$(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
$(srcdir)/gdb.texinfo
stabs.info: $(STABS_DOC_FILES)
- $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
# STABS DOCUMENTATION: HTML file
stabs/index.html: $(STABS_DOC_FILES)
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o stabs \
-I $(srcdir) \
$(srcdir)/stabs.texinfo
@@ -609,15 +613,17 @@ STABS_TEX_TMPS = stabs.aux stabs.cp* stabs.fn* stabs.ky* \
# STABS DOCUMENTATION: TeX dvi file
stabs.dvi : $(STABS_DOC_FILES)
- rm -f $(STABS_TEX_TMPS)
- $(TEXI2DVI) -I $(srcdir) $(srcdir)/stabs.texinfo
+ $(SILENCE) rm -f $(STABS_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) -I $(srcdir) \
+ $(srcdir)/stabs.texinfo
stabs.ps: stabs.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
stabs.pdf: $(STABS_DOC_FILES)
- rm -f $(STABS_TEX_TMPS)
- $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/stabs.texinfo
+ $(SILENCE) rm -f $(STABS_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf -I $(srcdir) \
+ $(srcdir)/stabs.texinfo
# Clean these up before each run. Avoids a catch 22 with not being
# able to re-generate these files (to fix a corruption) because these
@@ -627,65 +633,67 @@ ANNOTATE_TEX_TMPS = annotate.aux annotate.cp* annotate.fn* annotate.ky* \
# ANNOTATE DOCUMENTATION: TeX dvi file
annotate.dvi : $(ANNOTATE_DOC_FILES)
- rm -f $(ANNOTATE_TEX_TMPS)
- $(TEXI2DVI) -I $(srcdir) $(srcdir)/annotate.texinfo
+ $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) -I $(srcdir) \
+ $(srcdir)/annotate.texinfo
annotate.ps: annotate.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
annotate.pdf: $(ANNOTATE_DOC_FILES)
- rm -f $(ANNOTATE_TEX_TMPS)
- $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/annotate.texinfo
+ $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf -I $(srcdir) \
+ $(srcdir)/annotate.texinfo
annotate.info: $(ANNOTATE_DOC_FILES)
- $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
annotate/index.html: $(ANNOTATE_DOC_FILES)
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_MAKEHTML) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o annotate \
-I $(srcdir) \
$(srcdir)/annotate.texinfo
# Man pages
gdb.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
- -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(SILENCE) touch $@
+ -$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
+ -$(ECHO_TEXI2MAN) ($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdb.pod
+ $(SILENCE) rm -f gdb.pod
gdbserver.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbserver < $(srcdir)/gdb.texinfo > gdbserver.pod
- -($(POD2MAN1) gdbserver.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(SILENCE) touch $@
+ -$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgdbserver < $(srcdir)/gdb.texinfo > gdbserver.pod
+ -$(ECHO_TEXI2MAN) ($(POD2MAN1) gdbserver.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdbserver.pod
+ $(SILENCE) rm -f gdbserver.pod
gcore.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgcore < $(srcdir)/gdb.texinfo > gcore.pod
- -($(POD2MAN1) gcore.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(SILENCE) touch $@
+ -$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgcore < $(srcdir)/gdb.texinfo > gcore.pod
+ -$(ECHO_TEXI2MAN) ($(POD2MAN1) gcore.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gcore.pod
+ $(SILENCE) rm -f gcore.pod
gdb-add-index.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
- -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(SILENCE) touch $@
+ -$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
+ -$(ECHO_TEXI2MAN) ($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdb-add-index.pod
+ $(SILENCE) rm -f gdb-add-index.pod
gdbinit.5: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
- -($(POD2MAN5) gdbinit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ $(SILENCE) touch $@
+ -$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
+ -$(ECHO_TEXI2MAN) ($(POD2MAN5) gdbinit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdbinit.pod
+ $(SILENCE) rm -f gdbinit.pod
force:
Makefile: Makefile.in $(host_makefile_frag) ../config.status
- cd .. && $(SHELL) ./config.status doc/Makefile
+ $(ECHO_GEN) cd .. && $(SHELL) ./config.status $(SILENT_FLAG) doc/Makefile
# The "least clean" level of cleaning. Get rid of files which are
diff --git a/gdb/silent-rules.mk b/gdb/silent-rules.mk
index 43dc2bf3aca..745720ecc80 100644
--- a/gdb/silent-rules.mk
+++ b/gdb/silent-rules.mk
@@ -17,9 +17,23 @@ ECHO_YACC = @echo " YACC $@";
ECHO_LEX = @echo " LEX $@";
ECHO_AR = @echo " AR $@";
ECHO_RANLIB = @echo " RANLIB $@";
+ECHO_DVIPS = @echo " DVIPS $@";
+ECHO_TEX = @echo " TEX $@";
+ECHO_PDFTEX = @echo " PDFTEX $@";
+ECHO_TEXI2DVI = \
+ @echo " TEXI2DVI $@";
+ECHO_MAKEHTML = \
+ @echo " MAKEHTML $@";
+ECHO_TEXI2POD = \
+ @echo " TEXI2POD $@";
+ECHO_TEXI2MAN = \
+ @echo " TEXI2MAN $@";
+ECHO_MAKEINFO = \
+ @echo " MAKEINFO $@";
SILENCE = @
# Silence libtool.
SILENT_FLAG = --silent
+SILENT_QUIET_FLAG = -q
# Used in shell snippets instead of 'echo'.
SILENT_ECHO = true
else
--- Default Output ---
$shell$ > make -C gdb/doc all-doc diststuff
make: Entering directory '/tmp/build/gdb/doc'
GEN Makefile
GEN gdb-cfg.texi
MAKEINFO gdb.info
MAKEINFO stabs.info
MAKEINFO annotate.info
TEXI2DVI gdb.dvi
TEXI2DVI stabs.dvi
TEX refcard.dvi
This is TeX, Version 3.14159265 (TeX Live 2019) (preloaded format=tex)
(./sedref.tex [1]
Underfull \hbox (badness 1297) in paragraph at lines 569--569
[]\rm octal, dec-i-mal, or hex num-ber
[2] )
(see the transcript file for additional information)
Output written on sedref.dvi (2 pages, 21812 bytes).
Transcript written on sedref.log.
TEXI2DVI annotate.dvi
DVIPS gdb.ps
DVIPS stabs.ps
DVIPS refcard.ps
DVIPS annotate.ps
TEXI2DVI gdb.pdf
TEXI2DVI stabs.pdf
PDFTEX refcard.pdf
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdftex)
restricted \write18 enabled.
entering extended mode
(./sedref.tex [1{/usr/share/texlive/texmf-dist/fonts/map/pdftex/updmap/pdftex.m
ap}]
Underfull \hbox (badness 1297) in paragraph at lines 569--569
[]\rm octal, dec-i-mal, or hex num-ber
[2] )
(see the transcript file for additional information)</usr/share/texlive/texmf-d
ist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fo
nts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/ty
pe1/public/amsfonts/cm/cmmi10.pfb></usr/share/texlive/texmf-dist/fonts/type1/pu
blic/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/am
sfonts/cm/cmr6.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/c
m/cmr7.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10
.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti7.pfb></
usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt8.pfb>
Output written on sedref.pdf (2 pages, 118801 bytes).
Transcript written on sedref.log.
TEXI2DVI annotate.pdf
TEXI2POD gdb.1
TEXI2MAN gdb.1
TEXI2POD gdbserver.1
TEXI2MAN gdbserver.1
TEXI2POD gcore.1
TEXI2MAN gcore.1
TEXI2POD gdb-add-index.1
TEXI2MAN gdb-add-index.1
TEXI2POD gdbinit.5
TEXI2MAN gdbinit.5
make: Leaving directory '/tmp/build/gdb/doc'
$shell$ >
--- Output With V=1 (I've removed some command output to reduce length) ---
$shell$ > make -C gdb/doc all-doc diststuff V=1
make: Entering directory '/tmp/build/gdb/doc'
cd .. && /bin/sh ./config.status doc/Makefile
config.status: creating doc/Makefile
makeinfo -DHAVE_MAKEINFO_CLICK -I ../../../src/gdb/doc/../../readline/readline/doc -I ../../../src/gdb/doc/../mi -I ../../../src/gdb/doc \
-o gdb.info ../../../src/gdb/doc/gdb.texinfo
makeinfo -DHAVE_MAKEINFO_CLICK -I ../../../src/gdb/doc -o stabs.info ../../../src/gdb/doc/stabs.texinfo
makeinfo -DHAVE_MAKEINFO_CLICK -I ../../../src/gdb/doc -o annotate.info ../../../src/gdb/doc/annotate.texinfo
if [ ! -f ./GDBvn.texi ]; then \
(test "ln -s" = "ln -s" && ln -s ../../../src/gdb/doc/GDBvn.texi .) || \
ln ../../../src/gdb/doc/GDBvn.texi . || \
cp ../../../src/gdb/doc/GDBvn.texi . ; else true; fi
rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc gdb.tp* gdb.vr*
texi2dvi -I ../../../src/gdb/doc/../../readline/readline/doc \
-I ../../../src/gdb/doc/../mi -I ../../../src/gdb/doc ../../../src/gdb/doc/gdb.texinfo
... snip pages of output ...
rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
texi2dvi -I ../../../src/gdb/doc \
../../../src/gdb/doc/stabs.texinfo
... snip tex output ...
echo > tmp.sed
for f in x ; do \
test x$f = xx && continue ; \
cat ../../../src/gdb/doc/$f >>tmp.sed ; \
done
sed -f tmp.sed ../../../src/gdb/doc/refcard.tex >sedref.tex
TEXINPUTS=../../../src/gdb/doc/../../texinfo:.:../../../src/gdb/doc:../../../src/gdb/doc/../../readline/readline/doc:../../../src/gdb/doc/../mi:$TEXINPUTS tex sedref.tex
... snip tex output ...
mv sedref.dvi refcard.dvi
rm -f sedref.log sedref.tex tmp.sed
rm -f annotate.aux annotate.cp* annotate.fn* annotate.ky* annotate.log annotate.pg* annotate.toc annotate.tp* annotate.vr*
texi2dvi -I ../../../src/gdb/doc \
../../../src/gdb/doc/annotate.texinfo
... snip tex output ...
dvips -o gdb.ps gdb.dvi
... snip dvips output ...
dvips -o stabs.ps stabs.dvi
... snip dvips output ...
dvips -t landscape -o refcard.ps refcard.dvi
... snip dvips output ...
dvips -o annotate.ps annotate.dvi
... snip dvips output ...
if [ ! -f ./GDBvn.texi ]; then \
(test "ln -s" = "ln -s" && ln -s ../../../src/gdb/doc/GDBvn.texi .) || \
ln ../../../src/gdb/doc/GDBvn.texi . || \
cp ../../../src/gdb/doc/GDBvn.texi . ; else true; fi
rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc gdb.tp* gdb.vr*
texi2dvi --pdf \
-I ../../../src/gdb/doc/../../readline/readline/doc -I ../../../src/gdb/doc/../mi -I ../../../src/gdb/doc \
../../../src/gdb/doc/gdb.texinfo
... snip pages of texi2dvi output ...
rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
texi2dvi --pdf -I ../../../src/gdb/doc \
../../../src/gdb/doc/stabs.texinfo
... snip texi2dvi output ...
echo > tmp.sed
for f in x ; do \
test x$f = xx && continue ; \
cat ../../../src/gdb/doc/$f >>tmp.sed ; \
done
sed -f tmp.sed ../../../src/gdb/doc/refcard.tex >sedref.tex
TEXINPUTS=../../../src/gdb/doc/../../texinfo:.:../../../src/gdb/doc:../../../src/gdb/doc/../../readline/readline/doc:../../../src/gdb/doc/../mi:$TEXINPUTS pdftex sedref.tex
... snip some command output ...
mv sedref.pdf refcard.pdf
rm -f sedref.log sedref.tex tmp.sed
rm -f annotate.aux annotate.cp* annotate.fn* annotate.ky* annotate.log annotate.pg* annotate.toc annotate.tp* annotate.vr*
texi2dvi --pdf -I ../../../src/gdb/doc \
../../../src/gdb/doc/annotate.texinfo
... snip command output ...
touch gdb.1
perl ../../../src/gdb/doc/../../etc/texi2pod.pl -DHAVE_MAKEINFO_CLICK -Dman -Dgdb < ../../../src/gdb/doc/gdb.texinfo > gdb.pod
(pod2man --center="GNU Development Tools" --release="gdb-`sed q version.subst`" --section=1 gdb.pod | sed -e '/^.if n .na/d' > gdb.1.T$$ && \
mv -f gdb.1.T$$ gdb.1) || (rm -f gdb.1.T$$ && exit 1)
rm -f gdb.pod
touch gdbserver.1
perl ../../../src/gdb/doc/../../etc/texi2pod.pl -DHAVE_MAKEINFO_CLICK -Dman -Dgdbserver < ../../../src/gdb/doc/gdb.texinfo > gdbserver.pod
(pod2man --center="GNU Development Tools" --release="gdb-`sed q version.subst`" --section=1 gdbserver.pod | sed -e '/^.if n .na/d' > gdbserver.1.T$$ && \
mv -f gdbserver.1.T$$ gdbserver.1) || (rm -f gdbserver.1.T$$ && exit 1)
rm -f gdbserver.pod
touch gcore.1
perl ../../../src/gdb/doc/../../etc/texi2pod.pl -DHAVE_MAKEINFO_CLICK -Dman -Dgcore < ../../../src/gdb/doc/gdb.texinfo > gcore.pod
(pod2man --center="GNU Development Tools" --release="gdb-`sed q version.subst`" --section=1 gcore.pod | sed -e '/^.if n .na/d' > gcore.1.T$$ && \
mv -f gcore.1.T$$ gcore.1) || (rm -f gcore.1.T$$ && exit 1)
rm -f gcore.pod
touch gdb-add-index.1
perl ../../../src/gdb/doc/../../etc/texi2pod.pl -DHAVE_MAKEINFO_CLICK -Dman -Dgdb-add-index < ../../../src/gdb/doc/gdb.texinfo > gdb-add-index.pod
(pod2man --center="GNU Development Tools" --release="gdb-`sed q version.subst`" --section=1 gdb-add-index.pod | sed -e '/^.if n .na/d' > gdb-add-index.1.T$$ && \
mv -f gdb-add-index.1.T$$ gdb-add-index.1) || (rm -f gdb-add-index.1.T$$ && exit 1)
rm -f gdb-add-index.pod
touch gdbinit.5
perl ../../../src/gdb/doc/../../etc/texi2pod.pl -DHAVE_MAKEINFO_CLICK -Dman -Dgdbinit < ../../../src/gdb/doc/gdb.texinfo > gdbinit.pod
(pod2man --center="GNU Development Tools" --release="gdb-`sed q version.subst`" --section=5 gdbinit.pod | sed -e '/^.if n .na/d' > gdbinit.5.T$$ && \
mv -f gdbinit.5.T$$ gdbinit.5) || (rm -f gdbinit.5.T$$ && exit 1)
rm -f gdbinit.pod
rm -f gdb-cfg.texi
make: Leaving directory '/tmp/build/gdb/doc'
$shell$>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-15 13:55 ` Andrew Burgess
@ 2024-04-15 14:18 ` Simon Marchi
2024-04-16 7:48 ` Andrew Burgess
2024-04-15 14:37 ` Eli Zaretskii
1 sibling, 1 reply; 16+ messages in thread
From: Simon Marchi @ 2024-04-15 14:18 UTC (permalink / raw)
To: Andrew Burgess, Eli Zaretskii; +Cc: gdb-patches
On 4/15/24 9:55 AM, Andrew Burgess wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
>> So my preference would be for having the above emit something like the
>> below instead
>>
>> TEXI2POD gdb.pod
>> POD2MAN1 gdb.1
>
> That one's harder. The target information comes from make's $@
> variable, so it's easy enough to do:
>
> TEXI2POD gdb.1
> POD2MAN gdb.1
>
> which isn't exactly what you asked for.
Could you split the rule in two? One rule generating gdb.pod and one
rule generating gdb.1.
I personally think the original output from Andrew's patch is fine. In
the silent mode, all I need to know is that make is currently working on
getting gdb.1 generated. The intermediary gdb.pod file is an
implementation detail of the rule. If I want to see it, then I'll use
`make V=1`.
But if it makes everyone happy, I don't mind if we split the rule in
two. Smaller and simpler rules are easier to understand.
Simon
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-15 13:55 ` Andrew Burgess
2024-04-15 14:18 ` Simon Marchi
@ 2024-04-15 14:37 ` Eli Zaretskii
1 sibling, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-15 14:37 UTC (permalink / raw)
To: Andrew Burgess; +Cc: gdb-patches
> From: Andrew Burgess <aburgess@redhat.com>
> Cc: gdb-patches@sourceware.org
> Date: Mon, 15 Apr 2024 14:55:32 +0100
>
> > TEXI2POD gdb.pod
> > POD2MAN1 gdb.1
>
> That one's harder. The target information comes from make's $@
> variable, so it's easy enough to do:
>
> TEXI2POD gdb.1
> POD2MAN gdb.1
>
> which isn't exactly what you asked for.
>
> Anyway an updated patch is below. I've then included the output of
> 'make -C gdb/doc all-doc diststuff' with and without V=1 flag.
>
> Let me know if this is acceptable or not.
Yes, LGTM, thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-15 14:18 ` Simon Marchi
@ 2024-04-16 7:48 ` Andrew Burgess
2024-04-16 8:47 ` Andrew Burgess
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Burgess @ 2024-04-16 7:48 UTC (permalink / raw)
To: Simon Marchi, Eli Zaretskii; +Cc: gdb-patches
Simon Marchi <simark@simark.ca> writes:
> On 4/15/24 9:55 AM, Andrew Burgess wrote:
>> Eli Zaretskii <eliz@gnu.org> writes:
>>> So my preference would be for having the above emit something like the
>>> below instead
>>>
>>> TEXI2POD gdb.pod
>>> POD2MAN1 gdb.1
>>
>> That one's harder. The target information comes from make's $@
>> variable, so it's easy enough to do:
>>
>> TEXI2POD gdb.1
>> POD2MAN gdb.1
>>
>> which isn't exactly what you asked for.
>
> Could you split the rule in two? One rule generating gdb.pod and one
> rule generating gdb.1.
>
> I personally think the original output from Andrew's patch is fine. In
> the silent mode, all I need to know is that make is currently working on
> getting gdb.1 generated. The intermediary gdb.pod file is an
> implementation detail of the rule. If I want to see it, then I'll use
> `make V=1`.
I agree.
> But if it makes everyone happy, I don't mind if we split the rule in
> two. Smaller and simpler rules are easier to understand.
I didn't really want to split the rule as the .pod really is an
intermediate step:
$(SILENCE) touch $@
-$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
-$(ECHO_TEXI2MAN) ($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
$(SILENCE) rm -f gdb.pod
We create the .pod and then consume it, before finally deleting it.
If the rule was split then we'd end up creating the .pod in one rule
before deleting it in another, which didn't seem great. But if you're
happy with that change then I can split the rule.
Thanks,
Andrew
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-16 7:48 ` Andrew Burgess
@ 2024-04-16 8:47 ` Andrew Burgess
2024-04-16 15:01 ` Simon Marchi
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Burgess @ 2024-04-16 8:47 UTC (permalink / raw)
To: Simon Marchi, Eli Zaretskii; +Cc: gdb-patches
Andrew Burgess <aburgess@redhat.com> writes:
> Simon Marchi <simark@simark.ca> writes:
>
>> On 4/15/24 9:55 AM, Andrew Burgess wrote:
>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>> So my preference would be for having the above emit something like the
>>>> below instead
>>>>
>>>> TEXI2POD gdb.pod
>>>> POD2MAN1 gdb.1
>>>
>>> That one's harder. The target information comes from make's $@
>>> variable, so it's easy enough to do:
>>>
>>> TEXI2POD gdb.1
>>> POD2MAN gdb.1
>>>
>>> which isn't exactly what you asked for.
>>
>> Could you split the rule in two? One rule generating gdb.pod and one
>> rule generating gdb.1.
>>
>> I personally think the original output from Andrew's patch is fine. In
>> the silent mode, all I need to know is that make is currently working on
>> getting gdb.1 generated. The intermediary gdb.pod file is an
>> implementation detail of the rule. If I want to see it, then I'll use
>> `make V=1`.
>
> I agree.
>
>> But if it makes everyone happy, I don't mind if we split the rule in
>> two. Smaller and simpler rules are easier to understand.
>
> I didn't really want to split the rule as the .pod really is an
> intermediate step:
>
> $(SILENCE) touch $@
> -$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
> -$(ECHO_TEXI2MAN) ($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
> mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
> $(SILENCE) rm -f gdb.pod
>
> We create the .pod and then consume it, before finally deleting it.
>
> If the rule was split then we'd end up creating the .pod in one rule
> before deleting it in another, which didn't seem great. But if you're
> happy with that change then I can split the rule.
Below is a reworked patch which splits the man page and .pod creation.
Let me know what you think.
Thanks,
Andrew
---
commit 1b0c9eb959212f175092da0e200811ba47f2000f
Author: Andrew Burgess <aburgess@redhat.com>
Date: Fri Apr 12 17:47:20 2024 +0100
gdb/doc: use silent-rules.mk in the Makefile
Make use of silent-rules.mk when building the GDB docs.
During review it was requested that there be more specific rules than
just reusing the general 'GEN' rule everywhere in the doc/ directory,
so I've added:
ECHO_DVIPS = @echo " DVIPS $@";
ECHO_TEX = @echo " TEX $@";
ECHO_PDFTEX = @echo " PDFTEX $@";
ECHO_TEXI2DVI = @echo " TEXI2DVI $@";
ECHO_MAKEHTML = @echo " MAKEHTML $@";
ECHO_TEXI2POD = @echo " TEXI2POD $@";
ECHO_TEXI2MAN = @echo " TEXI2MAN $@";
ECHO_MAKEINFO = @echo " MAKEINFO $@";
Then I've made use of these new silent rules and added lots of uses of
SILENT to reduce additional clutter.
As the man page generation is done in two phases, first the creation
of a .pod file, then the creation of the final man page file, I've
restructured the man page rules. Previously we had one rule for each
of the 5 man pages. I now have one general rule that will generate
all of the 5 .pod files, then I have two rules that convert the .pod
files into the final man pages.
I needed two rules for the man page generation as some man pages match
%.1 and some match %.5. I could combine these by using the GNU Make
.SECONDARYEXPANSION extension, but I'm not sure if we are OK to depend
on GNU only Make features, and having the two separate rules seems
clear enough.
I've also added a new SILENT_QUIET_FLAG to silent-rules.mk, this is
like SILENT_FLAG, but is set to '-q' when in silent mode, this can be
used with the 'dvips' and 'texi2dvi' commands, both of which use '-q'
to mean: only report errors.
As with the rest of the GDB makefiles, I've only converted the
"generation" rules to use silent-rules.mk, the install / uninstall
rules are left unchanged.
There are still a few "generation" targets that produce output, there
seems to be no flag to silence the 'tex' and 'pdftex' commands which
some recipes use, I've not worried about these for now, e.g. the
refcard.dvi and refcard.pdf targets still produce some output.
Luckily, when doing a 'make all' in the gdb/ directory, we only build
the info docs by default, and those rules are now nice and silent, so
a complete GDB build is now looking nice and quiet by default.
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 8007f6373d4..ed8f7be5227 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -33,6 +33,8 @@ man5dir = $(mandir)/man5
transform = @program_transform_name@
+include $(srcdir)/../silent-rules.mk
+
SHELL = @SHELL@
LN_S = @LN_S@
@@ -238,7 +240,7 @@ Doxyfile-gdbserver: $(srcdir)/Doxyfile-gdbserver.in
all-doc: info dvi ps pdf
diststuff: info man
- rm -f gdb-cfg.texi
+ $(SILENCE) rm -f gdb-cfg.texi
install-info: $(INFO_DEPS)
$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(infodir)
@@ -406,55 +408,56 @@ de-stage3: force
# GDB QUICK REFERENCE (dvi output)
refcard.dvi : refcard.tex $(REFEDITS)
- echo > tmp.sed
- for f in x $(REFEDITS) ; do \
+ $(SILENCE) echo > tmp.sed
+ $(SILENCE) for f in x $(REFEDITS) ; do \
test x$$f = xx && continue ; \
cat $(srcdir)/$$f >>tmp.sed ; \
done
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
- $(SET_TEXINPUTS) $(TEX) sedref.tex
- mv sedref.dvi refcard.dvi
- rm -f sedref.log sedref.tex tmp.sed
+ $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+ $(ECHO_TEX) $(SET_TEXINPUTS) $(TEX) sedref.tex
+ $(SILENCE) mv sedref.dvi refcard.dvi
+ $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
refcard.ps : refcard.dvi
- $(DVIPS) -t landscape -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_QUIET_FLAG) -t landscape -o $@ $?
refcard.pdf : refcard.tex $(REFEDITS)
- echo > tmp.sed
- for f in x $(REFEDITS) ; do \
+ $(SILENCE) echo > tmp.sed
+ $(SILENCE) for f in x $(REFEDITS) ; do \
test x$$f = xx && continue ; \
cat $(srcdir)/$$f >>tmp.sed ; \
done
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
- $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
- mv sedref.pdf refcard.pdf
- rm -f sedref.log sedref.tex tmp.sed
+ $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+ $(ECHO_PDFTEX) $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
+ $(SILENCE) mv sedref.pdf refcard.pdf
+ $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
# File to record current GDB version number.
GDBvn.texi : version.subst
- echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
- if [ -n "$(PKGVERSION)" ]; then \
+ $(ECHO_GEN)
+ $(SILENCE) echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
+ $(SILENCE) if [ -n "$(PKGVERSION)" ]; then \
echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \
fi
- echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
- if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
+ $(SILENCE) echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
+ $(SILENCE) if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
echo "@set BUGURL_DEFAULT" >> ./GDBvn.new; \
fi
- if test -z "$(READLINE_TEXI_INCFLAG)"; then \
+ $(SILENCE) if test -z "$(READLINE_TEXI_INCFLAG)"; then \
echo "@set SYSTEM_READLINE" >> ./GDBvn.new; \
fi
- if [ -n "$(SYSTEM_GDBINIT)" ]; then \
+ $(SILENCE) if [ -n "$(SYSTEM_GDBINIT)" ]; then \
escaped_system_gdbinit=`echo $(SYSTEM_GDBINIT) | sed 's/@/@@/g'`; \
echo "@set SYSTEM_GDBINIT $$escaped_system_gdbinit" >> ./GDBvn.new; \
fi
- if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
+ $(SILENCE) if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
escaped_system_gdbinit_dir=`echo $(SYSTEM_GDBINIT_DIR) | sed 's/@/@@/g'`; \
echo "@set SYSTEM_GDBINIT_DIR $$escaped_system_gdbinit_dir" >> ./GDBvn.new; \
fi
- mv GDBvn.new GDBvn.texi
+ $(SILENCE) mv GDBvn.new GDBvn.texi
version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
- date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
+ $(ECHO_GEN) date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
sed -e "s/DATE/$$date/" < $(gdbdir)/version.in > version.subst
# Updated atomically
@@ -465,7 +468,7 @@ version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
# not one for their binary config---which may not be specifically
# defined anyways).
gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
- (test "$(LN_S)" = "ln -s" && \
+ $(ECHO_GEN) (test "$(LN_S)" = "ln -s" && \
ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
@@ -487,29 +490,30 @@ GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
# GDB MANUAL: TeX dvi file
gdb.dvi: ${GDB_DOC_FILES}
- if [ ! -f ./GDBvn.texi ]; then \
+ $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- rm -f $(GDB_TEX_TMPS)
- $(TEXI2DVI) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
- $(srcdir)/gdb.texinfo
+ $(SILENCE) rm -f $(GDB_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) $(READLINE_TEXI_INCFLAG) \
+ -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
gdb.ps: gdb.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
gdb.pdf: ${GDB_DOC_FILES}
- if [ ! -f ./GDBvn.texi ]; then \
+ $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- rm -f $(GDB_TEX_TMPS)
- $(TEXI2DVI) --pdf $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+ $(SILENCE) rm -f $(GDB_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf \
+ $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
$(srcdir)/gdb.texinfo
# GDB MANUAL: info file
gdb.info: ${GDB_DOC_FILES}
- $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
-o gdb.info $(srcdir)/gdb.texinfo
# GDB MANUAL: roff translations
@@ -527,16 +531,16 @@ gdb.info: ${GDB_DOC_FILES}
# it out for gdb manual's include files---but only if not configured
# in main sourcedir.
links2roff: $(GDB_DOC_SOURCE_INCLUDES)
- if [ ! -f gdb.texinfo ]; then \
+ $(ECHO_GEN) if [ ! -f gdb.texinfo ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \
ln $(GDB_DOC_SOURCE_INCLUDES) . || \
cp $(GDB_DOC_SOURCE_INCLUDES) . ; \
fi
- touch links2roff
+ $(SILENCE) touch links2roff
# gdb manual suitable for [gtn]roff -me
gdb.me: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -551,7 +555,7 @@ gdb.me: $(GDB_DOC_FILES) links2roff
# gdb manual suitable for [gtn]roff -ms
gdb.ms: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -568,7 +572,7 @@ gdb.ms: $(GDB_DOC_FILES) links2roff
# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
# try leaving them in
gdb.mm: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -585,18 +589,18 @@ gdb.mm: $(GDB_DOC_FILES) links2roff
# GDB MANUAL: HTML file
gdb/index.html: ${GDB_DOC_FILES}
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o gdb \
$(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
$(srcdir)/gdb.texinfo
stabs.info: $(STABS_DOC_FILES)
- $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
# STABS DOCUMENTATION: HTML file
stabs/index.html: $(STABS_DOC_FILES)
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o stabs \
-I $(srcdir) \
$(srcdir)/stabs.texinfo
@@ -609,15 +613,17 @@ STABS_TEX_TMPS = stabs.aux stabs.cp* stabs.fn* stabs.ky* \
# STABS DOCUMENTATION: TeX dvi file
stabs.dvi : $(STABS_DOC_FILES)
- rm -f $(STABS_TEX_TMPS)
- $(TEXI2DVI) -I $(srcdir) $(srcdir)/stabs.texinfo
+ $(SILENCE) rm -f $(STABS_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) -I $(srcdir) \
+ $(srcdir)/stabs.texinfo
stabs.ps: stabs.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
stabs.pdf: $(STABS_DOC_FILES)
- rm -f $(STABS_TEX_TMPS)
- $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/stabs.texinfo
+ $(SILENCE) rm -f $(STABS_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf -I $(srcdir) \
+ $(srcdir)/stabs.texinfo
# Clean these up before each run. Avoids a catch 22 with not being
# able to re-generate these files (to fix a corruption) because these
@@ -627,65 +633,47 @@ ANNOTATE_TEX_TMPS = annotate.aux annotate.cp* annotate.fn* annotate.ky* \
# ANNOTATE DOCUMENTATION: TeX dvi file
annotate.dvi : $(ANNOTATE_DOC_FILES)
- rm -f $(ANNOTATE_TEX_TMPS)
- $(TEXI2DVI) -I $(srcdir) $(srcdir)/annotate.texinfo
+ $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) -I $(srcdir) \
+ $(srcdir)/annotate.texinfo
annotate.ps: annotate.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_QUIET_FLAG) -o $@ $?
annotate.pdf: $(ANNOTATE_DOC_FILES)
- rm -f $(ANNOTATE_TEX_TMPS)
- $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/annotate.texinfo
+ $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_QUIET_FLAG) --pdf -I $(srcdir) \
+ $(srcdir)/annotate.texinfo
annotate.info: $(ANNOTATE_DOC_FILES)
- $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
annotate/index.html: $(ANNOTATE_DOC_FILES)
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_MAKEHTML) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o annotate \
-I $(srcdir) \
$(srcdir)/annotate.texinfo
# Man pages
-gdb.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
- -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdb.pod
-
-gdbserver.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbserver < $(srcdir)/gdb.texinfo > gdbserver.pod
- -($(POD2MAN1) gdbserver.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdbserver.pod
-
-gcore.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgcore < $(srcdir)/gdb.texinfo > gcore.pod
- -($(POD2MAN1) gcore.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gcore.pod
+%.pod : gdb.texinfo $(GDB_DOC_FILES)
+ $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $@
-gdb-add-index.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
- -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+$(MAN1S) : %.1 : %.pod $(GDB_DOC_FILES)
+ $(SILENCE) touch $@
+ $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdb-add-index.pod
+ $(SILENCE) rm -f $*.pod
-gdbinit.5: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
- -($(POD2MAN5) gdbinit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+$(MAN5S) : %.5 : %.pod $(GDB_DOC_FILES)
+ $(SILENCE) touch $@
+ $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdbinit.pod
+ $(SILENCE) rm -f $*.pod
force:
Makefile: Makefile.in $(host_makefile_frag) ../config.status
- cd .. && $(SHELL) ./config.status doc/Makefile
+ $(ECHO_GEN) cd .. && $(SHELL) ./config.status $(SILENT_FLAG) doc/Makefile
# The "least clean" level of cleaning. Get rid of files which are
diff --git a/gdb/silent-rules.mk b/gdb/silent-rules.mk
index 43dc2bf3aca..745720ecc80 100644
--- a/gdb/silent-rules.mk
+++ b/gdb/silent-rules.mk
@@ -17,9 +17,23 @@ ECHO_YACC = @echo " YACC $@";
ECHO_LEX = @echo " LEX $@";
ECHO_AR = @echo " AR $@";
ECHO_RANLIB = @echo " RANLIB $@";
+ECHO_DVIPS = @echo " DVIPS $@";
+ECHO_TEX = @echo " TEX $@";
+ECHO_PDFTEX = @echo " PDFTEX $@";
+ECHO_TEXI2DVI = \
+ @echo " TEXI2DVI $@";
+ECHO_MAKEHTML = \
+ @echo " MAKEHTML $@";
+ECHO_TEXI2POD = \
+ @echo " TEXI2POD $@";
+ECHO_TEXI2MAN = \
+ @echo " TEXI2MAN $@";
+ECHO_MAKEINFO = \
+ @echo " MAKEINFO $@";
SILENCE = @
# Silence libtool.
SILENT_FLAG = --silent
+SILENT_QUIET_FLAG = -q
# Used in shell snippets instead of 'echo'.
SILENT_ECHO = true
else
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-16 8:47 ` Andrew Burgess
@ 2024-04-16 15:01 ` Simon Marchi
2024-04-17 21:00 ` Andrew Burgess
0 siblings, 1 reply; 16+ messages in thread
From: Simon Marchi @ 2024-04-16 15:01 UTC (permalink / raw)
To: Andrew Burgess, Eli Zaretskii; +Cc: gdb-patches
On 2024-04-16 04:47, Andrew Burgess wrote:
> Andrew Burgess <aburgess@redhat.com> writes:
>
>> Simon Marchi <simark@simark.ca> writes:
>>
>>> On 4/15/24 9:55 AM, Andrew Burgess wrote:
>>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>>> So my preference would be for having the above emit something like the
>>>>> below instead
>>>>>
>>>>> TEXI2POD gdb.pod
>>>>> POD2MAN1 gdb.1
>>>>
>>>> That one's harder. The target information comes from make's $@
>>>> variable, so it's easy enough to do:
>>>>
>>>> TEXI2POD gdb.1
>>>> POD2MAN gdb.1
>>>>
>>>> which isn't exactly what you asked for.
>>>
>>> Could you split the rule in two? One rule generating gdb.pod and one
>>> rule generating gdb.1.
>>>
>>> I personally think the original output from Andrew's patch is fine. In
>>> the silent mode, all I need to know is that make is currently working on
>>> getting gdb.1 generated. The intermediary gdb.pod file is an
>>> implementation detail of the rule. If I want to see it, then I'll use
>>> `make V=1`.
>>
>> I agree.
>>
>>> But if it makes everyone happy, I don't mind if we split the rule in
>>> two. Smaller and simpler rules are easier to understand.
>>
>> I didn't really want to split the rule as the .pod really is an
>> intermediate step:
>>
>> $(SILENCE) touch $@
>> -$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
>> -$(ECHO_TEXI2MAN) ($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
>> mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
>> $(SILENCE) rm -f gdb.pod
>>
>> We create the .pod and then consume it, before finally deleting it.
>>
>> If the rule was split then we'd end up creating the .pod in one rule
>> before deleting it in another, which didn't seem great. But if you're
>> happy with that change then I can split the rule.
We could maybe just not remove the intermediary pod files (but remove
them in the clean target, of course)? They probably don't take that
much space in the build.
I think your version with the split rules is fine, it fits well the
make model.
>
> Below is a reworked patch which splits the man page and .pod creation.
>
> Let me know what you think.
>
> Thanks,
> Andrew
>
> ---
>
> commit 1b0c9eb959212f175092da0e200811ba47f2000f
> Author: Andrew Burgess <aburgess@redhat.com>
> Date: Fri Apr 12 17:47:20 2024 +0100
>
> gdb/doc: use silent-rules.mk in the Makefile
>
> Make use of silent-rules.mk when building the GDB docs.
>
> During review it was requested that there be more specific rules than
> just reusing the general 'GEN' rule everywhere in the doc/ directory,
> so I've added:
>
> ECHO_DVIPS = @echo " DVIPS $@";
> ECHO_TEX = @echo " TEX $@";
> ECHO_PDFTEX = @echo " PDFTEX $@";
> ECHO_TEXI2DVI = @echo " TEXI2DVI $@";
> ECHO_MAKEHTML = @echo " MAKEHTML $@";
> ECHO_TEXI2POD = @echo " TEXI2POD $@";
> ECHO_TEXI2MAN = @echo " TEXI2MAN $@";
> ECHO_MAKEINFO = @echo " MAKEINFO $@";
>
> Then I've made use of these new silent rules and added lots of uses of
> SILENT to reduce additional clutter.
>
> As the man page generation is done in two phases, first the creation
> of a .pod file, then the creation of the final man page file, I've
> restructured the man page rules. Previously we had one rule for each
> of the 5 man pages. I now have one general rule that will generate
> all of the 5 .pod files, then I have two rules that convert the .pod
> files into the final man pages.
>
> I needed two rules for the man page generation as some man pages match
> %.1 and some match %.5. I could combine these by using the GNU Make
> .SECONDARYEXPANSION extension, but I'm not sure if we are OK to depend
> on GNU only Make features, and having the two separate rules seems
> clear enough.
We do require GNU make already:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Requirements.html#Requirements
But I have to admit that a using things like .SECONDARYEXPANSION is
above my make skill level :).
>
> I've also added a new SILENT_QUIET_FLAG to silent-rules.mk, this is
> like SILENT_FLAG, but is set to '-q' when in silent mode, this can be
> used with the 'dvips' and 'texi2dvi' commands, both of which use '-q'
> to mean: only report errors.
Maybe name this one SILENT_Q_FLAG? SILENT_QUIET_FLAG would be for
"--quiet" or "-quiet".
> As with the rest of the GDB makefiles, I've only converted the
> "generation" rules to use silent-rules.mk, the install / uninstall
> rules are left unchanged.
>
> There are still a few "generation" targets that produce output, there
> seems to be no flag to silence the 'tex' and 'pdftex' commands which
> some recipes use, I've not worried about these for now, e.g. the
> refcard.dvi and refcard.pdf targets still produce some output.
Not a big deal IMO. If we really want to, we could pipe stdout to
/dev/null I suppose.
> Luckily, when doing a 'make all' in the gdb/ directory, we only build
> the info docs by default, and those rules are now nice and silent, so
> a complete GDB build is now looking nice and quiet by default.
>
> diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
> index 8007f6373d4..ed8f7be5227 100644
> --- a/gdb/doc/Makefile.in
> +++ b/gdb/doc/Makefile.in
> @@ -33,6 +33,8 @@ man5dir = $(mandir)/man5
>
> transform = @program_transform_name@
>
> +include $(srcdir)/../silent-rules.mk
> +
> SHELL = @SHELL@
>
> LN_S = @LN_S@
> @@ -238,7 +240,7 @@ Doxyfile-gdbserver: $(srcdir)/Doxyfile-gdbserver.in
>
> all-doc: info dvi ps pdf
> diststuff: info man
> - rm -f gdb-cfg.texi
> + $(SILENCE) rm -f gdb-cfg.texi
This makes this rule completely silent, that's maybe too much? In the
clean target, we don't silence the `rm`s, so I don't think we should
here either.
> -gdb-add-index.1: $(GDB_DOC_FILES)
> - touch $@
> - -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
> - -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
> +$(MAN1S) : %.1 : %.pod $(GDB_DOC_FILES)
> + $(SILENCE) touch $@
> + $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
> mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
> - rm -f gdb-add-index.pod
> + $(SILENCE) rm -f $*.pod
So as I said above, I would just not remove the pod file.
A question about the pre-existing code: do you know why the `touch @` is
needed? It just seems dangerous to me. If make is interrupted after
the `touch` but before the next command, the destination file will exist
but be empty. A subsequent "make" will not rebuild it, saying the file
is already up-to-date (when it's not).
Simon
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-16 15:01 ` Simon Marchi
@ 2024-04-17 21:00 ` Andrew Burgess
2024-05-08 17:46 ` Andrew Burgess
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Burgess @ 2024-04-17 21:00 UTC (permalink / raw)
To: Simon Marchi, Eli Zaretskii; +Cc: gdb-patches
Simon Marchi <simark@simark.ca> writes:
> On 2024-04-16 04:47, Andrew Burgess wrote:
>> Andrew Burgess <aburgess@redhat.com> writes:
>>
>>> Simon Marchi <simark@simark.ca> writes:
>>>
>>>> On 4/15/24 9:55 AM, Andrew Burgess wrote:
>>>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>>>> So my preference would be for having the above emit something like the
>>>>>> below instead
>>>>>>
>>>>>> TEXI2POD gdb.pod
>>>>>> POD2MAN1 gdb.1
>>>>>
>>>>> That one's harder. The target information comes from make's $@
>>>>> variable, so it's easy enough to do:
>>>>>
>>>>> TEXI2POD gdb.1
>>>>> POD2MAN gdb.1
>>>>>
>>>>> which isn't exactly what you asked for.
>>>>
>>>> Could you split the rule in two? One rule generating gdb.pod and one
>>>> rule generating gdb.1.
>>>>
>>>> I personally think the original output from Andrew's patch is fine. In
>>>> the silent mode, all I need to know is that make is currently working on
>>>> getting gdb.1 generated. The intermediary gdb.pod file is an
>>>> implementation detail of the rule. If I want to see it, then I'll use
>>>> `make V=1`.
>>>
>>> I agree.
>>>
>>>> But if it makes everyone happy, I don't mind if we split the rule in
>>>> two. Smaller and simpler rules are easier to understand.
>>>
>>> I didn't really want to split the rule as the .pod really is an
>>> intermediate step:
>>>
>>> $(SILENCE) touch $@
>>> -$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
>>> -$(ECHO_TEXI2MAN) ($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
>>> mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
>>> $(SILENCE) rm -f gdb.pod
>>>
>>> We create the .pod and then consume it, before finally deleting it.
>>>
>>> If the rule was split then we'd end up creating the .pod in one rule
>>> before deleting it in another, which didn't seem great. But if you're
>>> happy with that change then I can split the rule.
>
> We could maybe just not remove the intermediary pod files (but remove
> them in the clean target, of course)? They probably don't take that
> much space in the build.
>
> I think your version with the split rules is fine, it fits well the
> make model.
>
>>
>> Below is a reworked patch which splits the man page and .pod creation.
>>
>> Let me know what you think.
>>
>> Thanks,
>> Andrew
>>
>> ---
>>
>> commit 1b0c9eb959212f175092da0e200811ba47f2000f
>> Author: Andrew Burgess <aburgess@redhat.com>
>> Date: Fri Apr 12 17:47:20 2024 +0100
>>
>> gdb/doc: use silent-rules.mk in the Makefile
>>
>> Make use of silent-rules.mk when building the GDB docs.
>>
>> During review it was requested that there be more specific rules than
>> just reusing the general 'GEN' rule everywhere in the doc/ directory,
>> so I've added:
>>
>> ECHO_DVIPS = @echo " DVIPS $@";
>> ECHO_TEX = @echo " TEX $@";
>> ECHO_PDFTEX = @echo " PDFTEX $@";
>> ECHO_TEXI2DVI = @echo " TEXI2DVI $@";
>> ECHO_MAKEHTML = @echo " MAKEHTML $@";
>> ECHO_TEXI2POD = @echo " TEXI2POD $@";
>> ECHO_TEXI2MAN = @echo " TEXI2MAN $@";
>> ECHO_MAKEINFO = @echo " MAKEINFO $@";
>>
>> Then I've made use of these new silent rules and added lots of uses of
>> SILENT to reduce additional clutter.
>>
>> As the man page generation is done in two phases, first the creation
>> of a .pod file, then the creation of the final man page file, I've
>> restructured the man page rules. Previously we had one rule for each
>> of the 5 man pages. I now have one general rule that will generate
>> all of the 5 .pod files, then I have two rules that convert the .pod
>> files into the final man pages.
>>
>> I needed two rules for the man page generation as some man pages match
>> %.1 and some match %.5. I could combine these by using the GNU Make
>> .SECONDARYEXPANSION extension, but I'm not sure if we are OK to depend
>> on GNU only Make features, and having the two separate rules seems
>> clear enough.
>
> We do require GNU make already:
>
> https://sourceware.org/gdb/current/onlinedocs/gdb.html/Requirements.html#Requirements
>
> But I have to admit that a using things like .SECONDARYEXPANSION is
> above my make skill level :).
Good to know. I looked again at .SECONDARYEXPANSION and in the end I
figured it was probably less clear than what I've got now, so I'm not
going to use it I think.
>
>>
>> I've also added a new SILENT_QUIET_FLAG to silent-rules.mk, this is
>> like SILENT_FLAG, but is set to '-q' when in silent mode, this can be
>> used with the 'dvips' and 'texi2dvi' commands, both of which use '-q'
>> to mean: only report errors.
>
> Maybe name this one SILENT_Q_FLAG? SILENT_QUIET_FLAG would be for
> "--quiet" or "-quiet".
Done.
>
>> As with the rest of the GDB makefiles, I've only converted the
>> "generation" rules to use silent-rules.mk, the install / uninstall
>> rules are left unchanged.
>>
>> There are still a few "generation" targets that produce output, there
>> seems to be no flag to silence the 'tex' and 'pdftex' commands which
>> some recipes use, I've not worried about these for now, e.g. the
>> refcard.dvi and refcard.pdf targets still produce some output.
>
> Not a big deal IMO. If we really want to, we could pipe stdout to
> /dev/null I suppose.
I thought about this, and figured this was likely a bad idea. A well
written application should send general chat to stdout and
warnings/errors to stderr, but I don't think we should assume that's the
case. Sending stdout to /dev/null runs the risk that the build could
fail with no useful message being printed.
>
>> Luckily, when doing a 'make all' in the gdb/ directory, we only build
>> the info docs by default, and those rules are now nice and silent, so
>> a complete GDB build is now looking nice and quiet by default.
>>
>> diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
>> index 8007f6373d4..ed8f7be5227 100644
>> --- a/gdb/doc/Makefile.in
>> +++ b/gdb/doc/Makefile.in
>> @@ -33,6 +33,8 @@ man5dir = $(mandir)/man5
>>
>> transform = @program_transform_name@
>>
>> +include $(srcdir)/../silent-rules.mk
>> +
>> SHELL = @SHELL@
>>
>> LN_S = @LN_S@
>> @@ -238,7 +240,7 @@ Doxyfile-gdbserver: $(srcdir)/Doxyfile-gdbserver.in
>>
>> all-doc: info dvi ps pdf
>> diststuff: info man
>> - rm -f gdb-cfg.texi
>> + $(SILENCE) rm -f gdb-cfg.texi
I've dropped this 'rm' in the latest update. Looking at the rule to
generate gdb-cfg.texi, I'm not sure why we'd want to delete this file
here. It's already deleted as part of the 'clean' rule.
>
> This makes this rule completely silent, that's maybe too much? In the
> clean target, we don't silence the `rm`s, so I don't think we should
> here either.
>
>> -gdb-add-index.1: $(GDB_DOC_FILES)
>> - touch $@
>> - -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
>> - -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
>> +$(MAN1S) : %.1 : %.pod $(GDB_DOC_FILES)
>> + $(SILENCE) touch $@
>> + $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
>> mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
>> - rm -f gdb-add-index.pod
>> + $(SILENCE) rm -f $*.pod
>
> So as I said above, I would just not remove the pod file.
Done.
>
> A question about the pre-existing code: do you know why the `touch @` is
> needed? It just seems dangerous to me.
I agree this seems weird. I've dropped this in this new update.
So in the version below:
+ .pod file removal is now done as part of the 'mostlyclean' target,
+ the 'diststuff' target doesn't remove a temporary file any more,
that is done in the 'mostlyclean' target,
+ No longer start by touching the target file when building the man
pages.
Thoughts?
Thanks,
Andrew
---
commit 13baf7f097593b9d877036f55fb3d9c2d443ea38
Author: Andrew Burgess <aburgess@redhat.com>
Date: Fri Apr 12 17:47:20 2024 +0100
gdb/doc: use silent-rules.mk in the Makefile
Make use of silent-rules.mk when building the GDB docs.
During review it was requested that there be more specific rules than
just reusing the general 'GEN' rule everywhere in the doc/ directory,
so I've added:
ECHO_DVIPS = @echo " DVIPS $@";
ECHO_TEX = @echo " TEX $@";
ECHO_PDFTEX = @echo " PDFTEX $@";
ECHO_TEXI2DVI = @echo " TEXI2DVI $@";
ECHO_MAKEHTML = @echo " MAKEHTML $@";
ECHO_TEXI2POD = @echo " TEXI2POD $@";
ECHO_TEXI2MAN = @echo " TEXI2MAN $@";
ECHO_MAKEINFO = @echo " MAKEINFO $@";
Then I've made use of these new silent rules and added lots of uses of
SILENT to reduce additional clutter.
As the man page generation is done in two phases, first the creation
of a .pod file, then the creation of the final man page file, I've
restructured the man page rules. Previously we had one rule for each
of the 5 man pages. I now have one general rule that will generate
all of the 5 .pod files, then I have two rules that convert the .pod
files into the final man pages.
I needed two rules for the man page generation as some man pages match
%.1 and some match %.5. I could combine these by using the GNU Make
.SECONDARYEXPANSION extension, but I think having two rules like this
is probably clearer, and the duplication is minimal.
Cleaning up the temporary .pod files is now moved into the
'mostlyclean' target rather than being done as soon as the man page is
created.
I've added a new SILENT_Q_FLAG to silent-rules.mk, this is like
SILENT_FLAG, but is set to '-q' when in silent mode, this can be used
with the 'dvips' and 'texi2dvi' commands, both of which use '-q' to
mean: only report errors.
As with the rest of the GDB makefiles, I've only converted the
"generation" rules to use silent-rules.mk, the install / uninstall
rules are left unchanged.
When looking at the 'diststuff' target, which generates the info and
man pages, I noticed the recipe for this rule just deleted a temporary
file. As that temporary file is already cleaned up as part of the
'clean' rule I've removed the deletion from the 'diststuff' target.
There are still a few "generation" targets that produce output, there
seems to be no flag to silence the 'tex' and 'pdftex' commands which
some recipes use, I've not worried about these for now, e.g. the
refcard.dvi and refcard.pdf targets still produce some output.
Luckily, when doing a 'make all' in the gdb/ directory, we only build
the info docs by default, and those rules are now nice and silent, so
a complete GDB build is now looking nice and quiet by default.
While working on this patch I noticed that 'make -j all-doc' doesn't
work (reliably), this is a preexisting bug in the way that dvi/pdf
targets are generated. For example gdb.dvi and gdb.pdf both use the
texi2dvi tool, which relies on temporary files to hold state. If both
these rules run in parallel then one (or both) of the recipes will
fail.
Luckily, the default docs target (all), which is what gets run when we
do 'make all' in the gdb/ directory, doesn't build the dvi and pdf
targets, so we're OK in that case.
I've not tried to fix this problem in this commit as it already
existed, and I don't want to do too much in one commit. I mention it
only because I ran into this issue while testing this commit.
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 8007f6373d4..28d829fdfee 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -33,6 +33,8 @@ man5dir = $(mandir)/man5
transform = @program_transform_name@
+include $(srcdir)/../silent-rules.mk
+
SHELL = @SHELL@
LN_S = @LN_S@
@@ -186,6 +188,11 @@ MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
MAN5S = gdbinit.5
MANS = $(MAN1S) $(MAN5S)
+# The pod files that are generated as a side effect of creating the
+# man pages.
+POD_FILE_TMPS = $(patsubst %.1,%.pod,$MAN1S) \
+ $(patsubst %.5,%.pod,$MAN1S)
+
HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
@@ -238,7 +245,6 @@ Doxyfile-gdbserver: $(srcdir)/Doxyfile-gdbserver.in
all-doc: info dvi ps pdf
diststuff: info man
- rm -f gdb-cfg.texi
install-info: $(INFO_DEPS)
$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(infodir)
@@ -406,55 +412,56 @@ de-stage3: force
# GDB QUICK REFERENCE (dvi output)
refcard.dvi : refcard.tex $(REFEDITS)
- echo > tmp.sed
- for f in x $(REFEDITS) ; do \
+ $(SILENCE) echo > tmp.sed
+ $(SILENCE) for f in x $(REFEDITS) ; do \
test x$$f = xx && continue ; \
cat $(srcdir)/$$f >>tmp.sed ; \
done
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
- $(SET_TEXINPUTS) $(TEX) sedref.tex
- mv sedref.dvi refcard.dvi
- rm -f sedref.log sedref.tex tmp.sed
+ $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+ $(ECHO_TEX) $(SET_TEXINPUTS) $(TEX) sedref.tex
+ $(SILENCE) mv sedref.dvi refcard.dvi
+ $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
refcard.ps : refcard.dvi
- $(DVIPS) -t landscape -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_Q_FLAG) -t landscape -o $@ $?
refcard.pdf : refcard.tex $(REFEDITS)
- echo > tmp.sed
- for f in x $(REFEDITS) ; do \
+ $(SILENCE) echo > tmp.sed
+ $(SILENCE) for f in x $(REFEDITS) ; do \
test x$$f = xx && continue ; \
cat $(srcdir)/$$f >>tmp.sed ; \
done
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
- $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
- mv sedref.pdf refcard.pdf
- rm -f sedref.log sedref.tex tmp.sed
+ $(SILENCE) sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+ $(ECHO_PDFTEX) $(SET_TEXINPUTS) $(PDFTEX) sedref.tex
+ $(SILENCE) mv sedref.pdf refcard.pdf
+ $(SILENCE) rm -f sedref.log sedref.tex tmp.sed
# File to record current GDB version number.
GDBvn.texi : version.subst
- echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
- if [ -n "$(PKGVERSION)" ]; then \
+ $(ECHO_GEN)
+ $(SILENCE) echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new
+ $(SILENCE) if [ -n "$(PKGVERSION)" ]; then \
echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \
fi
- echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
- if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
+ $(SILENCE) echo "@set BUGURL $(BUGURL_TEXI)" >> ./GDBvn.new
+ $(SILENCE) if [ "$(BUGURL_TEXI)" = "@uref{http://www.gnu.org/software/gdb/bugs/}" ]; then \
echo "@set BUGURL_DEFAULT" >> ./GDBvn.new; \
fi
- if test -z "$(READLINE_TEXI_INCFLAG)"; then \
+ $(SILENCE) if test -z "$(READLINE_TEXI_INCFLAG)"; then \
echo "@set SYSTEM_READLINE" >> ./GDBvn.new; \
fi
- if [ -n "$(SYSTEM_GDBINIT)" ]; then \
+ $(SILENCE) if [ -n "$(SYSTEM_GDBINIT)" ]; then \
escaped_system_gdbinit=`echo $(SYSTEM_GDBINIT) | sed 's/@/@@/g'`; \
echo "@set SYSTEM_GDBINIT $$escaped_system_gdbinit" >> ./GDBvn.new; \
fi
- if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
+ $(SILENCE) if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
escaped_system_gdbinit_dir=`echo $(SYSTEM_GDBINIT_DIR) | sed 's/@/@@/g'`; \
echo "@set SYSTEM_GDBINIT_DIR $$escaped_system_gdbinit_dir" >> ./GDBvn.new; \
fi
- mv GDBvn.new GDBvn.texi
+ $(SILENCE) mv GDBvn.new GDBvn.texi
version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
- date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
+ $(ECHO_GEN) date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $(gdbdir)/../bfd/version.h`; \
sed -e "s/DATE/$$date/" < $(gdbdir)/version.in > version.subst
# Updated atomically
@@ -465,7 +472,7 @@ version.subst: $(gdbdir)/version.in $(gdbdir)/../bfd/version.h
# not one for their binary config---which may not be specifically
# defined anyways).
gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
- (test "$(LN_S)" = "ln -s" && \
+ $(ECHO_GEN) (test "$(LN_S)" = "ln -s" && \
ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
@@ -487,29 +494,30 @@ GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
# GDB MANUAL: TeX dvi file
gdb.dvi: ${GDB_DOC_FILES}
- if [ ! -f ./GDBvn.texi ]; then \
+ $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- rm -f $(GDB_TEX_TMPS)
- $(TEXI2DVI) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
- $(srcdir)/gdb.texinfo
+ $(SILENCE) rm -f $(GDB_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) $(READLINE_TEXI_INCFLAG) \
+ -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
gdb.ps: gdb.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_Q_FLAG) -o $@ $?
gdb.pdf: ${GDB_DOC_FILES}
- if [ ! -f ./GDBvn.texi ]; then \
+ $(SILENCE) if [ ! -f ./GDBvn.texi ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- rm -f $(GDB_TEX_TMPS)
- $(TEXI2DVI) --pdf $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+ $(SILENCE) rm -f $(GDB_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) --pdf \
+ $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
$(srcdir)/gdb.texinfo
# GDB MANUAL: info file
gdb.info: ${GDB_DOC_FILES}
- $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
-o gdb.info $(srcdir)/gdb.texinfo
# GDB MANUAL: roff translations
@@ -527,16 +535,16 @@ gdb.info: ${GDB_DOC_FILES}
# it out for gdb manual's include files---but only if not configured
# in main sourcedir.
links2roff: $(GDB_DOC_SOURCE_INCLUDES)
- if [ ! -f gdb.texinfo ]; then \
+ $(ECHO_GEN) if [ ! -f gdb.texinfo ]; then \
(test "$(LN_S)" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \
ln $(GDB_DOC_SOURCE_INCLUDES) . || \
cp $(GDB_DOC_SOURCE_INCLUDES) . ; \
fi
- touch links2roff
+ $(SILENCE) touch links2roff
# gdb manual suitable for [gtn]roff -me
gdb.me: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -551,7 +559,7 @@ gdb.me: $(GDB_DOC_FILES) links2roff
# gdb manual suitable for [gtn]roff -ms
gdb.ms: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -568,7 +576,7 @@ gdb.ms: $(GDB_DOC_FILES) links2roff
# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
# try leaving them in
gdb.mm: $(GDB_DOC_FILES) links2roff
- sed -e '/\\input texinfo/d' \
+ $(ECHO_GEN) sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
-e '/^@c /d' \
@@ -585,18 +593,18 @@ gdb.mm: $(GDB_DOC_FILES) links2roff
# GDB MANUAL: HTML file
gdb/index.html: ${GDB_DOC_FILES}
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o gdb \
$(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
$(srcdir)/gdb.texinfo
stabs.info: $(STABS_DOC_FILES)
- $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
# STABS DOCUMENTATION: HTML file
stabs/index.html: $(STABS_DOC_FILES)
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_GEN) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o stabs \
-I $(srcdir) \
$(srcdir)/stabs.texinfo
@@ -609,15 +617,17 @@ STABS_TEX_TMPS = stabs.aux stabs.cp* stabs.fn* stabs.ky* \
# STABS DOCUMENTATION: TeX dvi file
stabs.dvi : $(STABS_DOC_FILES)
- rm -f $(STABS_TEX_TMPS)
- $(TEXI2DVI) -I $(srcdir) $(srcdir)/stabs.texinfo
+ $(SILENCE) rm -f $(STABS_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) -I $(srcdir) \
+ $(srcdir)/stabs.texinfo
stabs.ps: stabs.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_Q_FLAG) -o $@ $?
stabs.pdf: $(STABS_DOC_FILES)
- rm -f $(STABS_TEX_TMPS)
- $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/stabs.texinfo
+ $(SILENCE) rm -f $(STABS_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) --pdf -I $(srcdir) \
+ $(srcdir)/stabs.texinfo
# Clean these up before each run. Avoids a catch 22 with not being
# able to re-generate these files (to fix a corruption) because these
@@ -627,65 +637,45 @@ ANNOTATE_TEX_TMPS = annotate.aux annotate.cp* annotate.fn* annotate.ky* \
# ANNOTATE DOCUMENTATION: TeX dvi file
annotate.dvi : $(ANNOTATE_DOC_FILES)
- rm -f $(ANNOTATE_TEX_TMPS)
- $(TEXI2DVI) -I $(srcdir) $(srcdir)/annotate.texinfo
+ $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) -I $(srcdir) \
+ $(srcdir)/annotate.texinfo
annotate.ps: annotate.dvi
- $(DVIPS) -o $@ $?
+ $(ECHO_DVIPS) $(DVIPS) $(SILENT_Q_FLAG) -o $@ $?
annotate.pdf: $(ANNOTATE_DOC_FILES)
- rm -f $(ANNOTATE_TEX_TMPS)
- $(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/annotate.texinfo
+ $(SILENCE) rm -f $(ANNOTATE_TEX_TMPS)
+ $(ECHO_TEXI2DVI) $(TEXI2DVI) $(SILENT_Q_FLAG) --pdf -I $(srcdir) \
+ $(srcdir)/annotate.texinfo
annotate.info: $(ANNOTATE_DOC_FILES)
- $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
+ $(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
annotate/index.html: $(ANNOTATE_DOC_FILES)
- $(MAKEHTML) $(MAKEHTMLFLAGS) \
+ $(ECHO_MAKEHTML) $(MAKEHTML) $(MAKEHTMLFLAGS) \
-o annotate \
-I $(srcdir) \
$(srcdir)/annotate.texinfo
# Man pages
-gdb.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdb < $(srcdir)/gdb.texinfo > gdb.pod
- -($(POD2MAN1) gdb.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdb.pod
-
-gdbserver.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbserver < $(srcdir)/gdb.texinfo > gdbserver.pod
- -($(POD2MAN1) gdbserver.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdbserver.pod
-
-gcore.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgcore < $(srcdir)/gdb.texinfo > gcore.pod
- -($(POD2MAN1) gcore.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gcore.pod
+%.pod : gdb.texinfo $(GDB_DOC_FILES)
+ $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $@
-gdb-add-index.1: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
- -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+$(MAN1S) : %.1 : %.pod $(GDB_DOC_FILES)
+ $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdb-add-index.pod
+ $(SILENCE) rm -f $*.pod
-gdbinit.5: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
- -($(POD2MAN5) gdbinit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+$(MAN5S) : %.5 : %.pod $(GDB_DOC_FILES)
+ $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gdbinit.pod
+ $(SILENCE) rm -f $*.pod
force:
Makefile: Makefile.in $(host_makefile_frag) ../config.status
- cd .. && $(SHELL) ./config.status doc/Makefile
+ $(ECHO_GEN) cd .. && $(SHELL) ./config.status $(SILENT_FLAG) doc/Makefile
# The "least clean" level of cleaning. Get rid of files which are
@@ -696,7 +686,8 @@ mostlyclean:
rm -f $(GDB_TEX_TMPS)
rm -f $(STABS_TEX_TMPS)
rm -f $(ANNOTATE_TEX_TMPS)
- rm -f sedref.dvi sedref.tex tmp.sed
+ rm -f sedref.dvi sedref.tex tmp.sed sedref.log
+ rm -f $(POD_FILE_TMPS)
clean: mostlyclean
rm -f gdb-cfg.texi
diff --git a/gdb/silent-rules.mk b/gdb/silent-rules.mk
index 43dc2bf3aca..d0983a514ff 100644
--- a/gdb/silent-rules.mk
+++ b/gdb/silent-rules.mk
@@ -17,9 +17,23 @@ ECHO_YACC = @echo " YACC $@";
ECHO_LEX = @echo " LEX $@";
ECHO_AR = @echo " AR $@";
ECHO_RANLIB = @echo " RANLIB $@";
+ECHO_DVIPS = @echo " DVIPS $@";
+ECHO_TEX = @echo " TEX $@";
+ECHO_PDFTEX = @echo " PDFTEX $@";
+ECHO_TEXI2DVI = \
+ @echo " TEXI2DVI $@";
+ECHO_MAKEHTML = \
+ @echo " MAKEHTML $@";
+ECHO_TEXI2POD = \
+ @echo " TEXI2POD $@";
+ECHO_TEXI2MAN = \
+ @echo " TEXI2MAN $@";
+ECHO_MAKEINFO = \
+ @echo " MAKEINFO $@";
SILENCE = @
# Silence libtool.
SILENT_FLAG = --silent
+SILENT_Q_FLAG = -q
# Used in shell snippets instead of 'echo'.
SILENT_ECHO = true
else
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-04-17 21:00 ` Andrew Burgess
@ 2024-05-08 17:46 ` Andrew Burgess
2024-05-26 18:20 ` Joel Brobecker
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Burgess @ 2024-05-08 17:46 UTC (permalink / raw)
To: Simon Marchi, Eli Zaretskii; +Cc: gdb-patches
Andrew Burgess <aburgess@redhat.com> writes:
> commit 13baf7f097593b9d877036f55fb3d9c2d443ea38
> Author: Andrew Burgess <aburgess@redhat.com>
> Date: Fri Apr 12 17:47:20 2024 +0100
>
> gdb/doc: use silent-rules.mk in the Makefile
I've gone ahead and pushed this patch. Eli approved an earlier version,
and I believe I addressed all the issues Simon raised.
If there's any post-commit comments I'm happy to address them.
Thanks,
Andrew
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-05-08 17:46 ` Andrew Burgess
@ 2024-05-26 18:20 ` Joel Brobecker
2024-05-26 22:02 ` Andrew Burgess
0 siblings, 1 reply; 16+ messages in thread
From: Joel Brobecker @ 2024-05-26 18:20 UTC (permalink / raw)
To: Andrew Burgess; +Cc: Simon Marchi, Eli Zaretskii, gdb-patches, Joel Brobecker
Hi Andrew,
> > commit 13baf7f097593b9d877036f55fb3d9c2d443ea38
> > Author: Andrew Burgess <aburgess@redhat.com>
> > Date: Fri Apr 12 17:47:20 2024 +0100
> >
> > gdb/doc: use silent-rules.mk in the Makefile
I think this patch unfortunately broke the install phase of the doc
when building from a source package. To reproduce, first create
a tarball file by executing the following command from the root
of the binutils-gdb repository:
$ ./src-release.sh gdb
This will create a .tar file at the root of the repository
(and it creates a lot of other files, so you want to do this in
a copy of your repository, if you don't want to have to deal
with the pollution)
Then, from a separate directory, first unpack the tarball sources.
And then, create a local build directory, and from that directory,
configure and build GDB - I did:
$ CFLAGS='-g' CXXFLAGS='-g' ../gdb-15.0.50.20240508/configure --prefix=/[...]/ins
$ make -j8
Once you've done that, try...
$ make install
... and you should see the error I'm getting:
| [...]
| TEXI2POD gdb.pod
| cannot find GDBvn.texi at ../../../gdb-15.0.50.20240508/gdb/doc/../../etc/texi2pod.pl line 251, <GEN0> line 16.
| make[5]: *** [Makefile:663: gdb.pod] Error 2
I don't know what the root of the problem is, but I think one thing
that is happening now that should not be happening is the fact that
(I think) it is trying to re-generate the gdb.1 man page, whereas
gdb.1 is already present in the sources. With the gdb-14.2 release,
from what I've seen, the install simply consists in copying gdb.1
from source dir to install dir.
Do you think you could take a look? And once we have a fix, could you
backport it to the gdb-15-branch? I think we'll want the fix in that
branch before we create the first pre-release.
Thank you!
--
Joel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-05-26 18:20 ` Joel Brobecker
@ 2024-05-26 22:02 ` Andrew Burgess
2024-05-26 22:58 ` Andrew Burgess
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Burgess @ 2024-05-26 22:02 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Simon Marchi, Eli Zaretskii, gdb-patches, Joel Brobecker
Joel Brobecker <brobecker@adacore.com> writes:
> Hi Andrew,
>
>> > commit 13baf7f097593b9d877036f55fb3d9c2d443ea38
>> > Author: Andrew Burgess <aburgess@redhat.com>
>> > Date: Fri Apr 12 17:47:20 2024 +0100
>> >
>> > gdb/doc: use silent-rules.mk in the Makefile
>
> I think this patch unfortunately broke the install phase of the doc
> when building from a source package. To reproduce, first create
> a tarball file by executing the following command from the root
> of the binutils-gdb repository:
>
> $ ./src-release.sh gdb
>
> This will create a .tar file at the root of the repository
> (and it creates a lot of other files, so you want to do this in
> a copy of your repository, if you don't want to have to deal
> with the pollution)
>
> Then, from a separate directory, first unpack the tarball sources.
> And then, create a local build directory, and from that directory,
> configure and build GDB - I did:
>
> $ CFLAGS='-g' CXXFLAGS='-g' ../gdb-15.0.50.20240508/configure --prefix=/[...]/ins
> $ make -j8
>
> Once you've done that, try...
>
> $ make install
>
> ... and you should see the error I'm getting:
>
> | [...]
> | TEXI2POD gdb.pod
> | cannot find GDBvn.texi at ../../../gdb-15.0.50.20240508/gdb/doc/../../etc/texi2pod.pl line 251, <GEN0> line 16.
> | make[5]: *** [Makefile:663: gdb.pod] Error 2
>
> I don't know what the root of the problem is, but I think one thing
> that is happening now that should not be happening is the fact that
> (I think) it is trying to re-generate the gdb.1 man page, whereas
> gdb.1 is already present in the sources. With the gdb-14.2 release,
> from what I've seen, the install simply consists in copying gdb.1
> from source dir to install dir.
>
> Do you think you could take a look? And once we have a fix, could you
> backport it to the gdb-15-branch? I think we'll want the fix in that
> branch before we create the first pre-release.
I'm investigating this now.
Thanks,
Andrew
>
> Thank you!
> --
> Joel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-05-26 22:02 ` Andrew Burgess
@ 2024-05-26 22:58 ` Andrew Burgess
2024-05-28 15:25 ` Tom Tromey
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Burgess @ 2024-05-26 22:58 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Simon Marchi, Eli Zaretskii, gdb-patches, Joel Brobecker
First, massive apologies for blocking the release!
I think the patch below should fix this issue. I've tried to explain
myself in the commit message, so I'll not repeat it again here.
I'm not actually at work for the next couple of days. I'll try to check
for feedback on this each evening so I can respond to feedback and/or
merge this, but apologies if I'm a little slow in replying.
If the feedback is positive and someone wants to merge this, feel free.
Anyway, let me know what you think.
Thanks,
Andrew
---
commit bd4ee411ce843be8c32c660b1d1f56ff7f275286
Author: Andrew Burgess <aburgess@redhat.com>
Date: Sun May 26 23:30:37 2024 +0100
gdb/doc: don't have .pod targets separate to man page targets
While preparing the new release it was discovered that commit:
commit 824083f34c222aa7419e2ea58e82d6f230d5f531
Date: Fri Apr 12 17:47:20 2024 +0100
gdb/doc: use silent-rules.mk in the Makefile
was causing problems. Given a release tar file, an attempt to build
and install GDB would give an error like this:
[...]
TEXI2POD gdb.pod
cannot find GDBvn.texi at ../../../gdb-15.0.50.20240508/gdb/doc/../../etc/texi2pod.pl line 251, <GEN0> line 16.
make[5]: *** [Makefile:663: gdb.pod] Error 2
The problem here is how the man pages are built, and how they are
distributed within a release.
Within the development (git) tree, the man page files are not part of
the source tree, these files are built as needed. Within a release
tar file though, the man pages are included. The idea being that a
user can build and install GDB, including getting the man pages,
without having to install the tools needed to generate the man pages.
The man pages are generated in a two step process. First the .texi
file is processed with texi2pod to create a .pod file, then this .pod
file is processed to create the .1 or .5 man file.
Prior to the above commit these two steps were combined into a single
recipe, this meant that when a user performed a build/install from a
release tree all of the dependencies, as well as the final result,
were all present in the source tree, and so nothing needed to be
rebuilt.
However, the above commit split the two steps apart. Now we had a
separate rule for building the .pod files, and the .1/.5 man page
files depended on the relevant .pod file.
As the .pod files are not shipped in a GDB release, this meant that
one of the dependencies of the man page files was now missing. As a
result if a user tried to install from a release tree a rebuild of the
.pod files would be attempted, and if that succeeded then building the
man pages would follow that.
Unfortunately, building the .pod files would fail as the GDBvn.texi
file, though present in the source tree, was not present in the build
tree, which is where it is needed for the .pod file generation to
work.
To fix this, I propose merging the .pod creation and the .1/.5 man
page creation back into a single recipe. Having these two steps split
is probably the "cleaner" solution, but makes it harder for us to
achieve our goal of shipping the prebuilt man page files. I've added
a comment explaining what's going on (such a comment would have
prevented this mistake having been made in the first place).
One possibly weird thing here is that I have left both an
ECHO_TEXI2POD and a ECHO_TEXI2MAN in the rule $(MAN1S) and $(MAN5S)
recipes. This is 100% not going to break anything, these just print
two different progress messages while executing the recipes, but I'm
not sure if this is considered poor style or not. Maybe we're only
supposed to have a single ECHO_* per recipe?
Anyway, even if this is poor style, I figure it really is just a style
thing. We can tweak this later as needed. Otherwise, this commit
should fix the current issue blocking the next GDB release.
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 3f3fe7b7ed9..6a112b98d0e 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -658,17 +658,30 @@ annotate/index.html: $(ANNOTATE_DOC_FILES)
-I $(srcdir) \
$(srcdir)/annotate.texinfo
-# Man pages
-%.pod : gdb.texinfo $(GDB_DOC_FILES)
- $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $@
-
-$(MAN1S) : %.1 : %.pod $(GDB_DOC_FILES)
+# Man pages. The TEXI2POD and TEXI2MAN steps are performed within a
+# single recipe to support how we distribute GDB releases. A release
+# includes the .1 and .5 man pages in the source tree, but not the
+# .pod files.
+#
+# When building and installing a release of GDB it should not be
+# necessary to rebuild the .1 or .5 man page files, nor should it be
+# necessary to rebuild the .pod files.
+#
+# If we split the .pod creation from the creation of the .1 and .5
+# pages, then the .pod files must become a dependency, this will
+# trigger an attempt to rebuild these files while building and
+# installing a release of GDB, which is something we don't want.
+$(MAN1S) : %.1 : $(GDB_DOC_FILES)
+ $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod
$(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
+ $(SILENCE) rm -f $*.pod
-$(MAN5S) : %.5 : %.pod $(GDB_DOC_FILES)
+$(MAN5S) : %.5 : $(GDB_DOC_FILES)
+ $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod
$(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
+ $(SILENCE) rm -f $*.pod
force:
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] gdb/doc: use silent-rules.mk in the Makefile
2024-05-26 22:58 ` Andrew Burgess
@ 2024-05-28 15:25 ` Tom Tromey
0 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2024-05-28 15:25 UTC (permalink / raw)
To: Andrew Burgess; +Cc: Joel Brobecker, Simon Marchi, Eli Zaretskii, gdb-patches
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
Andrew> Anyway, let me know what you think.
FWIW this looks good to me.
Approved-By: Tom Tromey <tom@tromey.com>
Andrew> One possibly weird thing here is that I have left both an
Andrew> ECHO_TEXI2POD and a ECHO_TEXI2MAN in the rule $(MAN1S) and $(MAN5S)
Andrew> recipes. This is 100% not going to break anything, these just print
Andrew> two different progress messages while executing the recipes, but I'm
Andrew> not sure if this is considered poor style or not. Maybe we're only
Andrew> supposed to have a single ECHO_* per recipe?
I don't feel strongly about this either way.
Tom
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2024-05-28 15:25 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-12 17:00 [PATCH] gdb/doc: use silent-rules.mk in the Makefile Andrew Burgess
2024-04-12 18:31 ` Eli Zaretskii
2024-04-12 22:32 ` Andrew Burgess
2024-04-13 7:02 ` Eli Zaretskii
2024-04-15 13:55 ` Andrew Burgess
2024-04-15 14:18 ` Simon Marchi
2024-04-16 7:48 ` Andrew Burgess
2024-04-16 8:47 ` Andrew Burgess
2024-04-16 15:01 ` Simon Marchi
2024-04-17 21:00 ` Andrew Burgess
2024-05-08 17:46 ` Andrew Burgess
2024-05-26 18:20 ` Joel Brobecker
2024-05-26 22:02 ` Andrew Burgess
2024-05-26 22:58 ` Andrew Burgess
2024-05-28 15:25 ` Tom Tromey
2024-04-15 14:37 ` Eli Zaretskii
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).