Protect SCM members in Instrument_name_engraver/Instrument_switch_engraver.
[lilypond/mpolesky.git] / website.make
blob3170bc6f6a68afe8dfdf0b78db5d6b52f0e0b05e
1 ################################################################
2 # website (without the rest of the docs)
4 ################################################################
5 ##### SECURITY -- check these values for lilypond.org #########
6 ################################################################
7 ifeq ($(WEBSITE_ONLY_BUILD),1)
8 ### for lilypond.org
9 top-src-dir=$(HOME)/src/lilypond
10 depth=.
11 trusted-dir=$(HOME)/lilypond/trusted-scripts
12 script-dir=$(trusted-dir)
13 texi2html-init-file=$(trusted-dir)/lilypond-texi2html.init
14 TEXI2HTML_PROGRAM=$(HOME)/usr/bin/texi2html
15 EXAMPLES=$(HOME)/media/ly-examples/
16 PICTURES=$(HOME)/media/pictures
17 else
18 ### for normal git
19 script-dir=$(top-src-dir)/scripts/build/
20 texi2html-init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
21 include $(config_make)
22 # I assume this is run from top-build-dir
23 EXAMPLES=Documentation/web/ly-examples/out-www/
24 PICTURES=Documentation/pictures/out-www/
25 endif
28 ################################################################
29 OUT=out-website
30 WEB_LANGS=es fr
33 TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
35 EXTRACT_TEXI_FILENAMES=python $(script-dir)/extract_texi_filenames.py
36 CREATE_VERSION=python $(script-dir)/create-version-itexi.py
37 CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py
38 MASS_LINK=python $(script-dir)/mass-link.py
40 SERVER_FILES=$(top-src-dir)/Documentation/web/server/
42 # don't include web
43 MANUALS=$(wildcard $(top-src-dir)/Documentation/*.tely)
44 MANUALS+=$(top-src-dir)/Documentation/contributor.texi
46 website-test:
47 echo $(TEXI2HTML)
49 website-version:
50 mkdir -p $(OUT)
51 $(CREATE_VERSION) $(top-src-dir) > $(OUT)/version.itexi
52 $(CREATE_WEBLINKS) $(top-src-dir) > $(OUT)/weblinks.itexi
54 website-xrefs: website-version
55 $(EXTRACT_TEXI_FILENAMES) -I $(top-src-dir)/Documentation/ \
56 -I $(OUT) -o $(OUT) --split=node \
57 $(top-src-dir)/Documentation/web.texi
58 $(foreach manual, $(MANUALS), \
59 $(EXTRACT_TEXI_FILENAMES) -I $(top-src-dir)/Documentation/ \
60 -I $(OUT) -o $(OUT) $(manual) && ) :
61 # translations
62 for l in $(WEB_LANGS); do \
63 $(EXTRACT_TEXI_FILENAMES) \
64 -I $(top-src-dir)/Documentation/"$$l" \
65 -I $(OUT) -o $(OUT) --split=node \
66 $(top-src-dir)/Documentation/"$$l"/web.texi ;\
67 done;
70 website-texinfo: website-version website-xrefs
71 $(TEXI2HTML) --prefix=index \
72 --split=section \
73 --I=$(top-src-dir)/Documentation/ \
74 --I=$(OUT) \
75 --init-file=$(texi2html-init-file) \
76 -D web_version \
77 --output=$(OUT)/website/ \
78 $(top-src-dir)/Documentation/web.texi
79 # translations
80 for l in $(WEB_LANGS); do \
81 $(TEXI2HTML) --prefix=index \
82 --split=section \
83 --I=$(top-src-dir)/Documentation/"$$l" \
84 --I=$(top-src-dir)/Documentation/ \
85 --I=$(OUT) \
86 --lang="$$l" \
87 --init-file=$(texi2html-init-file) \
88 -D web_version \
89 --output=$(OUT)/"$$l" \
90 $(top-src-dir)/Documentation/"$$l"/web.texi ; \
91 find $(OUT)/$$l/ -name '*.html' | xargs grep -L 'UNTRANSLATED NODE: IGNORE ME' | sed 's!$(OUT)/'$$l'/!!g' | xargs $(MASS_LINK) --prepend-suffix .$$l hard $(OUT)/$$l/ $(OUT)/website/ ; \
92 done
95 website-css:
96 cp $(top-src-dir)/Documentation/css/*.css $(OUT)/website/
98 website-pictures:
99 mkdir -p $(OUT)/website/pictures/
100 cp $(PICTURES)/* $(OUT)/website/pictures/
101 ln -sf website/pictures $(OUT)/pictures
103 website-examples:
104 mkdir -p $(OUT)/website/ly-examples
105 cp $(EXAMPLES)/* $(OUT)/website/ly-examples
107 website: website-texinfo website-css website-pictures website-examples
108 cp $(SERVER_FILES)/favicon.ico $(OUT)/website/
109 cp $(SERVER_FILES)/lilypond.org.htaccess $(OUT)/website/.htaccess
110 cp $(SERVER_FILES)/robots.txt $(OUT)/website/