]> 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 6754b77f5fe389bacd8ad48f64406e54e2c58dc4..487ee97e491998257c5f4f108770064b18f93b05 100644 (file)
@@ -2,9 +2,13 @@
 
 default: $(INFO_FILES)
 
+ifeq ($(out),www)
 local-WWW-1: $(XREF_MAPS_FILES)
 
-local-doc:  $(OUTTXT_FILES)
+local-WWW-2: $(OUT_CSS_FILES)
+endif
+
+local-txt-doc:  $(OUTTXT_FILES)
 
 check-info: texinfo-all-menus-update
 
@@ -31,25 +35,43 @@ 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)
-## 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 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)
        @echo
        @echo "***************************************************************"
-       @echo "Please add or update the LilyPond direntries, do"
-       @echo
-       @echo "    install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info"
+       @echo "Please add or update the LilyPond direntries,"
+       @echo "do or add in the postinstall script"
        @echo
-       @echo "For images in the INFO docs to work, do: "
-       @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:
+local-uninstall-info: uninstall-info-images
        -rmdir $(DESTDIR)$(infodir)
 
 else # installing directly into standard /usr/...
@@ -57,33 +79,28 @@ 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)
+       $(MAKE) install-info-images
 
-local-uninstall-info:
+local-uninstall-info: uninstall-info-images
        $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
-       rm -f $(infodir)/$(INFO_IMAGES_DIR)
 
 endif # installing directly into standard /usr/...
 
 else # out!=www
 
 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:
@@ -96,9 +113,19 @@ local-install-info: info
        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 "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 "    make out=www install-info "
+       @echo "For details, please read Application Usage document, section \"Building documentation\"."
        @echo
 
 local-uninstall-info:
@@ -136,8 +163,9 @@ texinfo-all-menus-update:
 local-help: local-texinfo-help
 
 local-texinfo-help:
-       @echo -e "\
-  info [out=www]  update Info documentation (use \`out=www' for having images)\n\
-  install-info [out=www]   install Info documentation (idem)\n\
-  texinfo-all-menus-update update node menus in Texinfo source files (use with caution)\n"
+       @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)"