diff --git a/doc/html/Makefile.am b/doc/html/Makefile.am
index 2d2117f8..a0e89ce2 100644
--- a/doc/html/Makefile.am
+++ b/doc/html/Makefile.am
@@ -69,6 +69,7 @@ doc_DATA = \
EXTRA_DIST = $(doc_DATA) api
+if FLaC__HAS_DOXYGEN
# The install targets don't copy whole directories so we have to
# handle 'api/' specially:
install-data-local:
@@ -78,3 +79,4 @@ uninstall-local:
rm -rf $(DESTDIR)$(docdir)/api
maintainer-clean-local:
rm -rf api
+endif