Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(790)

Side by Side Diff: make/website.make

Issue 5244045: Makeify the website build. (Closed)
Patch Set: Created 12 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ################################################################ 1 ################################################################
2 # website (without the rest of the docs) 2 # website (without the rest of the docs)
3 3
4 ################################################################ 4 ################################################################
5 ##### SECURITY -- check these values for lilypond.org ######### 5 ##### SECURITY -- check these values for lilypond.org #########
6 ################################################################ 6 ################################################################
7 7
8 ifeq ($(WEBSITE_ONLY_BUILD),1) 8 ifeq ($(WEBSITE_ONLY_BUILD),1)
9 ### for lilypond.org 9 ### for lilypond.org
10 TOP_SRC_DIR=$(HOME)/lilypond/lilypond-git 10 TOP_SRC_DIR=$(HOME)/lilypond/lilypond-git
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #Nothing clever here - just allows the use of a boolean to control 47 #Nothing clever here - just allows the use of a boolean to control
48 # quiet running 48 # quiet running
49 quiet-run = true 49 quiet-run = true
50 ifeq ($(quiet-run),true) 50 ifeq ($(quiet-run),true)
51 quiet-flag=-q 51 quiet-flag=-q
52 endif 52 endif
53 53
54 ################################################################ 54 ################################################################
55 OUT=out-website 55 OUT=out-website
56 56
57 WEB_LANGS = $(shell MAKEWEB=1 $(PYTHON) $(top-src-dir)/python/langdefs.py) 57 WEB_LANGS := $(shell MAKEWEB=1 $(PYTHON) $(top-src-dir)/python/langdefs.py)
58 58
59 TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD $ (TEXI2HTML_PROGRAM) 59 TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD \
60 » $(TEXI2HTML_PROGRAM) -D web_version --prefix=index --split=section \
61 » » --init-file=$(texi2html-init-file) \
62 » » --I=$(dir $<) \
63 » » --I=$(top-src-dir)/Documentation \
64 » » --I=$(OUT) \
65 » » --output=$(dir $@)
60 66
61 EXTRACT_TEXI_FILENAMES=python $(script-dir)/extract_texi_filenames.py 67 EXTRACT_TEXI_FILENAMES=$(PYTHON) $(script-dir)/extract_texi_filenames.py $(quiet -flag) \
68 » --known-missing-files=$(top-src-dir)/scripts/build/website-known-missing -files.txt \
69 » » -I $(top-src-dir)/Documentation \
70 » » -I $(dir $<) \
71 » » -I $(OUT) \
72 » » -o $(OUT)
62 CREATE_VERSION=python $(script-dir)/create-version-itexi.py 73 CREATE_VERSION=python $(script-dir)/create-version-itexi.py
Graham Percival (old account) 2011/10/09 16:03:08 whoops, we're inconsistent in whether we use pytho
63 CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py 74 CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py
64 MASS_LINK=python $(script-dir)/mass-link.py 75 MASS_LINK=python $(script-dir)/mass-link.py
65 WEB_POST=python $(script-dir)/website_post.py 76 WEB_POST=python $(script-dir)/website_post.py
66 WEB_BIBS=python $(script-dir)/bib2texi.py 77 WEB_BIBS=python $(script-dir)/bib2texi.py
67 78
68 SERVER_FILES=$(top-src-dir)/Documentation/web/server 79 SERVER_FILES=$(top-src-dir)/Documentation/web/server
69 80
70 # don't include web 81 # don't include web
71 MANUALS=$(wildcard $(top-src-dir)/Documentation/*.tely) 82 MANUALS = $(MANUALS_TELY) $(MANUALS_TEXI) $(MANUALS_TRANSLATION)
72 MANUALS+=$(top-src-dir)/Documentation/contributor.texi 83 MANUALS_TELY := $(notdir $(wildcard $(top-src-dir)/Documentation/*.tely))
84 MANUALS_TEXI := contributor.texi
85
86 # Harvest the translated manuals.
87 # - Store each manual in a language-specific macro, e.g. when we find
88 # de/learning.tely we add learning.tely to MANUALS_de,
89 # - Store each manual with an added language suffix in MANUALS_TRANSLATION,
90 # e.g. learning.de.tely for the German learning manual.
91 $(eval $(foreach l,$(WEB_LANGS),\
92 » $(eval MANUALS_$(l) := $(notdir $(wildcard $(top-src-dir)/Documentation/ $(l)/*.tely))) \
93 » $(eval MANUALS_TRANSLATION += $(MANUALS_$(l):%.tely=%.$(l).tely)) \
94 ))
95
96 # The web.texi manuals, English and translated
97 MANUALS_WEB := web.texi $(WEB_LANGS:%=web.%.texi)
98
99 # The basename of all manuals (basename includes the language suffix)
100 MANUALS_BASE = $(basename $(MANUALS) $(MANUALS_WEB))
101
102
103 ###################
104 ### Generated files
105
106 bib-files = $(OUT)/others-did.itexi $(OUT)/we-wrote.itexi
Graham Percival (old account) 2011/10/09 16:03:08 we'll be able to remove the bib stuff once the dev
107
108 css-src-files := $(notdir $(wildcard $(top-src-dir)/Documentation/css/*.css))
109 css-files = $(css-src-files:%=$(OUT)/website/%)
110
111 example-src-files := $(notdir $(wildcard $(EXAMPLES)/*))
112 example-files = $(example-src-files:%=$(OUT)/website/ly-examples/%)
113
114 misc-files = $(OUT)/.htaccess \
115 $(OUT)/website/.htaccess \
116 $(OUT)/website/favicon.ico \
117 $(OUT)/website/robots.txt
118
119 picture-src-files := $(notdir $(wildcard $(PICTURES)/*))
120 picture-files = $(picture-src-files:%=$(OUT)/website/pictures/%)
121
122 post-files = $(OUT)/website/index.html
123
124 texinfo-files = $(OUT)/index.html $(WEB_LANGS:%=$(OUT)/%/index.html)
125
126 version-files = $(OUT)/version.itexi $(OUT)/weblinks.itexi
127
128 xref-files = $(MANUALS_BASE:%=$(OUT)/%.xref-map)
129
130
131 ###########
132 ### Targets
133
134 .PHONY: website website-bibs website-css website-examples website-misc \
135 website-pictures website-post website-test website-texinfo \
136 website-version website-xrefs
137
138 website: website-post website-examples website-pictures website-css website-misc
139
140 website-bibs: website-version $(OUT) $(bib-files)
141
142 website-css: $(OUT)/website $(css-files)
143
144 website-examples: $(OUT)/website/ly-examples $(example-files)
145
146 website-misc: $(OUT)/website $(misc-files)
147
148 website-pictures: $(OUT)/website/pictures $(OUT)/pictures $(picture-files)
149
150 website-post: website-texinfo $(post-files)
73 151
74 website-test: 152 website-test:
75 echo $(TEXI2HTML) 153 echo $(TEXI2HTML)
76 154
77 website-version: 155 website-texinfo: website-version website-xrefs website-bibs $(texinfo-files)
78 » mkdir -p $(OUT) 156
157 website-version: $(OUT) $(version-files)
158
159 website-xrefs: website-version $(OUT) $(xref-files)
160
161
162 #########
163 ### Rules
164
165 # Directories
166 $(OUT) $(OUT)/website $(OUT)/website/ly-examples $(OUT)/website/pictures: %:
167 » mkdir -p $@
168
169 $(OUT)/pictures: $(OUT)/website/pictures
170 » ln -sf website/pictures $(OUT)/pictures
171
172 # Generated itexi files
173 $(OUT)/version.itexi: #FIXME: add dependencies
79 $(CREATE_VERSION) $(top-src-dir) > $(OUT)/version.itexi 174 $(CREATE_VERSION) $(top-src-dir) > $(OUT)/version.itexi
175
176 $(OUT)/weblinks.itexi: #FIXME: add dependencies
80 $(CREATE_WEBLINKS) $(top-src-dir) > $(OUT)/weblinks.itexi 177 $(CREATE_WEBLINKS) $(top-src-dir) > $(OUT)/weblinks.itexi
81 178
82 website-xrefs: website-version 179 $(bib-files): $(OUT)/%.itexi: $(top-src-dir)/Documentation/web/%.bib
83 » for l in '' $(WEB_LANGS); do \
84 » » len="$${#l}" ; \
85 » » r="$$l"; \
86 » » if [ "$$len" -gt "0" ] ; then \
87 » » » r="$$r"/; \
88 » » fi ; \
89 » » $(EXTRACT_TEXI_FILENAMES) \
90 » » » -I $(top-src-dir)/Documentation \
91 » » » -I $(top-src-dir)/Documentation/"$$l" \
92 » » » -I $(OUT) -o $(OUT) --split=node \
93 » » » --known-missing-files=$(top-src-dir)/scripts/build/websi te-known-missing-files.txt \
94 » » » $(quiet-flag) \
95 » » » $(top-src-dir)/Documentation/"$$l"/web.texi ;\
96 » » for m in $(MANUALS); do \
97 » » » n=`echo "$$m" | sed 's/Documentation/Documentation\/'$$l '/'` ; \
98 » » » b=`basename "$$n" .texi`; \
99 » » » d=`basename "$$b" .tely`; \
100 » » » if [ -e "$$n" ] ; then \
101 » » » » $(EXTRACT_TEXI_FILENAMES) \
102 » » » » -I $(top-src-dir)/Documentation \
103 » » » » -I $(top-src-dir)/Documentation/"$$l" \
104 » » » » -I $(top-src-dir)/Documentation/"$$r""$$d" \
105 » » » » --known-missing-files=$(top-src-dir)/scripts/bui ld/website-known-missing-files.txt \
106 » » » $(quiet-flag) \
107 » » » » -I $(OUT) -o $(OUT) "$$n" ; \
108 » » » fi ; \
109 » » done; \
110 » done;
111
112 website-bibs: website-version
113 BSTINPUTS=$(top-src-dir)/Documentation/web \ 180 BSTINPUTS=$(top-src-dir)/Documentation/web \
114 $(WEB_BIBS) -s web \ 181 $(WEB_BIBS) -s web \
115 -s $(top-src-dir)/Documentation/lily-bib \ 182 -s $(top-src-dir)/Documentation/lily-bib \
116 » » -o $(OUT)/others-did.itexi \ 183 » » -o $@ \
117 $(quiet-flag) \ 184 $(quiet-flag) \
118 » » $(top-src-dir)/Documentation/web/others-did.bib 185 » » $<
119 » BSTINPUTS=$(top-src-dir)/Documentation/web \
120 » » $(WEB_BIBS) -s web \
121 » » -s $(top-src-dir)/Documentation/lily-bib \
122 » » -o $(OUT)/we-wrote.itexi \
123 » » $(quiet-flag) \
124 » » $(top-src-dir)/Documentation/web/we-wrote.bib
125 186
187 # Get xrefs for English tely manuals
188 $(MANUALS_TELY:%.tely=$(OUT)/%.xref-map): $(OUT)/%.xref-map: $(top-src-dir)/Docu mentation/%.tely
189 $(DO_TEXI_DEP) $(EXTRACT_TEXI_FILENAMES) $<
126 190
127 website-texinfo: website-version website-xrefs website-bibs 191 # Get xrefs for English texi manuals
128 » for l in '' $(WEB_LANGS); do \ 192 $(MANUALS_TEXI:%.texi=$(OUT)/%.xref-map): $(OUT)/%.xref-map: $(top-src-dir)/Docu mentation/%.texi
129 » if test -n "$$l"; then \ 193 » $(DO_TEXI_DEP) $(EXTRACT_TEXI_FILENAMES) $<
130 » » » langopt=--lang="$$l"; \
131 » » » langsuf=.$$l; \
132 » » fi; \
133 » » $(TEXI2HTML) --prefix=index \
134 » » » --split=section \
135 » » » --I=$(top-src-dir)/Documentation/"$$l" \
136 » » » --I=$(top-src-dir)/Documentation \
137 » » » --I=$(OUT) \
138 » » » $$langopt \
139 » » » --init-file=$(texi2html-init-file) \
140 » » » -D web_version \
141 » » » --output=$(OUT)/"$$l" \
142 » » » $(top-src-dir)/Documentation/"$$l"/web.texi ; \
143 » » 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/ ; \
144 » done
145 194
195 # Get xrefs for translated tely manuals
196 $(eval $(foreach l,$(WEB_LANGS),\
197 $(eval $(MANUALS_$(l):%.tely=$(OUT)/%.$(l).xref-map): $(OUT)/%.$(l).xref-map: $( top-src-dir)/Documentation/$(l)/%.tely; \
198 $$(DO_TEXI_DEP) $$(EXTRACT_TEXI_FILENAMES) $$< ) \
199 ))
146 200
147 website-css: 201 # Get xrefs for the English web.texi manual
148 » cp $(top-src-dir)/Documentation/css/*.css $(OUT)/website 202 $(OUT)/web.xref-map: $(top-src-dir)/Documentation/web.texi
203 » $(DO_TEXI_DEP) $(EXTRACT_TEXI_FILENAMES) --split=node $<
149 204
150 website-pictures: 205 # Get xrefs for translated web.texi manuals
151 » mkdir -p $(OUT)/website/pictures 206 $(OUT)/web.%.xref-map: $(top-src-dir)/Documentation/%/web.texi
152 » if [ -d $(PICTURES) ]; \ 207 » $(DO_TEXI_DEP) $(EXTRACT_TEXI_FILENAMES) --split=node $<
153 » then \
154 » » cp $(PICTURES)/* $(OUT)/website/pictures ; \
155 » » ln -sf website/pictures $(OUT)/pictures ;\
156 » fi
157 208
158 website-examples: 209 # Build the English website
159 » mkdir -p $(OUT)/website/ly-examples 210 $(OUT)/index.html: $(top-src-dir)/Documentation/web.texi
160 » if [ -d $(EXAMPLES) ]; \ 211 » $(DO_TEXI_DEP) $(TEXI2HTML) $<
161 » then \
162 » » cp $(EXAMPLES)/* $(OUT)/website/ly-examples ; \
163 » fi
164 212
165 web-post: 213 # Build translated websites
214 $(eval $(foreach l,$(WEB_LANGS),\
215 $(eval $(OUT)/$(l)/index.html: $(top-src-dir)/Documentation/$(l)/web.texi; \
216 » $$(DO_TEXI_DEP) $$(TEXI2HTML) --lang="$(l)" $$<; ) \
217 ))
218
219 # Website post-processing
220 $(OUT)/website/index.html: $(wildcard $(OUT)/*.html)
221 » ls $(OUT)/*.html | sed 's!$(OUT)/!!g' | xargs $(MASS_LINK) --prepend-suf fix="" hard $(OUT)/ $(OUT)/website/
222 » $(foreach l,$(WEB_LANGS), \
223 » » ls $(OUT)/$(l)/*.html | xargs grep -L 'UNTRANSLATED NODE: IGNORE ME' | sed 's!$(OUT)/$(l)/!!g' | xargs $(MASS_LINK) --prepend-suffix=".$(l)" har d $(OUT)/$(l)/ $(OUT)/website/; )
166 $(WEB_POST) $(OUT)/website 224 $(WEB_POST) $(OUT)/website
167 225
168 website: website-texinfo website-css website-pictures website-examples web-post 226 # Simple copy
169 » cp $(SERVER_FILES)/favicon.ico $(OUT)/website 227 $(css-files): $(OUT)/website/%: $(top-src-dir)/Documentation/css/%
170 » cp $(SERVER_FILES)/robots.txt $(OUT)/website 228 » cp $< $@
171 » cp $(top-htaccess) $(OUT)/.htaccess
172 » cp $(dir-htaccess) $(OUT)/website/.htaccess
173 229
230 $(example-files): $(OUT)/website/ly-examples/%: $(EXAMPLES)/%
231 cp $< $@
174 232
233 $(picture-files): $(OUT)/website/pictures/%: $(PICTURES)/%
234 cp $< $@
235
236 $(OUT)/website/favicon.ico: $(SERVER_FILES)/favicon.ico
237 cp $< $@
238
239 $(OUT)/website/robots.txt: $(SERVER_FILES)/robots.txt
240 cp $< $@
241
242 $(OUT)/.htaccess: $(top-htaccess)
243 cp $< $@
244
245 $(OUT)/website/.htaccess: $(dir-htaccess)
246 cp $< $@
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b