]> git.donarmstrong.com Git - lilypond.git/blob - make/website.make
Merge branch 'lilypond/translation' of ssh://thsoft@git.sv.gnu.org/srv/git/lilypond...
[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
8 ifeq ($(WEBSITE_ONLY_BUILD),1)
9   ### for lilypond.org
10   TOP_SRC_DIR=$(HOME)/lilypond/lilypond-git
11   TRUSTED_DIR=$(HOME)/lilypond/trusted-scripts
12   top-src-dir=$(TOP_SRC_DIR)
13   depth=.
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
22 else
23   ### for normal git
24   script-dir=$(top-src-dir)/scripts/build
25   texi2html-init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
26   top-htaccess=$(top-src-dir)/Documentation/web/server/lilypond.org.htaccess
27   dir-htaccess=$(top-src-dir)/Documentation/web/server/website-dir.htaccess
28   include $(config_make)
29   # I assume this is run from top-build-dir
30   EXAMPLES=Documentation/web/ly-examples/out-www
31   PICTURES=Documentation/pictures/out-www
32 endif
33
34 ################################################################
35 #The 4 lines below present an option to force make website to run
36 # quietly only when it is run as make -s website.  However, we've
37 # decided not to use this switch, and run the scripts quietly all
38 # the time
39 ################################################################
40 #quiet-run = $(findstring s, $(MAKEFLAGS))
41 #ifeq ($(quiet-run),s)
42 #  quiet-flag=-q
43 #endif
44
45 #Nothing clever here - just allows the use of a boolean to control
46 #  quiet running
47 quiet-run = true
48 ifeq ($(quiet-run),true)
49   quiet-flag=-q
50 endif
51
52
53
54 ################################################################
55 OUT=out-website
56
57 ### only update this when the language compiles correctly!
58 # LANGUAGES = (site, cs, de, es, fr, hu, it, ja, nl, zh)
59 #WEB_LANGS = de es fr hu it ja nl zh cs
60 WEB_LANGS = cs de es fr hu it ja nl zh
61
62 TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
63
64 EXTRACT_TEXI_FILENAMES=python $(script-dir)/extract_texi_filenames.py
65 CREATE_VERSION=python $(script-dir)/create-version-itexi.py
66 CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py
67 MASS_LINK=python $(script-dir)/mass-link.py
68 WEB_POST=python $(script-dir)/website_post.py
69 WEB_BIBS=python $(script-dir)/bib2texi.py
70
71 SERVER_FILES=$(top-src-dir)/Documentation/web/server
72
73 # don't include web
74 MANUALS=$(wildcard $(top-src-dir)/Documentation/*.tely)
75 MANUALS+=$(top-src-dir)/Documentation/contributor.texi
76
77 website-test:
78         echo $(TEXI2HTML)
79
80 website-version:
81         mkdir -p $(OUT)
82         $(CREATE_VERSION) $(top-src-dir) > $(OUT)/version.itexi
83         $(CREATE_WEBLINKS) $(top-src-dir) > $(OUT)/weblinks.itexi
84
85 website-xrefs: website-version
86         for l in '' $(WEB_LANGS); do \
87                 len="$${#l}" ; \
88                 r="$$l"; \
89                 if [ "$$len" -gt "0" ] ; then \
90                         r="$$r"/; \
91                 fi ; \
92                 $(EXTRACT_TEXI_FILENAMES) \
93                         -I $(top-src-dir)/Documentation \
94                         -I $(top-src-dir)/Documentation/"$$l" \
95                         -I $(OUT) -o $(OUT) --split=node \
96                         --known-missing-files=$(top-src-dir)/scripts/build/website-known-missing-files.txt \
97                         $(quiet-flag) \
98                         $(top-src-dir)/Documentation/"$$l"/web.texi ;\
99                 for m in $(MANUALS); do \
100                         n=`echo "$$m" | sed 's/Documentation/Documentation\/'$$l'/'` ; \
101                         b=`basename "$$n" .texi`; \
102                         d=`basename "$$b" .tely`; \
103                         if [ -e "$$n" ] ; then \
104                                 $(EXTRACT_TEXI_FILENAMES) \
105                                 -I $(top-src-dir)/Documentation \
106                                 -I $(top-src-dir)/Documentation/"$$l" \
107                                 -I $(top-src-dir)/Documentation/"$$r""$$d" \
108                                 --known-missing-files=$(top-src-dir)/scripts/build/website-known-missing-files.txt \
109                           $(quiet-flag) \
110                                 -I $(OUT) -o $(OUT) "$$n" ; \
111                         fi ; \
112                 done; \
113         done;
114
115 website-bibs: website-version
116         BSTINPUTS=$(top-src-dir)/Documentation/web \
117                 $(WEB_BIBS) -s web \
118                 -s $(top-src-dir)/Documentation/lily-bib \
119                 -o $(OUT)/others-did.itexi \
120                 $(quiet-flag) \
121                 $(top-src-dir)/Documentation/web/others-did.bib
122         BSTINPUTS=$(top-src-dir)/Documentation/web \
123                 $(WEB_BIBS) -s web \
124                 -s $(top-src-dir)/Documentation/lily-bib \
125                 -o $(OUT)/we-wrote.itexi \
126                 $(quiet-flag) \
127                 $(top-src-dir)/Documentation/web/we-wrote.bib
128
129
130 website-texinfo: website-version website-xrefs website-bibs
131         for l in '' $(WEB_LANGS); do \
132                 if test -n "$$l"; then \
133                         langopt=--lang="$$l"; \
134                         langsuf=.$$l; \
135                 fi; \
136                 $(TEXI2HTML) --prefix=index \
137                         --split=section \
138                         --I=$(top-src-dir)/Documentation/"$$l" \
139                         --I=$(top-src-dir)/Documentation \
140                         --I=$(OUT) \
141                         $$langopt \
142                         --init-file=$(texi2html-init-file) \
143                         -D web_version \
144                         --output=$(OUT)/"$$l" \
145                         $(top-src-dir)/Documentation/"$$l"/web.texi ; \
146                 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         done
148
149
150 website-css:
151         cp $(top-src-dir)/Documentation/css/*.css $(OUT)/website
152
153 website-pictures:
154         mkdir -p $(OUT)/website/pictures
155         if [ -d $(PICTURES) ]; \
156         then \
157                 cp $(PICTURES)/* $(OUT)/website/pictures ; \
158                 ln -sf website/pictures $(OUT)/pictures  ;\
159         fi
160
161 website-examples:
162         mkdir -p $(OUT)/website/ly-examples
163         if [ -d $(EXAMPLES) ]; \
164         then \
165                 cp $(EXAMPLES)/* $(OUT)/website/ly-examples ; \
166         fi
167
168 web-post:
169         $(WEB_POST) $(OUT)/website
170
171 website: website-texinfo website-css website-pictures website-examples web-post
172         cp $(SERVER_FILES)/favicon.ico $(OUT)/website
173         cp $(SERVER_FILES)/robots.txt $(OUT)/website
174         cp $(top-htaccess) $(OUT)/.htaccess
175         cp $(dir-htaccess) $(OUT)/website/.htaccess
176
177