1 ################################################################
2 # website (without the rest of the docs)
4 ################################################################
5 ##### SECURITY -- check these values for lilypond.org #########
6 ################################################################
8 ifeq ($(WEBSITE_ONLY_BUILD),1)
10 TOP_SRC_DIR=$(HOME)/lilypond/lilypond-git
11 TRUSTED_DIR=$(HOME)/lilypond/trusted-scripts
12 top-src-dir=$(TOP_SRC_DIR)
14 trusted-dir=$(TRUSTED_DIR)
15 script-dir=$(trusted-dir)
16 texi2html-init-file=$(trusted-dir)/lilypond-texi2html.init
17 top-htaccess=$(trusted-dir)/lilypond.org.htaccess
18 dir-htaccess=$(trusted-dir)/website-dir.htaccess
19 TEXI2HTML_PROGRAM=$(HOME)/usr/bin/texi2html
20 EXAMPLES=$(HOME)/lilypond/media/ly-examples
21 PICTURES=$(HOME)/lilypond/media/pictures
25 script-dir=$(top-src-dir)/scripts/build
26 texi2html-init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
27 top-htaccess=$(top-src-dir)/Documentation/web/server/lilypond.org.htaccess
28 dir-htaccess=$(top-src-dir)/Documentation/web/server/website-dir.htaccess
29 include $(config_make)
30 # I assume this is run from top-build-dir
31 EXAMPLES=Documentation/web/ly-examples/out-www
32 PICTURES=Documentation/pictures/out-www
35 ################################################################
36 #The 4 lines below present an option to force make website to run
37 # quietly only when it is run as make -s website. However, we've
38 # decided not to use this switch, and run the scripts quietly all
40 ################################################################
41 #quiet-run = $(findstring s, $(MAKEFLAGS))
42 #ifeq ($(quiet-run),s)
46 #Nothing clever here - just allows the use of a boolean to control
49 ifeq ($(quiet-run),true)
53 ################################################################
56 WEB_LANGS = $(shell MAKEWEB=1 $(PYTHON) $(top-src-dir)/python/langdefs.py)
58 TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
60 EXTRACT_TEXI_FILENAMES=python $(script-dir)/extract_texi_filenames.py
61 CREATE_VERSION=python $(script-dir)/create-version-itexi.py
62 CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py
63 MASS_LINK=python $(script-dir)/mass-link.py
64 WEB_POST=python $(script-dir)/website_post.py
65 WEB_BIBS=python $(script-dir)/bib2texi.py
67 SERVER_FILES=$(top-src-dir)/Documentation/web/server
70 MANUALS=$(wildcard $(top-src-dir)/Documentation/*.tely)
71 MANUALS+=$(top-src-dir)/Documentation/contributor.texi
78 $(CREATE_VERSION) $(top-src-dir) > $(OUT)/version.itexi
79 $(CREATE_WEBLINKS) $(top-src-dir) > $(OUT)/weblinks.itexi
81 website-xrefs: website-version
82 for l in '' $(WEB_LANGS); do \
85 if [ "$$len" -gt "0" ] ; then \
88 $(EXTRACT_TEXI_FILENAMES) \
89 -I $(top-src-dir)/Documentation \
90 -I $(top-src-dir)/Documentation/"$$l" \
91 -I $(OUT) -o $(OUT) --split=node \
92 --known-missing-files=$(top-src-dir)/scripts/build/website-known-missing-files.txt \
94 $(top-src-dir)/Documentation/"$$l"/web.texi ;\
95 for m in $(MANUALS); do \
96 n=`echo "$$m" | sed 's/Documentation/Documentation\/'$$l'/'` ; \
97 b=`basename "$$n" .texi`; \
98 d=`basename "$$b" .tely`; \
99 if [ -e "$$n" ] ; then \
100 $(EXTRACT_TEXI_FILENAMES) \
101 -I $(top-src-dir)/Documentation \
102 -I $(top-src-dir)/Documentation/"$$l" \
103 -I $(top-src-dir)/Documentation/"$$r""$$d" \
104 --known-missing-files=$(top-src-dir)/scripts/build/website-known-missing-files.txt \
106 -I $(OUT) -o $(OUT) "$$n" ; \
111 website-bibs: website-version
112 BSTINPUTS=$(top-src-dir)/Documentation/web \
114 -s $(top-src-dir)/Documentation/lily-bib \
115 -o $(OUT)/others-did.itexi \
117 $(top-src-dir)/Documentation/web/others-did.bib
118 BSTINPUTS=$(top-src-dir)/Documentation/web \
120 -s $(top-src-dir)/Documentation/lily-bib \
121 -o $(OUT)/we-wrote.itexi \
123 $(top-src-dir)/Documentation/web/we-wrote.bib
126 website-texinfo: website-version website-xrefs website-bibs
127 for l in '' $(WEB_LANGS); do \
128 if test -n "$$l"; then \
129 langopt=--lang="$$l"; \
132 $(TEXI2HTML) --prefix=index \
134 --I=$(top-src-dir)/Documentation/"$$l" \
135 --I=$(top-src-dir)/Documentation \
138 --init-file=$(texi2html-init-file) \
140 --output=$(OUT)/"$$l" \
141 $(top-src-dir)/Documentation/"$$l"/web.texi ; \
142 ls $(OUT)/$$l/*.html | xargs grep -L 'UNTRANSLATED NODE: IGNORE ME' | sed 's!$(OUT)/'$$l'/!!g' | xargs $(MASS_LINK) --prepend-suffix="$$langsuf" hard $(OUT)/$$l/ $(OUT)/website/ ; \
147 cp $(top-src-dir)/Documentation/css/*.css $(OUT)/website
150 mkdir -p $(OUT)/website/pictures
151 if [ -d $(PICTURES) ]; \
153 cp $(PICTURES)/* $(OUT)/website/pictures ; \
154 ln -sf website/pictures $(OUT)/pictures ;\
158 mkdir -p $(OUT)/website/ly-examples
159 if [ -d $(EXAMPLES) ]; \
161 cp $(EXAMPLES)/* $(OUT)/website/ly-examples ; \
165 $(WEB_POST) $(OUT)/website
167 website: website-texinfo website-css website-pictures website-examples web-post
168 cp $(SERVER_FILES)/favicon.ico $(OUT)/website
169 cp $(SERVER_FILES)/robots.txt $(OUT)/website
170 cp $(top-htaccess) $(OUT)/.htaccess
171 cp $(dir-htaccess) $(OUT)/website/.htaccess