diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-06-06 18:29:23 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-06-24 12:13:33 +0100 |
commit | 6c715062f4a0b2295e7c6e2af832ef03d9393028 (patch) | |
tree | d262838ef34c4d8ca41922e9b1e329449e10fdff | |
parent | c6e7d403bb23ed7b3e85160def047fdb3482cfc0 (diff) | |
download | fsf-binutils-gdb-6c715062f4a0b2295e7c6e2af832ef03d9393028.zip fsf-binutils-gdb-6c715062f4a0b2295e7c6e2af832ef03d9393028.tar.gz fsf-binutils-gdb-6c715062f4a0b2295e7c6e2af832ef03d9393028.tar.bz2 |
gdb/doc: merge rules for building .1 and .5 man pages
We have two rules, one each for building the .1 and .5 man pages. The
only actual difference is that one rule passes --section=1 and the
other passes --section=5 (see the definitions of POD2MAN1 and POD2MAN5
respectively.
I figure by using the suffix from the target of the rule we can
combine these two rules into one.
I use:
$(subst .,,$(suffix $@))
This gets the suffix from the target, either '.1' or '.5', and the
'subst' removes the '.' leaving '1' or '5'.
Now that I'm not using a static pattern rule for building the man
pages, the advice in the 'make' documentation is to not use $*, so
I've moved away from that to instead use $(basename $@), e.g. for
'gdbinit.5' this gives 'gdbinit', which is what we want.
There should be no difference in what is created after this change.
Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r-- | gdb/doc/Makefile.in | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index 1a0791d..70d65d5 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -178,10 +178,8 @@ MANCONF = -Dman TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl \ $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS) -POD2MAN1 = pod2man --center="GNU Development Tools" \ - --release="gdb-`sed q version.subst`" --section=1 -POD2MAN5 = pod2man --center="GNU Development Tools" \ - --release="gdb-`sed q version.subst`" --section=5 +POD2MAN = pod2man --center="GNU Development Tools" \ + --release="gdb-`sed q version.subst`" # List of man pages generated from gdb.texi MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1 @@ -654,17 +652,14 @@ annotate/index.html: $(ANNOTATE_DOC_FILES) # 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$$$$ && \ +$(MAN1S) $(MAN5S) : version.subst $(GDB_DOC_FILES) + $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$(basename $@) \ + < $(srcdir)/gdb.texinfo > $(basename $@).pod + $(ECHO_TEXI2MAN) ($(POD2MAN) --section=$(subst .,,$(suffix $@)) \ + $(basename $@).pod | \ + sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) - $(SILENCE) rm -f $*.pod - -$(MAN5S) : %.5 : $(GDB_DOC_FILES) - $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod - $(ECHO_TEXI2MAN) ($(POD2MAN5) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ - mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) - $(SILENCE) rm -f $*.pod + $(SILENCE) rm -f $(basename $@).pod force: |