diff --git a/doc/Makefile.am b/doc/Makefile.am
index cf5908aafe267701d15382736a9031e6e84764fa..02f3493185025daea0a66b6f7c0bb9ba3a1376bd 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -21,8 +21,8 @@ doxygen-build.stamp: Doxyfile $(DOCINPUTS)
 	touch $@
 
 install-data-local:
+	$(INSTALL) -d $(DESTDIR)$(docdir)/html/search
 	for f in `find html -type f \! -name "installdox"`; do	\
-		$(INSTALL) -d $(DESTDIR)$(docdir)/html/search;	\
 		$(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f;	\
 	done