libabigail/doc/Makefile.am
Dodji Seketeli 8798649dbe Do not remove api and website source files by accident
When the root source dir is used as root build dir, make clean can
remove the content of ${abs_builddir}/api which is then equal to
${abs_srcdir}/api.  Oops.  This patch fixes this.

	* doc/Makefile.am: Do not remove the entirety of the build dir of
	doxygen for the apidoc and the website as these can be also the
	source dirs.  Rather, remove that is under the html/ sub-directory
	of the build dir, as this is always generated by doxygen.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 13:31:30 +02:00

72 lines
2.2 KiB
Makefile

SUBDIRS = manuals
EXTRA_DIST = api/libabigail.doxy website/libabigail-website.doxy
html-doc: $(DO_HTML)
website: website-html-doxygen
if ENABLE_APIDOC
install-html-doc: $(DO_INSTALL_HTML)
endif
DO_HTML = apidoc-html-doxygen website-html-doxygen
DO_INSTALL_HTML = apidoc-install-html-doxygen
#doxygen
DOXY_API_SRC_CFG = ${abs_srcdir}/api/libabigail.doxy
DOXY_API_BLD_DIR = ${abs_builddir}/api
DOXY_API_BLD_CFG = ${abs_builddir}/api/html.doxy
DOXY_WEBSITE_BLD_DIR = ${abs_builddir}/website
DOXY_WEBSITE_SRC_CFG = ${abs_srcdir}/website/libabigail-website.doxy
DOXY_WEBSITE_BLD_CFG = ${abs_builddir}/website/libabigail-website.doxy
$(DOXY_API_BLD_DIR):
if test ! -d $(DOXY_API_BLD_DIR); then \
mkdir -p $(DOXY_API_BLD_DIR); \
fi
$(DOXY_WEBSITE_BLD_DIR):
if test ! -d $(DOXY_WEBSITE_BLD_DIR); then \
mkdir -p $(DOXY_WEBSITE_BLD_DIR); \
fi
doxygen-api-cfg: $(DOXY_API_SRC_CFG) $(DOXY_API_BLD_DIR)
sed -e "s=LIBABIGAIL_INPUT=${abs_srcdir}/..=g" < $(DOXY_API_SRC_CFG) \
> $(DOXY_API_BLD_CFG)
sed -i -e "s=LIBABIGAIL_OUTPUT=${abs_builddir}/..=g" $(DOXY_API_BLD_CFG)
doxygen-website-cfg: $(DOXY_WEBSITE_SRC_CFG) $(DOXY_WEBSITE_BLD_DIR)
sed -e "s=LIBABIGAIL_INPUT=${abs_srcdir}/..=g" < $(DOXY_WEBSITE_SRC_CFG) \
> $(DOXY_WEBSITE_BLD_CFG)
sed -i -e "s=LIBABIGAIL_OUTPUT=${abs_builddir}/..=g" $(DOXY_WEBSITE_BLD_CFG)
apidoc-html-doxygen: doxygen-api-cfg
doxygen $(DOXY_API_BLD_CFG)
website-html-doxygen: doxygen-website-cfg
doxygen $(DOXY_WEBSITE_BLD_CFG)
apidoc-install-html-doxygen: apidoc-html-doxygen
test -d "$(DESTDIR)$(docdir)" || $(mkinstalldirs) "$(DESTDIR)$(docdir)"
cp -r ${DOXY_API_BLD_DIR} "$(DESTDIR)$(docdir)"
website-install-html-doxygen: doxygen-website-cfg
test -z "$(DESTDIR)$(docdir)/website" || $(mkinstalldirs) "$(DESTDIR)$(docdir)/website"
cp -r $(DOXY_WEBSITE_BLD_DIR) "$(DESTDIR)$(docdir)/website"
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = $(DOXY_API_BLD_CFG) $(DOXY_WEBSITE_BLD_CFG)
# To remove directories.
clean-local:
-rm -rf $(DOXY_API_BLD_DIR)/*/* $(DOXY_WEBSITE_BLD_DIR)/*/*
#To install everything:
if ENABLE_APIDOC
install-html-doc: install-html
uninstall-local: clean-local
-rm -rf $(DESTDIR)$(docdir)
endif