-local-WWW: $(HTML_FILES) $(datafiles) $(PS_GZ_FILES) backdoc-WWW
- $(SHELL) $(buildscript-dir)/install-info-html.sh $(outdir) lilypond lilypond-internals
- $(MAKE) footify
- ln -f $(outdir)/*.png $(outdir)/lilypond
- $(MAKE) deep-footify
+# Info is now built by default via texinfo-rules.
+# We must build them by default, otherwise they get built during make install
+info: $(INFO_FILES)
+
+
+# The new pretest version of makeinfo, 4.0a splits html files into their own
+# directory. Available from
+# ftp://texinfo.org/texinfo/pretests/texinfo-4.0a.tar.gz
+SPLITTING_MAKEINFO = $(shell makeinfo --version | egrep '4.0((.jcn[2,3])|a)')
+
+
+# Generic rule using % twice not possible?
+# $(outdir)/%/%.html: $(outdir)/%.texi
+$(outdir)/lilypond/lilypond.html: $(outdir)/lilypond.texi
+ -$(MAKEINFO) --force --output=$@ --html $<
+ -cp -f $(outdir)/*.png $(outdir)/lilypond
+ -cp -f $(outdir)/lilypond/index.html $@
+ $(deep-footify) $(shell find $(outdir)/$(*F)/*.html)
+
+$(outdir)/lilypond-internals/lilypond-internals.html: $(outdir)/lilypond-internals.texi
+ -$(MAKEINFO) --force --output=$@ --html $<
+ -cp -f $(outdir)/*.png $(outdir)/lilypond-internals
+ -cp -f $(outdir)/lilypond-internals/index.html $@
+ $(deep-footify) $(shell find $(outdir)/$(*F)/*.html)
+
+ifneq ($(SPLITTING_MAKEINFO),)
+
+DEEP_HTML_FILES = $(outdir)/lilypond/lilypond.html $(outdir)/lilypond-internals/lilypond-internals.html