]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/texinfo-targets.make
Change Snippets compilation
[lilypond.git] / stepmake / stepmake / texinfo-targets.make
1 .PHONY : texinfo-all-menus-update
2
3 default: $(INFO_FILES)
4
5 local-WWW: $(addprefix $(outdir)/,$(TEXI_FILES:.texi=.html))
6
7 local-doc: $(OUTTXT_FILES)
8
9 check-info: texinfo-all-menus-update
10
11 ## info stuff
12 local-install: install-info
13 local-uninstall: uninstall-info
14 install-info: local-install-info
15 uninstall-info: local-uninstall-info
16
17 install-info: $(INFO_FILES)
18         $(INFO_INSTALL_COMMAND) local-install
19
20 uninstall-info:
21         $(INFO_INSTALL_COMMAND) local-uninstall
22
23 # There are two modes for info: with and without images.
24 ifeq ($(out),www)
25
26 # This builds all .info targets with images, in out-www.
27 # Viewable with a recent Emacs, doing: C-u C-h i out-www/lilypond.info
28
29 local-install-info: info
30         -$(INSTALL) -d $(DESTDIR)$(infodir)
31 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
32 ## Can not have absolute symlinks because some binary packages build schemes
33 ## install files in nonstandard root.  Best we can do is to notify the
34 ## builder or packager.
35         @echo
36         @echo "***************************************************************"
37         @echo "Please add or update the LilyPond direntries, do"
38         @echo
39         @echo "    install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info"
40         @echo
41         @echo "For images in the INFO docs to work, do: "
42         @echo
43         @echo "    (cd $(infodir) && ln -sfT ../doc/lilypond/html/$(DEST_INFO_IMAGES_SUBDIR) $(INFO_IMAGES_DIR))"
44         @echo "or add something like that to the postinstall script."
45         @echo
46 else # installing directly into standard /usr/...
47         -$(INSTALL) -d $(DESTDIR)$(infodir)
48         $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
49         install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info
50         cd $(infodir) && ln -sfT $(webdir)/$(DEST_INFO_IMAGES_SUBDIR) $(INFO_IMAGES_DIR)
51 endif # installing directly into standard /usr/...
52
53 local-uninstall-WWW:
54         rm -f $(infodir)/$(INFO_IMAGES_DIR)
55
56 else # out!=www
57
58 local-install-info: info
59         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
60 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
61 ## Can not have absolute symlinks because some binary packages build schemes
62 ## install files in nonstandard root.  Best we can do is to notify the
63 ## builder or packager.
64         @echo
65         @echo "***************************************************************"
66         @echo "Please add or update the LilyPond direntries, do"
67         @echo
68         @echo "    install-info --info-dir=$(infodir) out/$(MAIN_INFO_DOC).info"
69         @echo
70         @echo "For images in the INFO docs to work, do"
71         @echo
72         @echo "    make out=www install-info "
73         @echo
74         @echo "and read the extra instructions."
75         @echo
76 else # installing directly into standard /usr/...
77         -$(INSTALL) -d $(DESTDIR)$(infodir)
78         $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
79         install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info
80         @echo
81         @echo "***************************************************************"
82         @echo "For images in the INFO docs to work, do"
83         @echo
84         @echo "    make out=www install-info "
85         @echo
86 endif # installing into standard /usr/* root# installing into /usr/...
87
88 endif # out!=www
89
90
91 TEXINFO_ALL_MENUS_UPDATE_EL ='\
92   (let ((error nil)\
93         (version-control nil))\
94       (load-library "texinfo")\
95       (texinfo-mode)\
96       (texinfo-all-menus-update)\
97       (if (buffer-modified-p (current-buffer))\
98         (save-buffer))))\
99 '
100
101 # buffer-modified-p is ALWAYS true, even if there were no actual
102 # changes, so we try setting origal (timestamp) back if there
103 # were no changes.
104 #
105 # ugh: emacs20.7 batch mode is not really batch:
106 #
107 # answer `echo q' to the question:
108 # FILE locked by EMAIL (pid PID): (s, q, p, ?)?
109 #
110 texinfo-all-menus-update:
111         -$(foreach i, $(TEXINFO_SOURCES), echo q | emacs --batch --no-site-file $(i) --eval $(TEXINFO_ALL_MENUS_UPDATE_EL); )
112         $(foreach i, $(sort $(TEXINFO_SOURCES)), if diff -u $(i)~ $(i); then mv $(i)~ $(i);  fi && ) true
113
114