Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
f6af10e
configure.ac : add --with-doc(s)=all={yes,no,skip,auto} to manch e.g.…
jimklimov Apr 9, 2017
6c327c9
docs/Makefile.am : typo fix not-building FAQ.chunked
jimklimov Apr 9, 2017
8d964f1
Add "make check" for generated (or "released" pre-built) docs
jimklimov Apr 9, 2017
e98b1eb
docs/man/Makefile.am : fix check-man-txt for distcheck
jimklimov Apr 9, 2017
04f1ecc
docs/man/Makefile.am : fix check-man-pages for distcheck
jimklimov Apr 9, 2017
74f19fc
docs/man/Makefile.am : fix check-man-html for distcheck
jimklimov Apr 9, 2017
df0a98f
Update Makefile.am
jimklimov Apr 10, 2017
0c99dda
Some systems detect man-pages as "ASCII text" - please them
jimklimov Apr 10, 2017
2726117
Some systems detect html-pages as "XML" - please them too
jimklimov Apr 10, 2017
0f5dc3a
Merge remote-tracking branch 'upstream/master' into doc-sanity
jimklimov May 26, 2017
d7512c7
Merge remote-tracking branch 'upstream/master' into doc-sanity as of …
jimklimov Aug 23, 2017
0670ddc
Merge branch 'master' into doc-sanity
jimklimov Feb 23, 2019
39c364d
Merge branch 'master' into doc-sanity
jimklimov Oct 9, 2020
903517f
Update configure.ac
jimklimov Oct 12, 2020
eb6c6db
docs/man/Makefile.am : typo fix ">&@" => ">&2" for stderr
jimklimov Oct 15, 2020
6e6a748
docs/man/Makefile.am : in check-man-* targets, count the checked file…
jimklimov Oct 15, 2020
3d8dbab
Merge branch 'master' into doc-sanity
jimklimov Oct 25, 2020
16dc372
docs/man/Makefile.am : @echo diagnostic messages without a trace by d…
jimklimov Oct 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -700,16 +700,16 @@ NUT_REPORT_FEATURE([build and install documentation], [${nut_with_doc}], [],
DOC_INSTALL_DISTED_MANS=no

case "${nut_with_doc}" in
yes|all)
yes|all|all=yes)
nut_doc_build_list="man html-single html-chunked pdf"
;;
auto)
auto|all=auto)
nut_doc_build_list="man=auto html-single=auto html-chunked=auto pdf=auto"
;;
skip)
skip|all=skip)
nut_doc_build_list="man=skip html-single=skip html-chunked=skip pdf=skip"
;;
no)
no|all=no)
nut_doc_build_list=""
;;
dnl If user passed --with-doc='' they they want nothing, right?
Expand Down Expand Up @@ -897,6 +897,15 @@ esac
NUT_REPORT_FEATURE([build specific documentation format(s)], [${nut_with_doc}], [${DOC_BUILD_LIST}],
[WITH_DOCS], [Define to enable overall documentation generation])

# To cater for less portable make's, precalculate the target list
# for "make check" in "docs/" here...
DOC_CHECK_LIST=""
if test "${nut_with_doc}" = yes ; then
for V in $DOC_BUILD_LIST ; do
DOC_CHECK_LIST="$DOC_CHECK_LIST check-$V"
done
fi

WITH_MANS=no
SKIP_MANS=no
if echo "${DOC_BUILD_LIST}" | grep -w "man" >/dev/null || test "${DOC_INSTALL_DISTED_MANS}" = "yes" ; then
Expand Down Expand Up @@ -1711,6 +1720,7 @@ AC_SUBST(LIBMODBUS_LIBS)
AC_SUBST(LIBIPMI_CFLAGS)
AC_SUBST(LIBIPMI_LIBS)
AC_SUBST(DOC_BUILD_LIST)
AC_SUBST(DOC_CHECK_LIST)
AC_SUBST(LIBWRAP_CFLAGS)
AC_SUBST(LIBWRAP_LIBS)
AC_SUBST(LIBLTDL_CFLAGS)
Expand Down
40 changes: 39 additions & 1 deletion docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,53 @@ SUFFIXES = .txt .html .pdf

all: doc

check-local: @DOC_CHECK_LIST@

doc: @DOC_BUILD_LIST@

pdf: $(ASCIIDOC_PDF)
# also build the HTML manpages with these targets
html-single: $(ASCIIDOC_HTML_SINGLE)
html-chunked: $(ASCIIDOC_HTML_CHUNKED)

# the "for" loops might better use $^ but it might be not portable
check-pdf: $(ASCIIDOC_PDF)
@FAILED=""; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \
for F in $(ASCIIDOC_PDF) ; do \
test -s "$$F" && { file "$$F" | egrep 'PDF document' > /dev/null ; } || FAILED="$$FAILED $$F" ; \
done; if test -n "$$FAILED" ; then \
echo "FAILED PDF sanity check for:$$FAILED" >&2 ; file $$FAILED >&2 ; exit 1; \
fi; echo "PASSED PDF sanity check"; exit 0

check-html-single: $(ASCIIDOC_HTML_SINGLE)
@FAILED=""; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \
for F in $(ASCIIDOC_HTML_SINGLE) ; do \
test -s "$$F" && { file "$$F" | egrep '(XML|HTML.*document)' > /dev/null ; } || FAILED="$$FAILED $$F" ; \
done; if test -n "$$FAILED" ; then \
echo "FAILED HTML-single sanity check for:$$FAILED" >&2 ; file $$FAILED >&2 ; exit 1; \
fi; echo "PASSED HTML-single sanity check"; exit 0

check-html-chunked: $(ASCIIDOC_HTML_CHUNKED)
@FAILED=""; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \
for D in $(ASCIIDOC_HTML_CHUNKED); do \
for F in "$$D"/*.html ; do \
test -s "$$F" && { file "$$F" | egrep '(XML|HTML.*document)' > /dev/null ; } || FAILED="$$FAILED $$F" ; \
done; \
for F in "$$D"/*.css ; do \
test -s "$$F" && { egrep 'CSS stylesheet' "$$F" > /dev/null ; } || FAILED="$$FAILED $$F" ; \
done; \
done; if test -n "$$FAILED" ; then \
echo "FAILED HTML-chunked sanity check for:$$FAILED" >&2 ; file $$FAILED >&2 ; exit 1; \
fi; echo "PASSED HTML-chunked sanity check"; exit 0

# Note: usually the results from man-page check will be reported twice:
# once as a SUBDIRS child makefile, and once via DOC_CHECK_LIST expansion
check-man:
cd $(top_builddir)/docs/man/ && $(MAKE) -f Makefile $@

clean-local:
rm -rf *.pdf *.html *.chunked docbook-xsl.css *.bak
rm -f *.pdf *.html docbook-xsl.css
rm -rf *.chunked *.bak

### TODO: automatic dependency generation
# Add other directory deps (not for local EXTRA_DIST) and generated contents
Expand Down
58 changes: 57 additions & 1 deletion docs/man/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ if ! SKIP_MANS
# runs ./configure --with-doc=skip (or --with-doc=man=skip specifically)
EXTRA_DIST += dist
dist:
echo "ERROR: Manpage building was disabled by configure script, and these pages are required for our proper 'make dist'" >&2 ; false
@echo "ERROR: Manpage building was disabled by configure script, and these pages are required for our proper 'make dist'" >&2 ; false
endif
endif

Expand Down Expand Up @@ -719,6 +719,62 @@ all:

html-man: $(HTML_MANS) index.html

if WITH_MANS
if ! SKIP_MANS
check-local: check-man
else
check-local: check-man-txt check-man-pages
@echo "Man-page generation was SKIPPED per user request, so pregenerated pages were sanity-checked (if any)" >&2
endif
else
check-local: check-man-txt check-man-pages
@echo "Man-page generation was not done, so pregenerated pages were sanity-checked (if any)" >&2
endif

check-man: check-man-txt check-man-pages check-html-man

# the "for" loops might better use $^ but it might be not portable
check-man-html: check-html-man

check-html-man: $(HTML_MANS)
@FAILED=""; CHECKED=0; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \
for F in $(HTML_MANS) ; do \
CHECKED="`expr $$CHECKED + 1`"; \
test -s "$$F" && { file "$$F" | egrep '(XML|HTML.*document)' > /dev/null ; } || FAILED="$$FAILED $$F" ; \
done; if test -n "$$FAILED" ; then \
echo "FAILED HTML-man sanity check for:$$FAILED" >&2 ; file $$FAILED >&2 ; exit 1; \
fi; echo "PASSED HTML-man sanity check (checked $$CHECKED files)"; exit 0

# Note: many man-pages here have code samples and are mis-identified as C code
check-man-page: check-man-pages

# Man-pages may be pre-generated (srcdir), or re-built (builddir)
check-man-pages: $(MAN_MANS)
@FAILED=""; CHECKED=0; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \
for F in $(MAN_MANS) ; do \
CHECKED="`expr $$CHECKED + 1`"; \
( test -s "$(abs_srcdir)/$$F" && { file "$(abs_srcdir)/$$F" | egrep '(troff.* input|C source|ASCII text)' > /dev/null ; } ) || \
( test -s "$(abs_builddir)/$$F" && { file "$(abs_builddir)/$$F" | egrep '(troff.* input|C source|ASCII text)' > /dev/null ; } ) || \
FAILED="$$FAILED $$F" ; \
done; if test -n "$$FAILED" ; then \
echo "FAILED man-page sanity check for:$$FAILED" >&2 ; \
( echo "SRCDIR:"; cd "$(abs_srcdir)/" && file $$FAILED ; \
echo "BUILDDIR:"; cd "$(abs_builddir)/" && file $$FAILED ; \
) >&2 ; exit 1; \
fi; echo "PASSED man-page sanity check (checked $$CHECKED files)"; exit 0

check-man-source: check-man-txt

check-man-txt: $(SRC_ALL_PAGES)
@FAILED=""; CHECKED=0; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \
cd $(abs_srcdir) || exit; \
for F in $(SRC_ALL_PAGES) ; do \
CHECKED="`expr $$CHECKED + 1`"; \
test -s "$$F" && { file "$$F" | egrep '(ASCII|UTF-8|Unicode|ISO-8859|English).* text' > /dev/null ; } || FAILED="$$FAILED $$F" ; \
done; if test -n "$$FAILED" ; then \
echo "FAILED man-source sanity check for:$$FAILED" >&2 ; file $$FAILED >&2 ; exit 1; \
fi; echo "PASSED man-source sanity check (checked $$CHECKED files)"; exit 0

CLEANFILES = *.xml *.html

SUFFIXES = .txt .html .1 .3 .5 .8
Expand Down