Skip to content

Commit

Permalink
Add 'docsite' target (FreeRADIUS#2900)
Browse files Browse the repository at this point in the history
* doc: clean up unused variable

* doc: Add 'docsite' target
  • Loading branch information
jpereira authored and arr2036 committed Aug 16, 2019
1 parent 77cfdbd commit f04f339
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 6 deletions.
1 change: 1 addition & 0 deletions Make.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,4 @@ PANDOC := @PANDOC@
PANDOC_ENGINE := @PANDOC_ENGINE@
DOXYGEN := @DOXYGEN@
GRAPHVIZ_DOT := @GRAPHVIZ_DOT@
ANTORA := @ANTORA@
46 changes: 46 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ build_os
build_vendor
build_cpu
build
ANTORA
GRAPHVIZ_DOT
DOXYGEN
PERL
Expand Down Expand Up @@ -2911,6 +2912,51 @@ else
$as_echo "$as_me: WARNING: doxygen not found - Please install if you want build the docs/source" >&2;}
fi
# Extract the first word of "antora", so it can be a program name with args.
set dummy antora; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_ANTORA+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ANTORA in
[\\/]* | ?:[\\/]*)
ac_cv_path_ANTORA="$ANTORA" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ANTORA="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ANTORA=$ac_cv_path_ANTORA
if test -n "$ANTORA"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANTORA" >&5
$as_echo "$ANTORA" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_cv_path_ANTORA" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: antora not found - Please install if you want build the site" >&5
$as_echo "$as_me: WARNING: antora not found - Please install if you want build the site" >&2;}
fi
# Check whether --enable-developer was given.
if test "${enable_developer+set}" = set; then :
enableval=$enable_developer; case "$enableval" in
Expand Down
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ else
AC_MSG_WARN([doxygen not found - Please install if you want build the docs/source])
fi

dnl #
dnl # check for Antora
dnl #
AC_PATH_PROG(ANTORA, antora)
if test "x$ac_cv_path_ANTORA" = "x"; then
AC_MSG_WARN([antora not found - Please install if you want build the site])
fi

dnl #
dnl # Enable developer features like debugging symbols.
dnl # These checks must be done before expanding the AC_PROG_CC
Expand Down
22 changes: 16 additions & 6 deletions doc/all.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# to fix that. So, only run those shell scripts if we're going to
# build the documentation.
#
WITH_DOC := $(strip $(foreach x,doc html pdf doxygen,$(findstring $(x),$(MAKECMDGOALS))))
WITH_DOC := $(strip $(foreach x,doc html docsite pdf doxygen,$(findstring $(x),$(MAKECMDGOALS))))
ifneq "$(WITH_DOC)" ""

#
Expand All @@ -23,6 +23,13 @@ ifeq "$(PANDOC)" ""
$(error pandoc is required to build the documentation)
endif

#
# We're building a documentation target, but there's no "antora".
#
ifeq "$(ANTORA)" ""
$(error antora is required to build the documentation)
endif

#
# We're installing the documentation, but there's no "docdir".
#
Expand All @@ -32,12 +39,10 @@ $(error 'docdir' is required to do 'make install')
endif
endif

BUILD_DOC := $(strip $(foreach x,doc html pdf adoc install.doc clean,$(findstring $(x),$(MAKECMDGOALS))))

#
# TODO: The 'pdf' target is broken. we should enable here soon.
#
all.doc: html
all.doc: html docsite

install: install.doc

Expand Down Expand Up @@ -89,7 +94,7 @@ install.doc: $(addprefix $(R)/$(docdir)/,$(ALL_DOC_FILES))
.PHONY: clean.doc
clean.doc:
${Q}rm -f doc/*~ doc/rfc/*~ doc/examples/*~ $(AUTO_ADOC_FILES) $(HTML_FILES) $(PDF_FILES)
${Q}rm -rf $(DOXYGEN_HTML_DIR)
${Q}rm -rf $(DOXYGEN_HTML_DIR) $(BUILD_DIR)/site

.PHONY: tests.doc
tests.doc:
Expand Down Expand Up @@ -125,6 +130,11 @@ all.doc: doxygen
endif
endif

.PHONY: docsite
docsite:
@echo ANTORA site.yml
${Q}$(ANTORA) site.yml

#
# Markdown files get converted to asciidoc via pandoc.
#
Expand Down Expand Up @@ -191,7 +201,7 @@ doc/%.pdf: doc/%.md
-V papersize=letter \
--template=./scripts/asciidoc/freeradius.template -o $@ $<

.PHONY: asciidoc html pdf clean clean.doc
.PHONY: asciidoc html docsite pdf clean clean.doc
asciidoc: $(ADOC_FILES)
html: $(HTML_FILES)
pdf: $(PDF_FILES)
Expand Down

0 comments on commit f04f339

Please sign in to comment.