]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/stepmake/texinfo-targets.make
Build: end directories in their bare names and avoid some double slashes in logs.
[lilypond.git] / stepmake / stepmake / texinfo-targets.make
index 488b81f24bac9423cce410b380e337f505f694e7..487ee97e491998257c5f4f108770064b18f93b05 100644 (file)
@@ -2,9 +2,13 @@
 
 default: $(INFO_FILES)
 
-local-WWW: $(addprefix $(outdir)/,$(TEXI_FILES:.texi=.html))
+ifeq ($(out),www)
+local-WWW-1: $(XREF_MAPS_FILES)
+
+local-WWW-2: $(OUT_CSS_FILES)
+endif
 
-local-doc: $(OUTTXT_FILES)
+local-txt-doc:  $(OUTTXT_FILES)
 
 check-info: texinfo-all-menus-update
 
@@ -31,64 +35,103 @@ ifeq ($(out),www)
 # This builds all .info targets with images, in out-www.
 # Viewable with a recent Emacs, doing: C-u C-h i out-www/lilypond.info
 
+ifneq ($(COPY_INFO_IMAGES),)
+# only Info docs are installed (not HTML nor PDF),
+# so images should be copied
+
+install-info-images:
+# remove $(infodir)/$(INFO_IMAGES_DIR) in case it is a symlink
+       -rm -f $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+       $(INSTALL) -d $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+       rsync -r --include '[0-9a-f][0-9a-f]' --include '*.png' --exclude '*' $(outdir)/ $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+
+uninstall-info-images:
+       rm -f $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR) || rm -rf $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+
+else # if HTML and PDF docs are installed too, symlink image directories
+install-info-images: uninstall-info-images
+       cd $(DESTDIR)$(infodir) && ln -sf $$($(PYTHON) $(buildscript-dir)/relative $(DESTDIR)$(webdir)/$(DEST_INFO_IMAGES_SUBDIR)) $(INFO_IMAGES_DIR)
+
+uninstall-info-images:
+       rm -f $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR) || rm -rf $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+endif # copying info images
+
+
+ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
+## install-info can't do all its job for binary packages' build systems.
+## Best we can do is to notify the builder or packager.
 local-install-info: info
        -$(INSTALL) -d $(DESTDIR)$(infodir)
-ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
-## Can not have absolute symlinks because some binary packages build schemes
-## install files in nonstandard root.  Best we can do is to notify the
-## builder or packager.
        @echo
        @echo "***************************************************************"
-       @echo "Please add or update the LilyPond direntries, do"
-       @echo
-       @echo "    install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info"
-       @echo
-       @echo "For images in the INFO docs to work, do: "
+       @echo "Please add or update the LilyPond direntries,"
+       @echo "do or add in the postinstall script"
        @echo
-       @echo "    (cd $(infodir) && ln -sfT ../doc/lilypond/html/$(DEST_INFO_IMAGES_SUBDIR) $(INFO_IMAGES_DIR))"
-       @echo "or add something like that to the postinstall script."
+       @echo "    install-info --info-dir=$(infodir) $(DESTDIR)$(infodir)/$(MAIN_INFO_DOC).info"
        @echo
+       $(MAKE) install-info-images
+
+local-uninstall-info: uninstall-info-images
+       -rmdir $(DESTDIR)$(infodir)
+
 else # installing directly into standard /usr/...
+local-install-info: info
        -$(INSTALL) -d $(DESTDIR)$(infodir)
        $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
        install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info
-       cd $(infodir) && ln -sfT $(webdir)/$(DEST_INFO_IMAGES_SUBDIR) $(INFO_IMAGES_DIR)
-endif # installing directly into standard /usr/...
+       $(MAKE) install-info-images
 
-local-uninstall-WWW:
-       rm -f $(infodir)/$(INFO_IMAGES_DIR)
+local-uninstall-info: uninstall-info-images
+       $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
+
+endif # installing directly into standard /usr/...
 
 else # out!=www
 
-local-install-info: info
-       -$(INSTALL) -d $(DESTDIR)$(package_infodir)
 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
-## Can not have absolute symlinks because some binary packages build schemes
-## install files in nonstandard root.  Best we can do is to notify the
-## builder or packager.
+## install-info can't do all his job for binary packages build systems.
+## Best we can do is to notify the builder or packager.
+local-install-info: info
+       -$(INSTALL) -d $(DESTDIR)$(infodir)
        @echo
        @echo "***************************************************************"
        @echo "Please add or update the LilyPond direntries, do"
        @echo
-       @echo "    install-info --info-dir=$(infodir) out/$(MAIN_INFO_DOC).info"
-       @echo
-       @echo "For images in the INFO docs to work, do"
-       @echo
-       @echo "    make out=www install-info "
+       @echo "    install-info --info-dir=$(infodir) $(DESTDIR)$(infodir)/$(MAIN_INFO_DOC).info"
        @echo
-       @echo "and read the extra instructions."
+       @echo "To compile Info documentation with images, please read"
+       @echo "Application Usage document, section \"Building documentation\"."
        @echo
+
+local-uninstall-info:
+       -rmdir $(DESTDIR)$(infodir)
+
 else # installing directly into standard /usr/...
+local-install-info: info
        -$(INSTALL) -d $(DESTDIR)$(infodir)
        $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
        install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info
        @echo
        @echo "***************************************************************"
-       @echo "For images in the INFO docs to work, do"
+       @echo "To compile Info documentation with images, do from top of the build tree"
+       @echo
+       @echo "    make doc"
        @echo
-       @echo "    make out=www install-info "
+       @echo "which builds documentation in all formats; to build only Info documentation, do"
+       @echo
+       @echo "    make info"
+       @echo
+       @echo "To list all available targets, do"
+       @echo
+       @echo "    make help"
+       @echo
+       @echo "For details, please read Application Usage document, section \"Building documentation\"."
        @echo
-endif # installing into standard /usr/* root# installing into /usr/...
+
+local-uninstall-info:
+       $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
+
+endif # installing into standard /usr/* root
 
 endif # out!=www
 
@@ -117,4 +160,12 @@ texinfo-all-menus-update:
        -$(foreach i, $(TEXINFO_SOURCES), echo q | emacs --batch --no-site-file $(i) --eval $(TEXINFO_ALL_MENUS_UPDATE_EL); )
        $(foreach i, $(sort $(TEXINFO_SOURCES)), if diff -u $(i)~ $(i); then mv $(i)~ $(i);  fi && ) true
 
+local-help: local-texinfo-help
+
+local-texinfo-help:
+       @echo "  info [out=www]           update Info documentation"
+       @echo "                             (use \`out=www' for having images)"
+       @echo "  install-info [out=www]   install Info documentation (idem)"
+       @echo "  texinfo-all-menus-update update node menus in Texinfo source files"
+       @echo "                             (use with caution)"