]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
remove slashes from compare-XXXX directory name
[lilypond.git] / GNUmakefile.in
1 # -*-Makefile-*-
2
3 depth = .
4
5 SUBDIRS = buildscripts python scripts \
6         flower lily \
7         mf ly \
8         tex ps scm \
9         po make \
10         elisp vim \
11         input \
12         stepmake $(documentation-dir)
13
14
15 ## this convoluted construction is necessary, since we don't know the
16 ## value of DOCUMENTATION here.
17 documentation-dir=$(if $(findstring no,$(DOCUMENTATION)),,Documentation)
18
19 SCRIPTS = configure autogen.sh 
20 README_FILES = COPYING DEDICATION ROADMAP THANKS HACKING
21 TOPDOC_FILES = AUTHORS README INSTALL NEWS
22 TOPDOC_TXT_FILES = $(addprefix $(top-build-dir)/Documentation/topdocs/$(outdir)/,$(addsuffix .txt,$(TOPDOC_FILES)))
23 IN_FILES := $(call src-wildcard,*.in)
24
25 EXTRA_DIST_FILES = VERSION .cvsignore .gitignore SConstruct \
26   $(README_FILES) $(SCRIPTS) $(IN_FILES) 
27 INSTALLATION_DIR=$(local_lilypond_datadir)
28 INSTALLATION_FILES=$(config_make) VERSION
29
30 # bootstrap stepmake:
31 #
32 STEPMAKE_TEMPLATES=toplevel po install
33 include $(depth)/make/stepmake.make
34
35 local-dist: dist-toplevel-txt-files dist-changelog
36
37 dist-changelog:
38         if  test -d $(top-src-dir)/.git ; then \
39                 cd $(top-src-dir) && git-whatchanged gub-2.9.29-2.. > $(distdir)/ChangeLog ; \
40         else \
41                 cp $(top-src-dir)/ChangeLog $(distdir) ; \
42         fi
43
44 default: $(outdir)/VERSION
45
46 $(outdir)/VERSION: $(config_make) VERSION
47         echo $(TOPLEVEL_VERSION) > $@
48
49 dist-toplevel-txt-files:
50         -mkdir -p $(distdir)
51         ln $(TOPDOC_TXT_FILES) $(distdir)/
52         ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
53
54 doc: 
55         $(MAKE) -C Documentation
56
57 install-WWW:
58         -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
59         cp -a $(outdir)/web-root/ $(DESTDIR)$(webdir)/
60
61         $(MAKE) -C Documentation/user local-install-WWW
62         $(MAKE) -C Documentation/user install-info
63
64 install-help2man:
65         $(MAKE) -C scripts man install-help2man
66         $(MAKE) -C lily man install-help2man
67
68 web-install:
69         $(MAKE) out=www install-WWW
70
71 uninstall-WWW:
72         echo TODO
73
74 web-uninstall:
75         $(MAKE) out=www uninstall-WWW
76
77 local-install:
78         $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
79
80 final-install:
81         @true
82
83 web-ext = html midi pdf png txt ly signature
84
85 # For docball, issue `make web CONTENT_NEGOTIATION='
86 CONTENT_NEGOTIATION = --content-negotiation
87 footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION) $(CONTENT_NEGOTIATION)
88 footifymail = MAILADDRESS='http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs'
89
90
91
92 local-WWW-post:
93 # need UTF8 setting in case this is hosted on a website. 
94         echo -e 'AddDefaultCharset utf-8\nAddCharset utf-8 .html\nAddCharset utf-8 .en\nAddCharset utf-8 .nl\nAddCharset utf-8 .txt\n' > $(top-build-dir)/.htaccess
95         $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html input/
96         echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/index.html">' > $(outdir)/index.html
97         echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
98
99         cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
100
101         cd $(top-build-dir) && find Documentation input \
102                 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
103                 | grep -v 'lily-[0-9a-f]*.*pdf' \
104                 | grep -v '/fr/' \
105                 > $(outdir)/weblist
106         ls $(outdir)/*.html >> $(outdir)/weblist
107
108 ## urg: this is too hairy, should write a python script to do this.
109
110 ## rewrite file names so we lose out-www
111         rm -rf $(outdir)/web-root/ 
112         mkdir $(outdir)/web-root/
113 ## urg slow.
114         cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf-  -T- ) | \
115                 tar -C $(outdir)/web-root/ -xf -  
116         for dir in $(outdir)/web-root/ ; do  \
117                 cd $$dir && \
118                 for a in `find . -name out-www`; do \
119                         rsync -a  --link-dest $$a/ $$a/ $$a/.. ; \
120                         rm -rf $$a ; \
121                 done \
122         done
123
124 tree-prefix = $(outdir)
125 tree-bin = $(tree-prefix)/bin
126 tree-lib = $(tree-prefix)/lib
127 tree-share = $(tree-prefix)/share
128 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
129 tree-share-prefix-current = $(tree-share)/lilypond/current
130 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
131 tree-lib-prefix-current = $(tree-lib)/lilypond/current
132
133 C_DIRS = flower lily
134 c-clean:
135         $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
136
137 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
138
139 web-clean:
140         $(MAKE) out=www clean
141         $(MAKE) $(tree-share-prefix)/lilypond-force
142
143 default: $(config_h) build-dir-setup 
144
145 build-dir-setup: $(tree-share-prefix)/lilypond-force
146
147 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
148 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
149 CATALOGS = $(HELP_CATALOGS:lilypond=) 
150
151 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION 
152 # Preparing LilyPond tree for build-dir exec
153         cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
154         mkdir -p $(tree-bin)
155         mkdir -p $(tree-share-prefix)
156         ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current)
157         mkdir -p $(tree-lib-prefix)
158         ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current)
159         mkdir -p $(tree-share-prefix)/elisp
160         mkdir -p $(tree-share-prefix)/fonts
161         mkdir -p $(tree-share-prefix)/fonts/otf
162         mkdir -p $(tree-share-prefix)/fonts/tfm
163         mkdir -p $(tree-share-prefix)/fonts/type1
164         mkdir -p $(tree-share-prefix)/fonts/svg
165         mkdir -p $(tree-share-prefix)/fonts/map
166         mkdir -p $(tree-share-prefix)/fonts/enc
167         mkdir -p $(tree-share-prefix)/tex
168         cd $(tree-bin) && \
169                 ln -sf ../../lily/$(outconfbase)/lilypond . && \
170                 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
171                         do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
172         cd $(tree-lib-prefix) && \
173                 ln -s ../../../../python/$(outconfbase) python
174         cd $(tree-share-prefix) && \
175                 ln -s $(top-src-dir)/ly ly && \
176                 ln -s ../../../../mf mf && \
177                 ln -s $(top-src-dir)/ps && \
178                 ln -s ../../../../python/$(outconfbase) python && \
179                 ln -s $(top-src-dir)/scm && \
180                 ln -s $(top-src-dir)/scripts scripts
181         cd $(tree-share-prefix)/tex && \
182                 ln -s $(top-src-dir)/tex source && \
183                 ln -s ../../../../../tex/$(outconfbase) tex-out && \
184                 ln -s ../../../../../mf/$(outconfbase) mf-out
185
186         cd $(tree-share-prefix)/fonts && \
187                 ln -s $(top-src-dir)/mf source && \
188                 true
189         -cd $(tree-share-prefix)/elisp && \
190                 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
191                 ln -s $(top-src-dir)/elisp/*.el .
192         $(foreach i,$(CATALOGS), \
193                 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
194                 cd $(tree-share)/locale/$i/LC_MESSAGES && \
195                 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
196         touch $(tree-share-prefix)/lilypond-force
197
198 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
199         -rm -f $(tree-share-prefix)/fonts/otf/* &&  \
200         rm -f $(tree-share-prefix)/fonts/svg/* &&  \
201         rm -f $(tree-share-prefix)/fonts/tfm/* &&  \
202         rm -f $(tree-share-prefix)/fonts/type1/* &&  \
203                 cd $(tree-share-prefix)/fonts/otf && \
204                 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
205         -cd $(tree-share-prefix)/fonts/svg && \
206                 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
207         -cd $(tree-share-prefix)/fonts/tfm && \
208                 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
209         -cd $(tree-share-prefix)/fonts/type1 && \
210                 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
211
212 TAGS.make: dummy
213         etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
214
215 $(config_h): config.hh.in
216 #
217 # this is to prevent people from getting
218 # undefined symbols  when we add them to config.h.in,
219 # and they blindly run "cvs update; make".
220 #
221         @echo
222         @echo ' *** $(config_h) is out of date'
223         @echo ' *** Remove it and rerun autogen:'
224         @echo '         rm $(config_h); ./autogen.sh'
225         @echo
226         @false