public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* what is the point of bfd/doc/ header generation rules
@ 2021-12-02  4:57 Mike Frysinger
  2021-12-02  7:09 ` Alan Modra
  2021-12-03  5:33 ` [PATCH 1/2] bfd: move header updates up a directory Mike Frysinger
  0 siblings, 2 replies; 11+ messages in thread
From: Mike Frysinger @ 2021-12-02  4:57 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

bfd/doc/ has a few curious files that i can't seem to find docs on or any
references to.  are they just uncommon maintainer-esque rules ?  or are
they obsolete things that i can delete ?

specifically, what is the point of:
$ cd bfd/doc/
$ make libbfd.h libcoff.h bfd.h
$ md5sum libbfd.h ../libbfd.h
a25736b8ccbbdb2659690ac2dff9f4b3  libbfd.h
a25736b8ccbbdb2659690ac2dff9f4b3  ../libbfd.h
$ md5sum libcoff.h ../libcoff.h
ab7d38de3e2d817fbef5e3686191f5f9  libcoff.h
ab7d38de3e2d817fbef5e3686191f5f9  ../libcoff.h
$ md5sum bfd.h ../bfd-in2.h
c2fc85e26895027d1c52b1fb5fe8378b  bfd.h
c2fc85e26895027d1c52b1fb5fe8378b  ../bfd-in2.h
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: what is the point of bfd/doc/ header generation rules
  2021-12-02  4:57 what is the point of bfd/doc/ header generation rules Mike Frysinger
@ 2021-12-02  7:09 ` Alan Modra
  2021-12-02 16:44   ` Mike Frysinger
  2021-12-03  5:33 ` [PATCH 1/2] bfd: move header updates up a directory Mike Frysinger
  1 sibling, 1 reply; 11+ messages in thread
From: Alan Modra @ 2021-12-02  7:09 UTC (permalink / raw)
  To: binutils

On Wed, Dec 01, 2021 at 11:57:10PM -0500, Mike Frysinger wrote:
> bfd/doc/ has a few curious files that i can't seem to find docs on or any
> references to.  are they just uncommon maintainer-esque rules ?  or are
> they obsolete things that i can delete ?
> 
> specifically, what is the point of:
> $ cd bfd/doc/
> $ make libbfd.h libcoff.h bfd.h

See the headers rule in bfd/Makefile.am.  The above files are made in
bfd/doc when regenerating bfd/libbfd.h, bfd/libcoff.h, and
bfd/bfd-in2.h.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: what is the point of bfd/doc/ header generation rules
  2021-12-02  7:09 ` Alan Modra
@ 2021-12-02 16:44   ` Mike Frysinger
  2021-12-02 21:38     ` Alan Modra
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2021-12-02 16:44 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

On 02 Dec 2021 17:39, Alan Modra via Binutils wrote:
> On Wed, Dec 01, 2021 at 11:57:10PM -0500, Mike Frysinger wrote:
> > bfd/doc/ has a few curious files that i can't seem to find docs on or any
> > references to.  are they just uncommon maintainer-esque rules ?  or are
> > they obsolete things that i can delete ?
> > 
> > specifically, what is the point of:
> > $ cd bfd/doc/
> > $ make libbfd.h libcoff.h bfd.h
> 
> See the headers rule in bfd/Makefile.am.  The above files are made in
> bfd/doc when regenerating bfd/libbfd.h, bfd/libcoff.h, and
> bfd/bfd-in2.h.

ok, but why is it in the doc/ dir to begin with ?  doesn't it make more
sense to move all of those rules/logic to the top-level Makefile.am ?
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: what is the point of bfd/doc/ header generation rules
  2021-12-02 16:44   ` Mike Frysinger
@ 2021-12-02 21:38     ` Alan Modra
  0 siblings, 0 replies; 11+ messages in thread
From: Alan Modra @ 2021-12-02 21:38 UTC (permalink / raw)
  To: binutils

On Thu, Dec 02, 2021 at 11:44:37AM -0500, Mike Frysinger wrote:
> On 02 Dec 2021 17:39, Alan Modra via Binutils wrote:
> > On Wed, Dec 01, 2021 at 11:57:10PM -0500, Mike Frysinger wrote:
> > > bfd/doc/ has a few curious files that i can't seem to find docs on or any
> > > references to.  are they just uncommon maintainer-esque rules ?  or are
> > > they obsolete things that i can delete ?
> > > 
> > > specifically, what is the point of:
> > > $ cd bfd/doc/
> > > $ make libbfd.h libcoff.h bfd.h
> > 
> > See the headers rule in bfd/Makefile.am.  The above files are made in
> > bfd/doc when regenerating bfd/libbfd.h, bfd/libcoff.h, and
> > bfd/bfd-in2.h.
> 
> ok, but why is it in the doc/ dir to begin with ?

It's ancient history.  I suppose because some of the doc files are
generated from C files, as are parts of these headers.

>  doesn't it make more
> sense to move all of those rules/logic to the top-level Makefile.am ?

If your goal is to remove doc/Makefile then yes, that would make
sense.  Otherwise I don't see much benefit.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] bfd: move header updates up a directory
  2021-12-02  4:57 what is the point of bfd/doc/ header generation rules Mike Frysinger
  2021-12-02  7:09 ` Alan Modra
@ 2021-12-03  5:33 ` Mike Frysinger
  2021-12-03  5:33   ` [PATCH 2/2] bfd: unify header generation rules Mike Frysinger
  2021-12-03 18:27   ` [PATCH 1/2] bfd: move header updates up a directory Tom Tromey
  1 sibling, 2 replies; 11+ messages in thread
From: Mike Frysinger @ 2021-12-03  5:33 UTC (permalink / raw)
  To: binutils

The rules for rebuilding the bfd headers live in the doc/ subdir
(most likely) because they rely on the chew & related tools.  But
we can collapse them into the main makefile while keeping those
in the doc subdir easily enough.  This makes the code simpler and
allows for rebuilding them in parallel.

Also add automake silent rule support while we're here.
---
 bfd/Makefile.am     | 90 +++++++++++++++++++++++++++++++------------
 bfd/Makefile.in     | 89 ++++++++++++++++++++++++++++++------------
 bfd/doc/Makefile.am | 94 ---------------------------------------------
 bfd/doc/Makefile.in | 94 ---------------------------------------------
 4 files changed, 131 insertions(+), 236 deletions(-)

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 5a667acc62fd..342ad05e5ecf 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -920,39 +920,81 @@ LIBBFD_H_FILES = libbfd-in.h libbfd.c bfdio.c bfdwin.c \
 	cache.c reloc.c archures.c linker.c
 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
 
-# Could really use a "copy-if-change"...
-headers:
-	(cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
-	cp $(bfddocdir)/bfd.h bfd-in2.h-new
-	$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-	cp $(bfddocdir)/libbfd.h libbfd.h-new
-	$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-	cp $(bfddocdir)/libcoff.h libcoff.h-new
-	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+MKDOC = doc/chew$(EXEEXT_FOR_BUILD)
+
+$(MKDOC):
+	cd $(bfddocdir) && $(MAKE) chew$(EXEEXT_FOR_BUILD)
+
+headers: stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 
 # We only rebuild the header files automatically if we have been
 # configured with --enable-maintainer-mode.
 
 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
-stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
-	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
-	cp $(bfddocdir)/bfd.h bfd-in2.h-new
-	$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-	touch stmp-bin2-h
+stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES) $(MKDOC)
+	$(AM_V_GEN)( \
+	set -e; \
+	echo "$(BFD_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
+	for file in $(BFD_H_FILES); do \
+	  file="$(srcdir)/$$file"; \
+	  case $$file in \
+	    *-in.h) cat $$file;; \
+	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
+				-e 's,$$,.  */,'; \
+		$(MKDOC) -f $(srcdir)/doc/proto.str < $$file;; \
+	  esac; \
+	done; \
+	echo "#ifdef __cplusplus"; \
+	echo "}"; \
+	echo "#endif"; \
+	echo "#endif"; \
+	) > bfd-in2.h-new
+	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
+	$(AM_V_at)touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
-stmp-lbfd-h: $(LIBBFD_H_FILES)
-	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
-	cp $(bfddocdir)/libbfd.h libbfd.h-new
-	$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-	touch stmp-lbfd-h
+stmp-lbfd-h: $(LIBBFD_H_FILES) $(MKDOC)
+	$(AM_V_GEN)( \
+	set -e; \
+	echo "$(LIBBFD_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
+	for file in $(LIBBFD_H_FILES); do \
+	  file="$(srcdir)/$$file"; \
+	  case $$file in \
+	    *-in.h) cat $$file;; \
+	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
+				-e 's,$$,.  */,'; \
+		$(MKDOC) -i -f $(srcdir)/doc/proto.str < $$file;; \
+	  esac; \
+	done; \
+	echo "#ifdef __cplusplus"; \
+	echo "}"; \
+	echo "#endif"; \
+	echo "#endif"; \
+	) > libbfd.h-new
+	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
+	$(AM_V_at)touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
-stmp-lcoff-h: $(LIBCOFF_H_FILES)
-	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
-	cp $(bfddocdir)/libcoff.h libcoff.h-new
-	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
-	touch stmp-lcoff-h
+stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC)
+	$(AM_V_GEN)( \
+	set -e; \
+	echo "$(LIBCOFF_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
+	for file in $(LIBCOFF_H_FILES); do \
+	  file="$(srcdir)/$$file"; \
+	  case $$file in \
+	    *-in.h) cat $$file;; \
+	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
+				-e 's,$$,.  */,'; \
+		$(MKDOC) -i -f $(srcdir)/doc/proto.str < $$file;; \
+	  esac; \
+	done; \
+	echo "#ifdef __cplusplus"; \
+	echo "}"; \
+	echo "#endif"; \
+	echo "#endif"; \
+	) > libcoff.h-new
+	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+	$(AM_V_at)touch stmp-lcoff-h
 
 MOSTLYCLEANFILES = ofiles stamp-ofiles
 
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 7c669c1aba59..34e98ede9a9d 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -1175,6 +1175,7 @@ LIBBFD_H_FILES = libbfd-in.h libbfd.c bfdio.c bfdwin.c \
 	cache.c reloc.c archures.c linker.c
 
 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
+MKDOC = doc/chew$(EXEEXT_FOR_BUILD)
 MOSTLYCLEANFILES = ofiles stamp-ofiles
 CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
 	stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
@@ -2044,39 +2045,79 @@ stmp-bfd-h: bfd-in3.h
 	rm -f bfd-tmp.h
 	touch stmp-bfd-h
 
-# Could really use a "copy-if-change"...
-headers:
-	(cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
-	cp $(bfddocdir)/bfd.h bfd-in2.h-new
-	$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-	cp $(bfddocdir)/libbfd.h libbfd.h-new
-	$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-	cp $(bfddocdir)/libcoff.h libcoff.h-new
-	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+$(MKDOC):
+	cd $(bfddocdir) && $(MAKE) chew$(EXEEXT_FOR_BUILD)
+
+headers: stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 
 # We only rebuild the header files automatically if we have been
 # configured with --enable-maintainer-mode.
 
 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
-stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
-	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
-	cp $(bfddocdir)/bfd.h bfd-in2.h-new
-	$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-	touch stmp-bin2-h
+stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES) $(MKDOC)
+	$(AM_V_GEN)( \
+	set -e; \
+	echo "$(BFD_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
+	for file in $(BFD_H_FILES); do \
+	  file="$(srcdir)/$$file"; \
+	  case $$file in \
+	    *-in.h) cat $$file;; \
+	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
+				-e 's,$$,.  */,'; \
+		$(MKDOC) -f $(srcdir)/doc/proto.str < $$file;; \
+	  esac; \
+	done; \
+	echo "#ifdef __cplusplus"; \
+	echo "}"; \
+	echo "#endif"; \
+	echo "#endif"; \
+	) > bfd-in2.h-new
+	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
+	$(AM_V_at)touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
-stmp-lbfd-h: $(LIBBFD_H_FILES)
-	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
-	cp $(bfddocdir)/libbfd.h libbfd.h-new
-	$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-	touch stmp-lbfd-h
+stmp-lbfd-h: $(LIBBFD_H_FILES) $(MKDOC)
+	$(AM_V_GEN)( \
+	set -e; \
+	echo "$(LIBBFD_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
+	for file in $(LIBBFD_H_FILES); do \
+	  file="$(srcdir)/$$file"; \
+	  case $$file in \
+	    *-in.h) cat $$file;; \
+	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
+				-e 's,$$,.  */,'; \
+		$(MKDOC) -i -f $(srcdir)/doc/proto.str < $$file;; \
+	  esac; \
+	done; \
+	echo "#ifdef __cplusplus"; \
+	echo "}"; \
+	echo "#endif"; \
+	echo "#endif"; \
+	) > libbfd.h-new
+	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
+	$(AM_V_at)touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
-stmp-lcoff-h: $(LIBCOFF_H_FILES)
-	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
-	cp $(bfddocdir)/libcoff.h libcoff.h-new
-	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
-	touch stmp-lcoff-h
+stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC)
+	$(AM_V_GEN)( \
+	set -e; \
+	echo "$(LIBCOFF_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
+	for file in $(LIBCOFF_H_FILES); do \
+	  file="$(srcdir)/$$file"; \
+	  case $$file in \
+	    *-in.h) cat $$file;; \
+	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
+				-e 's,$$,.  */,'; \
+		$(MKDOC) -i -f $(srcdir)/doc/proto.str < $$file;; \
+	  esac; \
+	done; \
+	echo "#ifdef __cplusplus"; \
+	echo "}"; \
+	echo "#endif"; \
+	echo "#endif"; \
+	) > libcoff.h-new
+	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+	$(AM_V_at)touch stmp-lcoff-h
 
 bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
 	@echo "creating $@"
diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am
index 67f1042b0a17..3b24d1af222a 100644
--- a/bfd/doc/Makefile.am
+++ b/bfd/doc/Makefile.am
@@ -77,8 +77,6 @@ chew.stamp: $(srcdir)/chew.c
 	  chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC); \
 	touch $@
 
-protos: libbfd.h libcoff.h bfd.h
-
 # We can't replace these rules with an implicit rule, because
 # makes without VPATH support couldn't find the .h files in `..'.
 
@@ -243,98 +241,6 @@ linker.stamp: $(srcdir)/../linker.c $(srcdir)/doc.str $(MKDOC)
 	$(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi
 	touch $@
 
-LIBBFD_H_DEP = \
-	$(srcdir)/../libbfd-in.h	\
-	$(srcdir)/../libbfd.c		\
-	$(srcdir)/../bfdio.c		\
-	$(srcdir)/../bfdwin.c		\
-	$(srcdir)/../cache.c		\
-	$(srcdir)/../reloc.c		\
-	$(srcdir)/../archures.c		\
-	$(srcdir)/../linker.c		\
-	$(srcdir)/header.sed		\
-	$(srcdir)/proto.str		\
-	$(MKDOC)
-
-libbfd.h: $(LIBBFD_H_DEP)
-	echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
-	for file in $(LIBBFD_H_DEP); do \
-	  case $$file in \
-	    *-in.h) cat $$file >> $@ ;; \
-	    */header.sed) break ;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,' >> $@ ; \
-		./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
-	  esac; \
-	done
-	echo "#ifdef __cplusplus" >> $@
-	echo "}" >> $@
-	echo "#endif" >> $@
-	echo "#endif" >> $@
-
-LIBCOFF_H_DEP = \
-	$(srcdir)/../libcoff-in.h	\
-	$(srcdir)/../coffcode.h		\
-	$(srcdir)/header.sed		\
-	$(srcdir)/proto.str		\
-	$(MKDOC)
-
-libcoff.h: $(LIBCOFF_H_DEP)
-	echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@
-	for file in $(LIBCOFF_H_DEP); do \
-	  case $$file in \
-	    *-in.h) cat $$file >> $@ ;; \
-	    */header.sed) break ;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,' >> $@ ; \
-		./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
-	  esac; \
-	done
-	echo "#ifdef __cplusplus" >> $@
-	echo "}" >> $@
-	echo "#endif" >> $@
-	echo "#endif" >> $@
-
-BFD_H_DEP = \
-	$(srcdir)/../bfd-in.h 		\
-	$(srcdir)/../init.c 		\
-	$(srcdir)/../opncls.c 		\
-	$(srcdir)/../libbfd.c 		\
-	$(srcdir)/../bfdio.c		\
-	$(srcdir)/../bfdwin.c		\
-	$(srcdir)/../section.c 		\
-	$(srcdir)/../archures.c		\
-	$(srcdir)/../reloc.c		\
-	$(srcdir)/../syms.c		\
-	$(srcdir)/../bfd.c		\
-	$(srcdir)/../archive.c		\
-	$(srcdir)/../corefile.c		\
-	$(srcdir)/../targets.c		\
-	$(srcdir)/../format.c		\
-	$(srcdir)/../linker.c		\
-	$(srcdir)/../simple.c		\
-	$(srcdir)/../compress.c		\
-	$(srcdir)/header.sed		\
-	$(srcdir)/proto.str		\
-	$(srcdir)/../version.h		\
-	$(MKDOC)
-
-bfd.h: $(BFD_H_DEP)
-	echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
-	for file in $(BFD_H_DEP); do \
-	  case $$file in \
-	    *-in.h) cat $$file >> $@ ;; \
-	    */header.sed) break ;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,' >> $@ ; \
-		./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \
-	  esac; \
-	done
-	echo "#ifdef __cplusplus" >> $@
-	echo "}" >> $@
-	echo "#endif" >> $@
-	echo "#endif" >> $@
-
 bfdver.texi: $(srcdir)/Makefile.in
 	@echo "creating $@"; \
 	echo "@set VERSION $(VERSION)" > bfdver.texi; \
diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in
index 185786cecca6..c461094c80c5 100644
--- a/bfd/doc/Makefile.in
+++ b/bfd/doc/Makefile.in
@@ -442,50 +442,6 @@ MKDOC = chew$(EXEEXT_FOR_BUILD)
 AM_CPPFLAGS = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \
 	-I$(srcdir)/../../intl -I../../intl
 
-LIBBFD_H_DEP = \
-	$(srcdir)/../libbfd-in.h	\
-	$(srcdir)/../libbfd.c		\
-	$(srcdir)/../bfdio.c		\
-	$(srcdir)/../bfdwin.c		\
-	$(srcdir)/../cache.c		\
-	$(srcdir)/../reloc.c		\
-	$(srcdir)/../archures.c		\
-	$(srcdir)/../linker.c		\
-	$(srcdir)/header.sed		\
-	$(srcdir)/proto.str		\
-	$(MKDOC)
-
-LIBCOFF_H_DEP = \
-	$(srcdir)/../libcoff-in.h	\
-	$(srcdir)/../coffcode.h		\
-	$(srcdir)/header.sed		\
-	$(srcdir)/proto.str		\
-	$(MKDOC)
-
-BFD_H_DEP = \
-	$(srcdir)/../bfd-in.h 		\
-	$(srcdir)/../init.c 		\
-	$(srcdir)/../opncls.c 		\
-	$(srcdir)/../libbfd.c 		\
-	$(srcdir)/../bfdio.c		\
-	$(srcdir)/../bfdwin.c		\
-	$(srcdir)/../section.c 		\
-	$(srcdir)/../archures.c		\
-	$(srcdir)/../reloc.c		\
-	$(srcdir)/../syms.c		\
-	$(srcdir)/../bfd.c		\
-	$(srcdir)/../archive.c		\
-	$(srcdir)/../corefile.c		\
-	$(srcdir)/../targets.c		\
-	$(srcdir)/../format.c		\
-	$(srcdir)/../linker.c		\
-	$(srcdir)/../simple.c		\
-	$(srcdir)/../compress.c		\
-	$(srcdir)/header.sed		\
-	$(srcdir)/proto.str		\
-	$(srcdir)/../version.h		\
-	$(MKDOC)
-
 noinst_TEXINFOS = bfdint.texi
 MOSTLYCLEANFILES = $(MKDOC) *.o *.stamp
 DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
@@ -929,8 +885,6 @@ chew.stamp: $(srcdir)/chew.c
 	  chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC); \
 	touch $@
 
-protos: libbfd.h libcoff.h bfd.h
-
 # We can't replace these rules with an implicit rule, because
 # makes without VPATH support couldn't find the .h files in `..'.
 
@@ -1095,54 +1049,6 @@ linker.stamp: $(srcdir)/../linker.c $(srcdir)/doc.str $(MKDOC)
 	$(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi
 	touch $@
 
-libbfd.h: $(LIBBFD_H_DEP)
-	echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
-	for file in $(LIBBFD_H_DEP); do \
-	  case $$file in \
-	    *-in.h) cat $$file >> $@ ;; \
-	    */header.sed) break ;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,' >> $@ ; \
-		./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
-	  esac; \
-	done
-	echo "#ifdef __cplusplus" >> $@
-	echo "}" >> $@
-	echo "#endif" >> $@
-	echo "#endif" >> $@
-
-libcoff.h: $(LIBCOFF_H_DEP)
-	echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@
-	for file in $(LIBCOFF_H_DEP); do \
-	  case $$file in \
-	    *-in.h) cat $$file >> $@ ;; \
-	    */header.sed) break ;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,' >> $@ ; \
-		./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
-	  esac; \
-	done
-	echo "#ifdef __cplusplus" >> $@
-	echo "}" >> $@
-	echo "#endif" >> $@
-	echo "#endif" >> $@
-
-bfd.h: $(BFD_H_DEP)
-	echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
-	for file in $(BFD_H_DEP); do \
-	  case $$file in \
-	    *-in.h) cat $$file >> $@ ;; \
-	    */header.sed) break ;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,' >> $@ ; \
-		./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \
-	  esac; \
-	done
-	echo "#ifdef __cplusplus" >> $@
-	echo "}" >> $@
-	echo "#endif" >> $@
-	echo "#endif" >> $@
-
 bfdver.texi: $(srcdir)/Makefile.in
 	@echo "creating $@"; \
 	echo "@set VERSION $(VERSION)" > bfdver.texi; \
-- 
2.33.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/2] bfd: unify header generation rules
  2021-12-03  5:33 ` [PATCH 1/2] bfd: move header updates up a directory Mike Frysinger
@ 2021-12-03  5:33   ` Mike Frysinger
  2021-12-03  5:43     ` Mike Frysinger
  2021-12-03 18:27   ` [PATCH 1/2] bfd: move header updates up a directory Tom Tromey
  1 sibling, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2021-12-03  5:33 UTC (permalink / raw)
  To: binutils

The logic between these rules are extremely similar, so unify them
into a single variable.
---
 bfd/Makefile.am | 59 ++++++++++--------------------------
 bfd/Makefile.in | 79 ++++++++++++++++---------------------------------
 2 files changed, 40 insertions(+), 98 deletions(-)

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 342ad05e5ecf..8fc967d2d970 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -930,69 +930,40 @@ headers: stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 # We only rebuild the header files automatically if we have been
 # configured with --enable-maintainer-mode.
 
-$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
-stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES) $(MKDOC)
-	$(AM_V_GEN)( \
+REGEN_HEADER = \
+	( \
 	set -e; \
-	echo "$(BFD_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
-	for file in $(BFD_H_FILES); do \
+	echo "$$H_FILES" | sed -f $(srcdir)/doc/header.sed; \
+	for file in $$H_FILES; do \
 	  file="$(srcdir)/$$file"; \
 	  case $$file in \
 	    *-in.h) cat $$file;; \
 	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
 				-e 's,$$,.  */,'; \
-		$(MKDOC) -f $(srcdir)/doc/proto.str < $$file;; \
+		$(MKDOC) $$CHEW_FLAGS -f $(srcdir)/doc/proto.str < $$file;; \
 	  esac; \
 	done; \
-	echo "#ifdef __cplusplus"; \
+	echo "\#ifdef __cplusplus"; \
 	echo "}"; \
-	echo "#endif"; \
-	echo "#endif"; \
-	) > bfd-in2.h-new
+	echo "\#endif"; \
+	echo "\#endif"; \
+	)
+
+$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
+stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES) $(MKDOC)
+	$(AM_V_GEN)H_FILES="$(BFD_H_FILES)" CHEW_FLAGS= ; $(REGEN_HEADER) > bfd-in2.h-new
 	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
 	$(AM_V_at)touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
 stmp-lbfd-h: $(LIBBFD_H_FILES) $(MKDOC)
-	$(AM_V_GEN)( \
-	set -e; \
-	echo "$(LIBBFD_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
-	for file in $(LIBBFD_H_FILES); do \
-	  file="$(srcdir)/$$file"; \
-	  case $$file in \
-	    *-in.h) cat $$file;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,'; \
-		$(MKDOC) -i -f $(srcdir)/doc/proto.str < $$file;; \
-	  esac; \
-	done; \
-	echo "#ifdef __cplusplus"; \
-	echo "}"; \
-	echo "#endif"; \
-	echo "#endif"; \
-	) > libbfd.h-new
+	$(AM_V_GEN)H_FILES="$(LIBBFD_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libbfd.h-new
 	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
 	$(AM_V_at)touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
 stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC)
-	$(AM_V_GEN)( \
-	set -e; \
-	echo "$(LIBCOFF_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
-	for file in $(LIBCOFF_H_FILES); do \
-	  file="$(srcdir)/$$file"; \
-	  case $$file in \
-	    *-in.h) cat $$file;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,'; \
-		$(MKDOC) -i -f $(srcdir)/doc/proto.str < $$file;; \
-	  esac; \
-	done; \
-	echo "#ifdef __cplusplus"; \
-	echo "}"; \
-	echo "#endif"; \
-	echo "#endif"; \
-	) > libcoff.h-new
+	$(AM_V_GEN)H_FILES="$(LIBCOFF_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libcoff.h-new
 	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 	$(AM_V_at)touch stmp-lcoff-h
 
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 34e98ede9a9d..63780305c0d1 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -1176,6 +1176,28 @@ LIBBFD_H_FILES = libbfd-in.h libbfd.c bfdio.c bfdwin.c \
 
 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
 MKDOC = doc/chew$(EXEEXT_FOR_BUILD)
+
+# We only rebuild the header files automatically if we have been
+# configured with --enable-maintainer-mode.
+REGEN_HEADER = \
+	( \
+	set -e; \
+	echo "$$H_FILES" | sed -f $(srcdir)/doc/header.sed; \
+	for file in $$H_FILES; do \
+	  file="$(srcdir)/$$file"; \
+	  case $$file in \
+	    *-in.h) cat $$file;; \
+	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
+				-e 's,$$,.  */,'; \
+		$(MKDOC) $$CHEW_FLAGS -f $(srcdir)/doc/proto.str < $$file;; \
+	  esac; \
+	done; \
+	echo "\#ifdef __cplusplus"; \
+	echo "}"; \
+	echo "\#endif"; \
+	echo "\#endif"; \
+	)
+
 MOSTLYCLEANFILES = ofiles stamp-ofiles
 CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
 	stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
@@ -2050,72 +2072,21 @@ $(MKDOC):
 
 headers: stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 
-# We only rebuild the header files automatically if we have been
-# configured with --enable-maintainer-mode.
-
 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
 stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES) $(MKDOC)
-	$(AM_V_GEN)( \
-	set -e; \
-	echo "$(BFD_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
-	for file in $(BFD_H_FILES); do \
-	  file="$(srcdir)/$$file"; \
-	  case $$file in \
-	    *-in.h) cat $$file;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,'; \
-		$(MKDOC) -f $(srcdir)/doc/proto.str < $$file;; \
-	  esac; \
-	done; \
-	echo "#ifdef __cplusplus"; \
-	echo "}"; \
-	echo "#endif"; \
-	echo "#endif"; \
-	) > bfd-in2.h-new
+	$(AM_V_GEN)H_FILES="$(BFD_H_FILES)" CHEW_FLAGS= ; $(REGEN_HEADER) > bfd-in2.h-new
 	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
 	$(AM_V_at)touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
 stmp-lbfd-h: $(LIBBFD_H_FILES) $(MKDOC)
-	$(AM_V_GEN)( \
-	set -e; \
-	echo "$(LIBBFD_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
-	for file in $(LIBBFD_H_FILES); do \
-	  file="$(srcdir)/$$file"; \
-	  case $$file in \
-	    *-in.h) cat $$file;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,'; \
-		$(MKDOC) -i -f $(srcdir)/doc/proto.str < $$file;; \
-	  esac; \
-	done; \
-	echo "#ifdef __cplusplus"; \
-	echo "}"; \
-	echo "#endif"; \
-	echo "#endif"; \
-	) > libbfd.h-new
+	$(AM_V_GEN)H_FILES="$(LIBBFD_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libbfd.h-new
 	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
 	$(AM_V_at)touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
 stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC)
-	$(AM_V_GEN)( \
-	set -e; \
-	echo "$(LIBCOFF_H_FILES)" | sed -f $(srcdir)/doc/header.sed; \
-	for file in $(LIBCOFF_H_FILES); do \
-	  file="$(srcdir)/$$file"; \
-	  case $$file in \
-	    *-in.h) cat $$file;; \
-	    *)	echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \
-				-e 's,$$,.  */,'; \
-		$(MKDOC) -i -f $(srcdir)/doc/proto.str < $$file;; \
-	  esac; \
-	done; \
-	echo "#ifdef __cplusplus"; \
-	echo "}"; \
-	echo "#endif"; \
-	echo "#endif"; \
-	) > libcoff.h-new
+	$(AM_V_GEN)H_FILES="$(LIBCOFF_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libcoff.h-new
 	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 	$(AM_V_at)touch stmp-lcoff-h
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] bfd: unify header generation rules
  2021-12-03  5:33   ` [PATCH 2/2] bfd: unify header generation rules Mike Frysinger
@ 2021-12-03  5:43     ` Mike Frysinger
  2021-12-03 23:24       ` Alan Modra
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2021-12-03  5:43 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

On 03 Dec 2021 00:33, Mike Frysinger via Binutils wrote:
> The logic between these rules are extremely similar, so unify them
> into a single variable.

i split this into a 2nd patch as i wasn't sure it was desirable.
feels a little on the fence of overkill.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] bfd: move header updates up a directory
  2021-12-03  5:33 ` [PATCH 1/2] bfd: move header updates up a directory Mike Frysinger
  2021-12-03  5:33   ` [PATCH 2/2] bfd: unify header generation rules Mike Frysinger
@ 2021-12-03 18:27   ` Tom Tromey
  2021-12-04  3:11     ` Mike Frysinger
  1 sibling, 1 reply; 11+ messages in thread
From: Tom Tromey @ 2021-12-03 18:27 UTC (permalink / raw)
  To: Mike Frysinger via Binutils

>>>>> "Mike" == Mike Frysinger via Binutils <binutils@sourceware.org> writes:

Mike> The rules for rebuilding the bfd headers live in the doc/ subdir
Mike> (most likely) because they rely on the chew & related tools.

I brought this up once before, but didn't get an answer, so I thought
I'd mention it again.

What if we got rid of chew?  The docs that it creates aren't really all
that usable, and the approach taken by it means that the canonical
definition of some types is in a comment, not normal code.

Tom

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] bfd: unify header generation rules
  2021-12-03  5:43     ` Mike Frysinger
@ 2021-12-03 23:24       ` Alan Modra
  0 siblings, 0 replies; 11+ messages in thread
From: Alan Modra @ 2021-12-03 23:24 UTC (permalink / raw)
  To: binutils

On Fri, Dec 03, 2021 at 12:43:48AM -0500, Mike Frysinger via Binutils wrote:
> On 03 Dec 2021 00:33, Mike Frysinger via Binutils wrote:
> > The logic between these rules are extremely similar, so unify them
> > into a single variable.
> 
> i split this into a 2nd patch as i wasn't sure it was desirable.
> feels a little on the fence of overkill.
> -mike

OK for both.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] bfd: move header updates up a directory
  2021-12-03 18:27   ` [PATCH 1/2] bfd: move header updates up a directory Tom Tromey
@ 2021-12-04  3:11     ` Mike Frysinger
  2021-12-04 18:21       ` Tom Tromey
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2021-12-04  3:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Mike Frysinger via Binutils

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

On 03 Dec 2021 11:27, Tom Tromey wrote:
> >>>>> "Mike" == Mike Frysinger via Binutils <binutils@sourceware.org> writes:
> 
> Mike> The rules for rebuilding the bfd headers live in the doc/ subdir
> Mike> (most likely) because they rely on the chew & related tools.
> 
> I brought this up once before, but didn't get an answer, so I thought
> I'd mention it again.
> 
> What if we got rid of chew?  The docs that it creates aren't really all
> that usable, and the approach taken by it means that the canonical
> definition of some types is in a comment, not normal code.

i don't have a vested interest in bfd, but i was looking at this with the
sim and was planning on pulling all the docs out of the source and into
the texi files directly.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] bfd: move header updates up a directory
  2021-12-04  3:11     ` Mike Frysinger
@ 2021-12-04 18:21       ` Tom Tromey
  0 siblings, 0 replies; 11+ messages in thread
From: Tom Tromey @ 2021-12-04 18:21 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Mike Frysinger via Binutils

>> What if we got rid of chew?  The docs that it creates aren't really all
>> that usable, and the approach taken by it means that the canonical
>> definition of some types is in a comment, not normal code.

Mike> i don't have a vested interest in bfd, but i was looking at this with the
Mike> sim and was planning on pulling all the docs out of the source and into
Mike> the texi files directly.

This isn't unreasonable, at least if you plan to write the docs (gdb
converted one file to doxygen and then gave up... :); but I don't think
chew really does this.  It also puts the definitions of things into
comments, which is annoying to work with.  E.g., look at bfd/section.c
for ".typedef".  This snippet is extracted from the commeent into
bfd-in2.h.

Tom

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-12-04 18:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02  4:57 what is the point of bfd/doc/ header generation rules Mike Frysinger
2021-12-02  7:09 ` Alan Modra
2021-12-02 16:44   ` Mike Frysinger
2021-12-02 21:38     ` Alan Modra
2021-12-03  5:33 ` [PATCH 1/2] bfd: move header updates up a directory Mike Frysinger
2021-12-03  5:33   ` [PATCH 2/2] bfd: unify header generation rules Mike Frysinger
2021-12-03  5:43     ` Mike Frysinger
2021-12-03 23:24       ` Alan Modra
2021-12-03 18:27   ` [PATCH 1/2] bfd: move header updates up a directory Tom Tromey
2021-12-04  3:11     ` Mike Frysinger
2021-12-04 18:21       ` Tom Tromey

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).