Change in libosmocore[master]: doxygen: enable cross referencing everywhere

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Feb 1 05:17:42 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/12774


Change subject: doxygen: enable cross referencing everywhere
......................................................................

doxygen: enable cross referencing everywhere

doxygen \ref cross-references to groups or files from other libraries only work
when the .map file was present when the HTML was generated, and when that .map
file was listed in TAGFILES in the Doxyfile.

- Makefile.am: introduce a two-pass build for doxygen API docs.
  - First build pass makes sure the .tag files are present.
  - Second build pass picks up all the references, hence generates hyperlinks
    properly.
- Add all libraries to TAGFILES of all other libraries, so we can from now on
  freely criss-cross reference from everywhere to everywhere.
- Add all libraries' tag files as dependencies for all others.

Example: in upcoming tdef.h, I would like to cross reference to tdef_vty.h, and
vice versa, even though they are in libosmocore and libosmovty, respectively.
This is now possible.

We may still need to fix some problems with naming collisions, see for example
stats.h, which exists twice with identical doxygen handle (different source
dirs seems to not suffice for doxygen).

Change-Id: Ib03d0b70d536c8f1386def666c89106a840f7363
---
M Doxyfile.codec.in
M Doxyfile.coding.in
M Doxyfile.core.in
M Doxyfile.ctrl.in
M Doxyfile.gb.in
M Doxyfile.gsm.in
M Doxyfile.vty.in
M Makefile.am
8 files changed, 129 insertions(+), 27 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/12774/1

diff --git a/Doxyfile.codec.in b/Doxyfile.codec.in
index 037ef7a..307e3e1 100644
--- a/Doxyfile.codec.in
+++ b/Doxyfile.codec.in
@@ -1485,7 +1485,7 @@
 # If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = doc/libosmocore.tag=../../core/html
+TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in
index 43c4f82..d0e9942 100644
--- a/Doxyfile.coding.in
+++ b/Doxyfile.coding.in
@@ -1485,7 +1485,7 @@
 # If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = doc/libosmocore.tag=../../core/html
+TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
diff --git a/Doxyfile.core.in b/Doxyfile.core.in
index 7a3cce5..f83205a 100644
--- a/Doxyfile.core.in
+++ b/Doxyfile.core.in
@@ -1485,7 +1485,7 @@
 # If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               =
+TAGFILES = doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
diff --git a/Doxyfile.ctrl.in b/Doxyfile.ctrl.in
index eb363bb..5612a74 100644
--- a/Doxyfile.ctrl.in
+++ b/Doxyfile.ctrl.in
@@ -1485,7 +1485,7 @@
 # If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = doc/libosmocore.tag=../../core/html
+TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmogb.tag=../../gb/html
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
diff --git a/Doxyfile.gb.in b/Doxyfile.gb.in
index e6b7826..b3b2128 100644
--- a/Doxyfile.gb.in
+++ b/Doxyfile.gb.in
@@ -1485,7 +1485,7 @@
 # If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = doc/libosmocore.tag=../../core/html
+TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in
index 27d14cc..aae0e89 100644
--- a/Doxyfile.gsm.in
+++ b/Doxyfile.gsm.in
@@ -1485,7 +1485,7 @@
 # If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = doc/libosmocore.tag=../../core/html
+TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
diff --git a/Doxyfile.vty.in b/Doxyfile.vty.in
index 0e138ee..fb1cabf 100644
--- a/Doxyfile.vty.in
+++ b/Doxyfile.vty.in
@@ -1485,7 +1485,7 @@
 # If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = doc/libosmocore.tag=../../core/html
+TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
diff --git a/Makefile.am b/Makefile.am
index de5eb35..ca01d10 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,38 +39,140 @@
 		  $(top_builddir)/doc/gb/html/index.html
 	cd $(top_builddir)/doc && tar cf html.tar */html
 
-$(top_builddir)/doc/core/html/index.html: $(SOURCES) Doxyfile.core
-	@rm -rf doc/core
-	mkdir -p doc/core
+# Support doxygen cross references from each library to each other library:
+# First generate the docs to make sure all .tag files are in place.
+# In a second run, generate the content with proper referencing.
+# For example, libosmocore references tags from libosmovty and vice versa,
+# so both need to generate tag files first, and then do another run.
+#
+# Generate each docs tree, and touch a libosmofoo.tag.prep file when done.
+# It means that a libosmofoo.tag file is up-to-date.
+# Touch a separate "*.prep" target: libosmofoo.tag as target would create
+# circular dependency: we would rebuild all every time 'make' is invoked.
+# The .prep file also depends on all the source files for that library.
+
+$(top_builddir)/doc/libosmocore.tag.prep: $(top_builddir)/Doxyfile.core
+	rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
+	rm -rf $(top_builddir)/doc/libosmocore.map
+	-$(DOXYGEN) $(top_builddir)/Doxyfile.core
+	touch "$@"
+
+$(top_builddir)/doc/libosmogsm.tag.prep: $(top_builddir)/Doxyfile.gsm
+	rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
+	rm -rf $(top_builddir)/doc/libosmogsm.map
+	-$(DOXYGEN) $(top_builddir)/Doxyfile.gsm
+	touch "$@"
+
+$(top_builddir)/doc/libosmovty.tag.prep: $(top_builddir)/Doxyfile.vty
+	rm -rf $(top_builddir)/doc/vty; mkdir -p $(top_builddir)/doc/vty
+	rm -rf $(top_builddir)/doc/libosmovty.map
+	-$(DOXYGEN) $(top_builddir)/Doxyfile.vty
+	touch "$@"
+
+$(top_builddir)/doc/libosmocodec.tag.prep: $(top_builddir)/Doxyfile.codec
+	rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
+	rm -rf $(top_builddir)/doc/libosmocodec.map
+	-$(DOXYGEN) $(top_builddir)/Doxyfile.codec
+	touch "$@"
+
+$(top_builddir)/doc/libosmocoding.tag.prep: $(top_builddir)/Doxyfile.coding
+	rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
+	rm -rf $(top_builddir)/doc/libosmocoding.map
+	-$(DOXYGEN) $(top_builddir)/Doxyfile.coding
+	touch "$@"
+
+$(top_builddir)/doc/libosmoctrl.tag.prep: $(top_builddir)/Doxyfile.ctrl
+	rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
+	rm -rf $(top_builddir)/doc/libosmoctrl.map
+	-$(DOXYGEN) $(top_builddir)/Doxyfile.ctrl
+	touch "$@"
+
+$(top_builddir)/doc/libosmogb.tag.prep: $(top_builddir)/Doxyfile.gb
+	rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
+	rm -rf $(top_builddir)/doc/libosmogb.map
+	-$(DOXYGEN) $(top_builddir)/Doxyfile.gb
+	touch "$@"
+
+# Build for real once all depending .tag files are in place.
+# Depend on the own .tag.prep file to avoid concurrent builds of the same doc
+# tree, and to also depend on all the source files listed above.
+#
+# Each library should depend on all the tag.prep files of which it lists .tag
+# files in Doxyfile under TAGFILES.
+#
+# In turn, include all .tag files in TAGFILES of libraries to which "\ref"
+# references point.
+#
+# Easiest is to just depend on all tag.prep files all across everywhere.
+
+$(top_builddir)/doc/core/html/index.html: $(top_builddir)/doc/libosmocore.tag.prep \
+		$(top_builddir)/doc/libosmogsm.tag.prep \
+		$(top_builddir)/doc/libosmovty.tag.prep \
+		$(top_builddir)/doc/libosmocodec.tag.prep \
+		$(top_builddir)/doc/libosmocoding.tag.prep \
+		$(top_builddir)/doc/libosmoctrl.tag.prep \
+		$(top_builddir)/doc/libosmogb.tag.prep
+	rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
 	$(DOXYGEN) Doxyfile.core
 
-$(top_builddir)/doc/gsm/html/index.html: $(SOURCES) Doxyfile.gsm
-	@rm -rf doc/gsm
-	mkdir -p doc/gsm
+$(top_builddir)/doc/gsm/html/index.html: $(top_builddir)/doc/libosmogsm.tag.prep \
+		$(top_builddir)/doc/libosmocore.tag.prep \
+		$(top_builddir)/doc/libosmovty.tag.prep \
+		$(top_builddir)/doc/libosmocodec.tag.prep \
+		$(top_builddir)/doc/libosmocoding.tag.prep \
+		$(top_builddir)/doc/libosmoctrl.tag.prep \
+		$(top_builddir)/doc/libosmogb.tag.prep
+	rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
 	$(DOXYGEN) Doxyfile.gsm
 
-$(top_builddir)/doc/vty/html/index.html: $(SOURCES) Doxyfile.vty
-	@rm -rf doc/vty/{html,latex}
+$(top_builddir)/doc/vty/html/index.html: $(top_builddir)/doc/libosmovty.tag.prep \
+		$(top_builddir)/doc/libosmocore.tag.prep \
+		$(top_builddir)/doc/libosmogsm.tag.prep \
+		$(top_builddir)/doc/libosmocodec.tag.prep \
+		$(top_builddir)/doc/libosmocoding.tag.prep \
+		$(top_builddir)/doc/libosmoctrl.tag.prep \
+		$(top_builddir)/doc/libosmogb.tag.prep
+	rm -rf $(top_builddir)/doc/vty; mkdir -p $(top_builddir)/doc/vty
 	$(DOXYGEN) Doxyfile.vty
 
-$(top_builddir)/doc/codec/html/index.html: $(SOURCES) Doxyfile.codec
-	@rm -rf doc/codec
-	mkdir -p doc/codec
+$(top_builddir)/doc/codec/html/index.html: $(top_builddir)/doc/libosmocodec.tag.prep \
+		$(top_builddir)/doc/libosmocore.tag.prep \
+		$(top_builddir)/doc/libosmogsm.tag.prep \
+		$(top_builddir)/doc/libosmovty.tag.prep \
+		$(top_builddir)/doc/libosmocoding.tag.prep \
+		$(top_builddir)/doc/libosmoctrl.tag.prep \
+		$(top_builddir)/doc/libosmogb.tag.prep
+	rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
 	$(DOXYGEN) Doxyfile.codec
 
-$(top_builddir)/doc/coding/html/index.html: Doxyfile.coding
-	@rm -rf doc/coding
-	mkdir -p doc/coding
+$(top_builddir)/doc/coding/html/index.html: $(top_builddir)/doc/libosmocoding.tag.prep \
+		$(top_builddir)/doc/libosmocore.tag.prep \
+		$(top_builddir)/doc/libosmogsm.tag.prep \
+		$(top_builddir)/doc/libosmovty.tag.prep \
+		$(top_builddir)/doc/libosmocodec.tag.prep \
+		$(top_builddir)/doc/libosmoctrl.tag.prep \
+		$(top_builddir)/doc/libosmogb.tag.prep
+	rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
 	$(DOXYGEN) Doxyfile.coding
 
-$(top_builddir)/doc/ctrl/html/index.html: $(SOURCES) Doxyfile.ctrl
-	@rm -rf doc/ctrl
-	mkdir -p doc/ctrl
+$(top_builddir)/doc/ctrl/html/index.html: $(top_builddir)/doc/libosmoctrl.tag.prep \
+		$(top_builddir)/doc/libosmocore.tag.prep \
+		$(top_builddir)/doc/libosmogsm.tag.prep \
+		$(top_builddir)/doc/libosmovty.tag.prep \
+		$(top_builddir)/doc/libosmocodec.tag.prep \
+		$(top_builddir)/doc/libosmocoding.tag.prep \
+		$(top_builddir)/doc/libosmogb.tag.prep
+	rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
 	$(DOXYGEN) Doxyfile.ctrl
 
-$(top_builddir)/doc/gb/html/index.html: $(SOURCES) Doxyfile.gb
-	@rm -rf doc/gb
-	mkdir -p doc/gb
+$(top_builddir)/doc/gb/html/index.html: $(top_builddir)/doc/libosmogb.tag.prep \
+		$(top_builddir)/doc/libosmocore.tag.prep \
+		$(top_builddir)/doc/libosmogsm.tag.prep \
+		$(top_builddir)/doc/libosmovty.tag.prep \
+		$(top_builddir)/doc/libosmocodec.tag.prep \
+		$(top_builddir)/doc/libosmocoding.tag.prep \
+		$(top_builddir)/doc/libosmoctrl.tag.prep
+	rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
 	$(DOXYGEN) Doxyfile.gb
 
 install-data-hook:

-- 
To view, visit https://gerrit.osmocom.org/12774
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib03d0b70d536c8f1386def666c89106a840f7363
Gerrit-Change-Number: 12774
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190201/8f07ff99/attachment.htm>


More information about the gerrit-log mailing list