Add Documentation to the autotools pipeline

This commit is contained in:
Alejandro Gallo 2022-03-14 15:33:10 +01:00
parent 69611ec0d8
commit 4d8be00774
9 changed files with 77 additions and 53 deletions

View File

@ -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

View File

@ -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"

View File

@ -104,10 +104,12 @@ 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])

View File

@ -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

38
docs/Makefile.am Normal file
View File

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

View File

@ -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"

View File

@ -12,6 +12,7 @@ pkgs.mkShell rec {
python3Packages.breathe
doxygen
sphinx
git
graphviz
];

View File

@ -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

View File

@ -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