# 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)
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)
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 && \
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')
# 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
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
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 "
(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
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])
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__':