@ -706,17 +706,49 @@ devsetup: Makefile.autoconf
echo '$(TERM_INFO) eval $$(opam config env)$(TERM_RESET)' >& 2; \
fi
GHPAGES ?= no
.PHONY : doc
doc : src_build_common
$( QUIET) $( call silent_on_success,Generating infer documentation,\
$( MAKE_SOURCE) doc)
# do not call the browser if we are publishing the docs
i f e q ( $( filter doc -publish ,$ {MAKECMDGOALS }) , )
$( QUIET) $( call silent_on_success,Opening in browser,\
browse $( SRC_DIR) /_build/$( BUILD_MODE) /_doc/_html/index.html)
$( QUIET) echo "Tip: you can generate the doc for all the opam dependencies of infer like this:"
$( QUIET) echo
$( QUIET) echo " odig odoc # takes a while, run it only when the dependencies change"
$( QUIET) echo " odig doc"
e n d i f
.PHONY : doc -publish
doc-publish : doc $( INFER_MANUALS )
i f e q ( $( GHPAGES ) , n o )
$( QUIET) echo " $( TERM_ERROR) Please set GHPAGES to a checkout of the gh-pages branch of the GitHub repo of infer $( TERM_RESET) " >& 2
$( QUIET) exit 1
e n d i f
# sanity check to avoid cryptic error messages and potentially annoying side-effects
$( QUIET) if ! [ -d " $( GHPAGES) " /static/man ] ; then \
echo " $( TERM_ERROR) ERROR: GHPAGES doesn't seem to point to a checkout of the gh-pages branch of the GitHub repo of infer: $( TERM_RESET) " >& 2; \
echo " $( TERM_ERROR) ERROR: ' $( GHPAGES) /static/man' not found or not a directory. $( TERM_RESET) " >& 2; \
echo " $( TERM_ERROR) ERROR: Please fix this and try again. $( TERM_RESET) " >& 2; \
exit 1; \
fi
$( QUIET) $( call silent_on_success,Copying man pages,\
$( REMOVE_DIR) " $( GHPAGES) " /static/man/*; \
for man in $( INFER_MANUALS) ; do \
groff -Thtml " $$ man " > " $( GHPAGES) " /static/man/$$ ( basename " $$ man " ) .html; \
done )
i f e q ( $( IS_FACEBOOK_TREE ) , n o )
$( QUIET) $( call silent_on_success,Copying OCaml modules documentation,\
version = $$ ( $( INFER_BIN) --version | head -1 | cut -d ' ' -f 3 | cut -c 2-) ; \
rsync -a --delete $( SRC_DIR) /_build/$( BUILD_MODE) /_doc/_html/ " $( GHPAGES) " /static/odoc/" $$ version " ; \
$( REMOVE) " $( GHPAGES) " /static/odoc/latest; \
$( LN_S) " $$ version " " $( GHPAGES) " /static/odoc/latest)
e l s e
$( QUIET) echo "Not an open-source tree, skipping the API docs generation"
e n d i f
# print list of targets
.PHONY : show -targets