From 4d8be00774fca34a6c158149c543c22330ab0efd Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Mon, 14 Mar 2022 15:33:10 +0100 Subject: [PATCH] Add Documentation to the autotools pipeline --- .github/workflows/main.yml | 17 ++++++++++++++++- Makefile.am | 13 +------------ configure.ac | 6 ++++-- docs/Makefile | 36 ------------------------------------ docs/Makefile.am | 38 ++++++++++++++++++++++++++++++++++++++ docs/conf.py | 2 +- docs/shell.nix | 1 + etc/make/emacs.mk | 11 ++++++++++- shell.nix | 6 ++++++ 9 files changed, 77 insertions(+), 53 deletions(-) delete mode 100644 docs/Makefile create mode 100644 docs/Makefile.am diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57566fc..9c2c2a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,22 @@ jobs: strategy: matrix: - compiler: [gcc6, gcc7, gcc8, gcc9, gcc10, gcc11, clang9, clang10, clang11, clang12, clang13] + compiler: + - gcc11 + - gcc10 + - gcc9 + - gcc8 + - gcc7 + - gcc6 + - clang13 + - clang12 + - clang11 + - clang10 + - clang9 + - clang8 + - clang7 + - clang6 + - clang5 steps: - uses: actions/checkout@v2.3.4 diff --git a/Makefile.am b/Makefile.am index ca6e761..c2771fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,21 +11,10 @@ ORG_MAIN = atrip.org tangle: $(ORG_MAIN) $(call tangle,$<) -clean-emacs: CLEANING=yes clean-emacs: -rm -v $(_ATRIPSRCS) -.PHONY: tangle - -EMACS_HTML = $(EMACS) --load ./etc/emacs/html.el - -%.html: %.org - $(EMACS_HTML) $< -f org-html-export-to-html - -%.rst: %.org - $(EMACS_HTML) $< -f org-rst-export-to-rst - -.PHONY: dbg +.PHONY: dbg tangle dbg: include/dbg.h include/dbg.h: wget -O $@ "https://raw.githubusercontent.com/sharkdp/dbg-macro/master/dbg.h" diff --git a/configure.ac b/configure.ac index c2ce647..381048e 100644 --- a/configure.ac +++ b/configure.ac @@ -104,11 +104,13 @@ else [AC_MSG_ERROR([no ctf.hpp])]) fi - AC_CONFIG_FILES([Makefile src/Makefile bench/Makefile - ]) + docs/Makefile + docs/conf.py:docs/conf.py + docs/Doxyfile:docs/Doxyfile + ]) AC_CONFIG_HEADERS([config.h]) AC_MSG_RESULT([ diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 05415fb..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# variables -# -SPHINX_BUILD_DIR = build -DOXYGEN_INDEX = $(SPHINX_BUILD_DIR)/doxygen/html/index.html -EXTRA_STYLESHEET_URL = https://github.com/jothepro/doxygen-awesome-css.git -DX_HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css - -# rules -# -all: doxygen sphinx - -.PHONY: sphinx doxygen - -doxygen: $(DOXYGEN_INDEX) -$(DX_HTML_EXTRA_STYLESHEET): - git clone $(EXTRA_STYLESHEET_URL) - -$(DOXYGEN_INDEX): Doxyfile $(DX_HTML_EXTRA_STYLESHEET) - mkdir -p $(@D) - doxygen $< - -$(SPHINX_BUILD_DIR)/index.html: index.rst atrip.rst conf.py - sphinx-build . $(SPHINX_BUILD_DIR) -sphinx: $(SPHINX_BUILD_DIR)/index.html - -index.rst: ../README.rst - cp $< $@ - -atrip.rst: ../atrip.rst - cp $< $@ - -../%.rst: - make -C $(dir $@) $(notdir $@) - -clean: - rm -rfv sphinx doxygen/ index.rst atrip.rst diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..6fac47e --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,38 @@ +include $(top_srcdir)/etc/make/emacs.mk + +# variables +# +SPHINX_BUILD_DIR = build +DOXYGEN_INDEX = $(SPHINX_BUILD_DIR)/doxygen/html/index.html + +DX_EXTRA_STYLESHEET_URL = https://github.com/jothepro/doxygen-awesome-css.git +DX_HTML_EXTRA_FOLDER = $(builddir)/doxygen-awesome-css +DX_HTML_EXTRA_STYLESHEET = $(DX_HTML_EXTRA_FOLDER)/doxygen-awesome.css + + +all: doxygen sphinx +.PHONY: sphinx doxygen + +doxygen: $(DOXYGEN_INDEX) + +$(DOXYGEN_INDEX): Doxyfile $(DX_HTML_EXTRA_STYLESHEET) + mkdir -p $(@D) + doxygen $< + +$(DX_HTML_EXTRA_STYLESHEET): + git clone $(DX_EXTRA_STYLESHEET_URL) $(DX_HTML_EXTRA_FOLDER) + +$(SPHINX_BUILD_DIR)/index.html: index.rst atrip.rst conf.py + sphinx-build -b html . $(SPHINX_BUILD_DIR) +sphinx: $(SPHINX_BUILD_DIR)/index.html + +index.rst: $(top_srcdir)/README.rst + cp $< $@ + +atrip.rst: $(top_srcdir)/atrip.rst + cp $< $@ + +clean-local: + rm -rfv sphinx doxygen/ index.rst atrip.rst \ + $(SPHINX_BUILD_DIR) \ + $(DX_HTML_EXTRA_FOLDER) diff --git a/docs/conf.py b/docs/conf.py index d037402..4352574 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,7 +5,7 @@ extensions = [ 'breathe' ] templates_path = ['_templates'] exclude_patterns = [] html_theme = 'nature' -html_static_path = ['_static'] +#html_static_path = ['_static'] breathe_projects = { "atrip": "doxygen/xml/" } breathe_default_project = "atrip" diff --git a/docs/shell.nix b/docs/shell.nix index 3eedf31..84c2f41 100644 --- a/docs/shell.nix +++ b/docs/shell.nix @@ -12,6 +12,7 @@ pkgs.mkShell rec { python3Packages.breathe doxygen sphinx + git graphviz ]; diff --git a/etc/make/emacs.mk b/etc/make/emacs.mk index 82f0485..85be6a8 100644 --- a/etc/make/emacs.mk +++ b/etc/make/emacs.mk @@ -1,5 +1,14 @@ -EMACS = emacs -q --batch --load config.el +EMACS = emacs -q --batch --load $(top_srcdir)/config.el +EMACS_HTML = $(EMACS) --load $(top_srcdir)/etc/emacs/html.el + define tangle $(EMACS) $(1) --eval '(org-babel-tangle)' endef +SUFFIXES = .html .org .rst + +.org.html: + $(EMACS_HTML) $< -f org-html-export-to-html + +.org.rst: + $(EMACS_HTML) $< -f org-rst-export-to-rst diff --git a/shell.nix b/shell.nix index 0ab5258..b3a7ece 100644 --- a/shell.nix +++ b/shell.nix @@ -21,11 +21,16 @@ pkgs.mkShell rec { else if compiler == "gcc8" then pkgs.gcc8 else if compiler == "gcc7" then pkgs.gcc7 else if compiler == "gcc6" then pkgs.gcc6 + else if compiler == "gcc49" then pkgs.gcc49 else if compiler == "clang13" then pkgs.clang_13 else if compiler == "clang12" then pkgs.clang_12 else if compiler == "clang11" then pkgs.clang_11 else if compiler == "clang10" then pkgs.clang_10 else if compiler == "clang9" then pkgs.clang_9 + else if compiler == "clang8" then pkgs.clang_8 + else if compiler == "clang7" then pkgs.clang_7 + else if compiler == "clang6" then pkgs.clang_6 + else if compiler == "clang5" then pkgs.clang_5 else pkgs.gcc; buildInputs @@ -39,6 +44,7 @@ pkgs.mkShell rec { binutils emacs + gfortran gnumake libtool