]> git.donarmstrong.com Git - lilypond.git/blob - make/website.make
02ff0da62c9e7597cdd55270047c0903b1624061
[lilypond.git] / make / website.make
1 ################################################################
2 # website (without the rest of the docs)
3
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)/lilypond/lilypond-git
10   TRUSTED_DIR=$(HOME)/lilypond/trusted-scripts
11   top-src-dir=$(TOP_SRC_DIR)
12   depth=.
13   trusted-dir=$(TRUSTED_DIR)
14   script-dir=$(trusted-dir)
15   texi2html-init-file=$(trusted-dir)/lilypond-texi2html.init
16   top-htaccess=$(trusted-dir)/lilypond.org.htaccess
17   dir-htaccess=$(trusted-dir)/website-dir.htaccess
18   TEXI2HTML_PROGRAM=$(HOME)/usr/bin/texi2html
19   EXAMPLES=$(HOME)/lilypond/media/ly-examples/
20   PICTURES=$(HOME)/lilypond/media/pictures
21 else
22   ### for normal git
23   script-dir=$(top-src-dir)/scripts/build/
24   texi2html-init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
25   top-htaccess=$(top-src-dir)/Documentation/web/server/lilypond.org.htaccess
26   dir-htaccess=$(top-src-dir)/Documentation/web/server/website-dir.htaccess
27   include $(config_make)
28   # I assume this is run from top-build-dir
29   EXAMPLES=Documentation/web/ly-examples/out-www/
30   PICTURES=Documentation/pictures/out-www/
31 endif
32
33
34 ################################################################
35 OUT=out-website
36
37 ### only update this when the language compiles correctly!
38 # LANGUAGES = (site, de, es, fr, hu, it, ja, nl)
39 WEB_LANGS = es fr it nl de hu ja
40
41 TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
42
43 EXTRACT_TEXI_FILENAMES=python $(script-dir)/extract_texi_filenames.py
44 CREATE_VERSION=python $(script-dir)/create-version-itexi.py
45 CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py
46 MASS_LINK=python $(script-dir)/mass-link.py
47 WEB_POST=python $(script-dir)/website_post.py
48 WEB_BIBS=python $(script-dir)/bib2texi.py
49
50 SERVER_FILES=$(top-src-dir)/Documentation/web/server/
51
52 # don't include web
53 MANUALS=$(wildcard $(top-src-dir)/Documentation/*.tely)
54 MANUALS+=$(top-src-dir)/Documentation/contributor.texi
55
56 website-test:
57         echo $(TEXI2HTML)
58
59 website-version:
60         mkdir -p $(OUT)
61         $(CREATE_VERSION) $(top-src-dir) > $(OUT)/version.itexi
62         $(CREATE_WEBLINKS) $(top-src-dir) > $(OUT)/weblinks.itexi
63
64 website-xrefs: website-version
65         for l in '' $(WEB_LANGS); do \
66                 $(EXTRACT_TEXI_FILENAMES) \
67                         -I $(top-src-dir)/Documentation/ \
68                         -I $(top-src-dir)/Documentation/"$$l" \
69                         -I $(OUT) -o $(OUT) --split=node \
70                         $(top-src-dir)/Documentation/"$$l"/web.texi ;\
71                 for m in $(MANUALS); do \
72                         n=`echo "$$m" | sed 's/Documentation/Documentation\/'$$l'/'` ; \
73                         b=`basename "$$n" .texi`; \
74                         d=`basename "$$b" .tely`; \
75                         if [ -e "$$n" ] ; then \
76                                 $(EXTRACT_TEXI_FILENAMES) \
77                                 -I $(top-src-dir)/Documentation/ \
78                                 -I $(top-src-dir)/Documentation/"$$l" \
79                                 -I $(top-src-dir)/Documentation/"$$l"/"$$d"/ \
80                                 -I $(OUT) -o $(OUT) "$$n" ; \
81                         fi ; \
82                 done; \
83         done;
84
85 website-bibs: website-version
86         BSTINPUTS=$(top-src-dir)/Documentation/web/ \
87                 $(WEB_BIBS) -s web \
88                 -o $(OUT)/others-did.itexi \
89                 $(top-src-dir)/Documentation/web/others-did.bib
90         BSTINPUTS=$(top-src-dir)/Documentation/web/ \
91                 $(WEB_BIBS) -s web \
92                 -o $(OUT)/we-wrote.itexi \
93                 $(top-src-dir)/Documentation/web/we-wrote.bib
94
95
96 website-texinfo: website-version website-xrefs website-bibs
97         for l in '' $(WEB_LANGS); do \
98                 if test -n "$$l"; then \
99                         langopt=--lang="$$l"; \
100                         langsuf=.$$l; \
101                 fi; \
102                 $(TEXI2HTML) --prefix=index \
103                         --split=section \
104                         --I=$(top-src-dir)/Documentation/"$$l" \
105                         --I=$(top-src-dir)/Documentation/ \
106                         --I=$(OUT) \
107                         $$langopt \
108                         --init-file=$(texi2html-init-file) \
109                         -D web_version \
110                         --output=$(OUT)/"$$l" \
111                         $(top-src-dir)/Documentation/"$$l"/web.texi ; \
112                 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/ ; \
113         done
114
115
116 website-css:
117         cp $(top-src-dir)/Documentation/css/*.css $(OUT)/website/
118
119 website-pictures:
120         mkdir -p $(OUT)/website/pictures/
121         cp $(PICTURES)/* $(OUT)/website/pictures/
122         ln -sf website/pictures $(OUT)/pictures
123
124 website-examples:
125         mkdir -p $(OUT)/website/ly-examples
126         cp $(EXAMPLES)/* $(OUT)/website/ly-examples
127
128 web-post:
129         $(WEB_POST) $(OUT)/website/
130
131 website: website-texinfo website-css website-pictures website-examples web-post
132         cp $(SERVER_FILES)/favicon.ico $(OUT)/website/
133         cp $(SERVER_FILES)/robots.txt $(OUT)/website/
134         cp $(top-htaccess) $(OUT)/.htaccess
135         cp $(dir-htaccess) $(OUT)/website/.htaccess
136
137