-man/index.html: $(XML_FILES) $(top_srcdir)/make-man-index.py
- $(AM_V_GEN)$(PYTHON) $(top_srcdir)/make-man-index.py $(XML_FILES) > $@ || rm $@
+$(builddir)/man/index.html: $(XML_FILES:.xml=.html) $(top_srcdir)/make-man-index.py
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(PYTHON) $(top_srcdir)/make-man-index.py $(XML_FILES) > $@ || rm $@
+
+EXTRA_DIST += man/index.html