]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/texinfo-targets.make
Add Contributors' Guide stub and clean up makefiles
[lilypond.git] / stepmake / stepmake / texinfo-targets.make
1 .PHONY : texinfo-all-menus-update
2
3 default: $(INFO_FILES)
4
5 local-WWW-1: $(XREF_MAPS_FILES)
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 ifeq ($(INFO_FILES),)
24 local-install-info:
25 local-uninstall-info:
26
27 else # $(INFO_FILES) non empty
28 # There are two modes for info: with and without images.
29 ifeq ($(out),www)
30
31 # This builds all .info targets with images, in out-www.
32 # Viewable with a recent Emacs, doing: C-u C-h i out-www/lilypond.info
33
34 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
35 ## Can not have absolute symlinks because some binary packages build schemes
36 ## install files in nonstandard root.  Best we can do is to notify the
37 ## builder or packager.
38 local-install-info: info
39         -$(INSTALL) -d $(DESTDIR)$(infodir)
40         @echo
41         @echo "***************************************************************"
42         @echo "Please add or update the LilyPond direntries, do"
43         @echo
44         @echo "    install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info"
45         @echo
46         @echo "For images in the INFO docs to work, do: "
47         @echo
48         @echo "    (cd $(infodir) && ln -sfT ../doc/lilypond/html/$(DEST_INFO_IMAGES_SUBDIR) $(INFO_IMAGES_DIR))"
49         @echo "or add something like that to the postinstall script."
50         @echo
51
52 local-uninstall-info:
53         -rmdir $(DESTDIR)$(infodir)
54
55 else # installing directly into standard /usr/...
56 local-install-info: info
57         -$(INSTALL) -d $(DESTDIR)$(infodir)
58         $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
59         install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info
60         cd $(infodir) && ln -sfT $(webdir)/$(DEST_INFO_IMAGES_SUBDIR) $(INFO_IMAGES_DIR)
61
62 local-uninstall-info:
63         $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
64         rm -f $(infodir)/$(INFO_IMAGES_DIR)
65
66 endif # installing directly into standard /usr/...
67
68 else # out!=www
69
70 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
71 ## Can not have absolute symlinks because some binary packages build schemes
72 ## install files in nonstandard root.  Best we can do is to notify the
73 ## builder or packager.
74 local-install-info: info
75         -$(INSTALL) -d $(DESTDIR)$(infodir)
76         @echo
77         @echo "***************************************************************"
78         @echo "Please add or update the LilyPond direntries, do"
79         @echo
80         @echo "    install-info --info-dir=$(infodir) out/$(MAIN_INFO_DOC).info"
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         @echo "and read the extra instructions."
87         @echo
88
89 local-uninstall-info:
90         -rmdir $(DESTDIR)$(infodir)
91
92 else # installing directly into standard /usr/...
93 local-install-info: info
94         -$(INSTALL) -d $(DESTDIR)$(infodir)
95         $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
96         install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info
97         @echo
98         @echo "***************************************************************"
99         @echo "For images in the INFO docs to work, do"
100         @echo
101         @echo "    make out=www install-info "
102         @echo
103
104 local-uninstall-info:
105         $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
106
107 endif # installing into standard /usr/* root
108
109 endif # out!=www
110
111 endif # $(INFO_FILES) non empty
112
113 TEXINFO_ALL_MENUS_UPDATE_EL ='\
114   (let ((error nil)\
115         (version-control nil))\
116       (load-library "texinfo")\
117       (texinfo-mode)\
118       (texinfo-all-menus-update)\
119       (if (buffer-modified-p (current-buffer))\
120         (save-buffer))))\
121 '
122
123 # buffer-modified-p is ALWAYS true, even if there were no actual
124 # changes, so we try setting origal (timestamp) back if there
125 # were no changes.
126 #
127 # ugh: emacs20.7 batch mode is not really batch:
128 #
129 # answer `echo q' to the question:
130 # FILE locked by EMAIL (pid PID): (s, q, p, ?)?
131 #
132 texinfo-all-menus-update:
133         -$(foreach i, $(TEXINFO_SOURCES), echo q | emacs --batch --no-site-file $(i) --eval $(TEXINFO_ALL_MENUS_UPDATE_EL); )
134         $(foreach i, $(sort $(TEXINFO_SOURCES)), if diff -u $(i)~ $(i); then mv $(i)~ $(i);  fi && ) true
135
136 local-help: local-texinfo-help
137
138 local-texinfo-help:
139         @echo -e "\
140   info [out=www]  update Info documentation (use \`out=www' for having images)\n\
141   install-info [out=www]   install Info documentation (idem)\n\
142   texinfo-all-menus-update update node menus in Texinfo source files (use with caution)\n"
143