]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'release/unstable' into staging
authorGraham Percival <graham@percival-music.ca>
Mon, 16 Jan 2012 07:38:33 +0000 (07:38 +0000)
committerGraham Percival <graham@percival-music.ca>
Mon, 16 Jan 2012 07:38:33 +0000 (07:38 +0000)
GNUmakefile.in
python/book_base.py
python/book_latex.py
python/book_snippets.py
scripts/lilypond-book.py
stepmake/aclocal.m4

index d750eb2257dd0c93400b17899b3f399c14b90706..45e5bf7311457cd98bd64cdbef15f3ff07b60d57 100644 (file)
@@ -118,10 +118,26 @@ uninstall-WWW:
 # For both online and offline docs, issue `make doc WEB_TARGETS="offline online"'
 WEB_TARGETS = offline
 
-WWW-post:
+WEB_EXAMPLE_FILES = $(wildcard input/$(outdir)/*.ly) \
+                    $(wildcard input/*/$(outdir)/*.ly) \
+                    $(wildcard input/*/*/$(outdir)/*.ly)
+
+WEB_TRACKED_FILES = $(wildcard $(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}) \
+                    $(wildcard input/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}) \
+                    $(wildcard input/*/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}) \
+                    $(wildcard Documentation/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}) \
+                    $(wildcard Documentation/$(outdir)/*/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php})
+
+WWW-post: $(top-build-dir)/.htaccess $(outdir)/examples.html $(outdir)/offline-root/index.html
+
 # need UTF8 setting in case this is hosted on a website.
+$(top-build-dir)/.htaccess:
        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
+
+$(outdir)/examples.html: $(WEB_EXAMPLE_FILES)
        $(buildscript-dir)/mutopia-index -o $(outdir)/examples.html input/
+
+$(outdir)/offline-root/index.html: $(WEB_TRACKED_FILES)
        $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) "$(WEB_TARGETS)"
        find $(outdir)/offline-root -type l | xargs rm -f
 endif # ifeq ($(out),www)
@@ -150,16 +166,21 @@ src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
 
 doc-clean: snippets-clean $(tree-share-prefix)/lilypond-force
 
-default: $(config_h) build-dir-setup
+default: $(config_h) build-dir-setup build-scripts
 
 build-dir-setup: $(tree-share-prefix)/lilypond-force
 
+build-scripts:
+       $(MAKE) -C scripts/build
+
 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
 CATALOGS = $(HELP_CATALOGS:lilypond=)
 
-$(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION
 # Preparing LilyPond tree for build-dir exec
+link-tree: $(tree-share-prefix)/lilypond-force
+
+$(tree-share-prefix)/lilypond-force: GNUmakefile $(outdir)/VERSION
        cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
        mkdir -p $(tree-bin)
        mkdir -p $(tree-share-prefix)
@@ -202,7 +223,9 @@ $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION
                ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
        touch $(tree-share-prefix)/lilypond-force
 
-$(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
+link-mf-tree: $(tree-share-prefix)/mf-link-tree
+
+$(tree-share-prefix)/mf-link-tree: $(tree-share-prefix)/lilypond-force
        -rm -f $(tree-share-prefix)/fonts/otf/* &&  \
        rm -f $(tree-share-prefix)/fonts/svg/* &&  \
        rm -f $(tree-share-prefix)/fonts/fonts.conf &&  \
@@ -220,6 +243,7 @@ $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-fo
                ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
        -cd $(tree-share-prefix)/fonts/type1 && \
                ln -s ../../../../../../mf/$(outconfbase)/*.pf? .
+       touch $(tree-share-prefix)/mf-link-tree
 
 TAGS.make: dummy
        etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
index b43b9e00d4b4477b5ea2fe0f05eea0be9e3ae8f5..1d0d9eca990407f3671a03c54af143515eef295e 100644 (file)
@@ -14,9 +14,11 @@ error = ly.error
 # Helper functions
 ########################################################################
 
-def find_file (name, include_path, raise_error=True):
-    for i in include_path:
+def find_file (name, include_path, working_dir=None, raise_error=True):
+    current_path = working_dir or os.getcwd();
+    for i in [current_path] + include_path:
         full = os.path.join (i, name)
+        full = os.path.normpath (os.path.join (current_path, full))
         if os.path.exists (full):
             return full
 
@@ -149,7 +151,8 @@ class BookOutputFormat:
         return []
 
     def input_fullname (self, input_filename):
-        return find_file (input_filename, self.global_options.include_path)
+        return find_file (input_filename, self.global_options.include_path,
+            self.global_options.original_dir)
 
     def adjust_snippet_command (self, cmd):
         return cmd
index 591de34eea79f470d1594b8fd8cd7c627ffe2b1e..be7c4e18830c2b10a014c6f61e0a635c10ea7865 100644 (file)
@@ -125,7 +125,7 @@ Latex_output = {
   \expandafter\preLilyPondExample
 \fi
 \def\lilypondbook{}%%
-\input %(base)s-systems.tex
+\input{%(base)s-systems.tex}
 \ifx\postLilyPondExample \undefined
 \else
   \expandafter\postLilyPondExample
@@ -297,7 +297,7 @@ class BookLatexOutputFormat (BookBase.BookOutputFormat):
     def snippet_output (self, basename, snippet):
         str = ''
         rep = snippet.get_replacements ();
-        rep['base'] = basename
+        rep['base'] = basename.replace ('\\', '/')
         str += self.output_print_filename (basename, snippet)
         if VERBATIM in snippet.option_dict:
             rep['verb'] = snippet.verb_ly ()
index 5e6bc4e71eb51cf1b3e3f125a8c90a5e08b0b916..e5a43110ffa268ae6733d09e7c96dc768503ef61 100644 (file)
@@ -804,7 +804,8 @@ class LilypondFileSnippet (LilypondSnippet):
         LilypondSnippet.__init__ (self, type, match, formatter, line_number, global_options)
         self.filename = self.substring ('filename')
         self.ext = os.path.splitext (os.path.basename (self.filename))[1]
-        self.contents = file (BookBase.find_file (self.filename, global_options.include_path)).read ()
+        self.contents = file (BookBase.find_file (self.filename,
+            global_options.include_path, global_options.original_dir)).read ()
 
     def get_snippet_code (self):
         return self.contents;
index 9e5777284982a924aac8f74db7e76b22cb0e81f7..8847419fe0dc46e698e06873f7494e4bf0bae6f2 100644 (file)
@@ -143,7 +143,7 @@ def get_option_parser ():
     p.add_option ("-I", '--include', help=_ ("add DIR to include path"),
                   metavar=_ ("DIR"),
                   action='append', dest='include_path',
-                  default=[os.path.abspath (os.getcwd ())])
+                  default=[])
 
     p.add_option ('--info-images-dir',
                   help=_ ("format Texinfo output so that Info will "
@@ -616,8 +616,7 @@ def do_options ():
     (global_options, args) = opt_parser.parse_args ()
 
     global_options.information = {'program_version': ly.program_version, 'program_name': ly.program_name }
-
-    global_options.include_path =  map (os.path.abspath, global_options.include_path)
+    global_options.original_dir = original_dir
 
     # Load the python packages (containing e.g. custom formatter classes)
     # passed on the command line
@@ -667,7 +666,7 @@ def main ():
         if global_options.lily_output_dir:
             # This must be first, so lilypond prefers to read .ly
             # files in the other lybookdb dir.
-            includes = [os.path.abspath(global_options.lily_output_dir)] + includes
+            includes = [global_options.lily_output_dir] + includes
         global_options.process_cmd += ' '.join ([' -I %s' % ly.mkarg (p)
                                                  for p in includes])
 
@@ -713,7 +712,7 @@ def main ():
                      base_file_name + global_options.formatter.default_extension)
 
     os.chdir (original_dir)
-    file (dep_file, 'w').write ('%s: %s'
+    file (dep_file, 'w').write ('%s: %s\n'
                                 % (final_output_file, ' '.join (inputs)))
 
 if __name__ == '__main__':
index 8045c3ef0a4f3bb3b4b254deaadfba543a16a016..c60521ead3a3923f53e06d39d878957dc3f16c8d 100644 (file)
@@ -436,12 +436,13 @@ EOF
            done
        done
 
-       
+       rm -f GNUmakefile
        cat <<EOF > GNUmakefile
 depth = .
 include config\$(if \$(conf),-\$(conf),).make
 include \$(configure-srcdir)/GNUmakefile.in
 EOF
+       chmod 444 GNUmakefile
        AC_SUBST(VPATH)
     fi
 ])