]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/contributor/build-notes.itexi
Update CG with website build and bug squad
[lilypond.git] / Documentation / contributor / build-notes.itexi
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3
4 @node Build system notes
5 @chapter Build system notes
6
7 @warning{This chapter is in high flux, and is being run in a
8 @qq{wiki-like} fashion.  Do not trust anything you read in this
9 chapter.}
10
11 @menu
12 * Build system overview::
13 * Tips for working on the build system::
14 * General build system notes::
15 * Doc build::
16 * Website build::
17 * Building an Ubuntu distro::
18 @end menu
19
20
21 @node Build system overview
22 @section Build system overview
23
24 Build system is currently GNU make, with an extra "stepmake" layer
25 on top.  Look at files in @file{make/} and @file{stepmake/} and
26 all @file{GNUmakefile}s.
27
28 There is wide-spread dissatisfaction with this system, and we are
29 considering changing.  This would be a huge undertaking (estimated
30 200+ hours).  This change will probably involve not using GNU make
31 any more -- but a discussion about the precise build system will
32 have to wait.  Before we reach that point, we need to figure out
33 (at least approximately) what the current build system does.
34
35 Fundamentally, a build system does two things:
36
37 @enumerate
38 @item
39 Constructs command-line commands, for example:
40
41 @example
42 lilypond-book \
43   --tons --of --options \
44   pitches.itely
45 texi2pdf \
46   --more --imperial --and --metric --tons --of --options \
47   pitches.texi
48 @end example
49
50 @item
51 If there was a previous build, it decides which parts of the
52 system need to be rebuilt.
53
54 @end enumerate
55
56 When I try to do anything in the build system, it helps to remind
57 myself of this.  The "end result" is just a series of command-line
58 commands.  All the black magick is just an attempt to construct
59 those commands.
60
61 @node Tips for working on the build system
62 @section Tips for working on the build system
63
64 @itemize
65 @item
66 Add:
67
68 @example
69 echo "aaa"
70
71 echo "bbb"
72 @end example
73
74 to the build system files in various places.  This will let you
75 track where the program is, in various points of the build.
76
77 PH note.  There are lots of places where Make doesn't let you put
78 echo commands.  My top tip for tracing how make runs is to put
79
80 @example
81 $(error Some Text to display)
82 @end example
83
84 This will stop make running and print the text @code{Some Text to
85 display}.
86
87 End PH note.
88
89 @item
90 First task: understand how @code{make website} works,
91 @emph{without} the translations.  Looking at the english-only
92 website is the best introduction to the build system... it only
93 covers about 5% of the whole thing, but even that will likely take
94 10 hours or more.
95
96 @end itemize
97
98
99 @node General build system notes
100 @section General build system notes
101
102 @menu
103 * How stepmake works::
104 @end menu
105
106 @node How stepmake works
107 @subsection How stepmake works
108
109 Typing make website runs the file @file{GNUmakefile} from the
110 build directory.  This only contains 3 lines:
111
112 @example
113 depth = .
114 include config$(if $(conf),-$(conf),).make
115 include $(configure-srcdir)/GNUmakefile.in
116 @end example
117
118 The variable @code{depth} is used throughout the make system to
119 track how far down the directory structure the make is.  The first
120 include sets lots of variables but doesn't "do" anything.  The
121 second runs the file @file{GNUmakefile.in} from the top level
122 source directory.
123
124 This sets another load of variables, and then includes (i.e.
125 immediately runs) @file{stepmake.make} from the @file{make}
126 subdirectory.  This sets a load of other variables, does some
127 testing to see if SCONS (another build tool?) is being used, and
128 then runs @file{make/config.make} - which doesn't seem to exist...
129
130 GP: scons is indeed a different build tool; I think that Jan
131 experimented with it 5 years ago or something.  It seems like we
132 still have bits and pieces of it floating around.
133
134 Next, it runs @file{make/toplevel-version.make}, which sets the
135 version variables for major, minor, patch, stable, development and
136 mypatchlevel (which seems to be used for patch numbers for
137 non-stable versions only?).
138
139 Next - @file{make/local.make}, which doesn't exist.
140
141 Then a few more variable and the interesting comment:
142
143 @example
144 # Don't try to outsmart us, you puny computer!
145 # Well, UGH.  This only removes builtin rules from
146 @end example
147
148 and then tests to see whether BUILTINS_REMOVED is defined.  It
149 appears to be when I run make, and so
150 @file{stepmake/stepmake/no-builtin-rules.make} is run.  The
151 comment at the head of this file says:
152
153 @example
154 # UGH.  GNU make comes with implicit rules.
155 # We don't want any of them, and can't force users to run
156 # --no-builtin-rules
157 @end example
158
159 I've not studied that file at length, but assume it removes all
160 make's build-in rules (e.g. @file{*.c} files are run through the
161 GNU C compiler) - there's a lot of them in here, and a lot of
162 comments, and I'd guess most of it isn't needed.
163
164 We return to @file{stepmake.make}, where we hit the make rule all:
165 The first line of this is:
166
167 @smallexample
168 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
169 @end smallexample
170
171 which, when the variables are substituted, gives:
172
173 @example
174 ./make/generic-inclusions.make
175 ./make/lilypond-inclusions.make.
176 @end example
177
178 (Note - according to the make documentation, -include is only
179 different from include in that it doesn't produce any kind of
180 error message when the included file doesn't exist).
181
182 And the first file doesn't exist.  Nor the second.  Next:
183
184 @smallexample
185 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
186 @end smallexample
187
188 which expands to the following files:
189
190 @example
191 /home/phil/lilypond-git/stepmake/stepmake/generic-inclusions.make
192 /home/phil/lilypond-git/stepmake/stepmake/toplevel-inclusions.make
193 /home/phil/lilypond-git/stepmake/stepmake/po-inclusions.make
194 /home/phil/lilypond-git/stepmake/stepmake/install-inclusions.make.
195 @end example
196
197 One little feature to notice here - these are all absolute file
198 locations - the line prior to this used relative locations.  And
199 none of these files exist, either.  (Further note - I'm assuming
200 all these lines of make I'm following are autogenerated, but
201 that'll be something else to discover.)
202
203 Next in @file{stepmake.make}:
204
205 @smallexample
206 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
207 @end smallexample
208
209 which expands to:
210
211 @example
212 /home/phil/lilypond-git/stepmake/stepmake/generic-vars.make
213 /home/phil/lilypond-git/stepmake/stepmake/toplevel-vars.make
214 /home/phil/lilypond-git/stepmake/stepmake/po-vars.make
215 /home/phil/lilypond-git/stepmake/stepmake/install-vars.make.
216 @end example
217
218 Woo.  They all exist (they should as there's no - in front of the
219 include).  @file{generic-vars.make} sets loads of variables
220 (funnily enough).  @file{toplevel-vars.make} is very short - one
221 line commented as @code{# override Generic_vars.make:} and 2 as
222 follows:
223
224 @example
225 # urg?
226 include $(stepdir)/documentation-vars.make
227 @end example
228
229 I assume the urg comment refers to the fact that this should
230 really just create more variables, but it actually sends us off to
231 @file{/home/phil/lilypond-git/stepmake/stepmake/documentation-vars.make}.
232
233 That file is a 3 line variable setting one.
234
235 @file{po-vars.make} has the one-line comment @code{# empty}, as
236 does @file{install-vars.make}.
237
238 So now we're back to @file{stepmake.make}.
239
240 The next lines are
241 :
242 @smallexample
243 # ugh. need to do this because of PATH :=$(top-src-dir)/..:$(PATH)
244 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES)))
245 @end smallexample
246
247 and the include expands to:
248
249 @example
250 include ./make/generic-vars.make ./make/lilypond-vars.make.
251 @end example
252
253 These again set variables, and in some cases export them to allow
254 child @code{make} processes to use them.
255
256 The final 4 lines of @file{stepmake.make} are:
257
258 @smallexample
259 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES)))
260 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES)))
261 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES)))
262 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES)))
263 @end smallexample
264
265 which expand as follows:
266
267 @example
268 include ./make/generic-rules.make ./make/lilypond-rules.make
269 include
270   /home/phil/lilypond-git/stepmake/stepmake/generic-rules.make
271   /home/phil/lilypond-git/stepmake/stepmake/toplevel-rules.make
272   /home/phil/lilypond-git/stepmake/stepmake/po-rules.make
273   /home/phil/lilypond-git/stepmake/stepmake/install-rules.make
274 include ./make/generic-targets.make ./make/lilypond-targets.make
275 include
276   /home/phil/lilypond-git/stepmake/stepmake/generic-targets.make
277   /home/phil/lilypond-git/stepmake/stepmake/toplevel-targets.make
278   /home/phil/lilypond-git/stepmake/stepmake/po-targets.make
279   /home/phil/lilypond-git/stepmake/stepmake/install-targets.make
280 @end example
281
282 @file{lilypond-rules.make} is @code{#empty}
283
284 @file{generic-rules.make} does seem to have 2 rules in it.  They
285 are:
286
287 @example
288 $(outdir)/%.ly: %.lym4
289         $(M4) $< | sed "s/\`/,/g" > $@
290
291 $(outdir)/%: %.in
292         rm -f $@
293         cat $< | sed $(sed-atfiles) | sed $(sed-atvariables) > $@
294 @end example
295
296 I believe the first rule is for *.ly files, and has a prerequisite
297 that *.lym4 files must be built first.  The recipe is @code{m4  |
298 sed "s/\`/,/g" >}.  Perhaps someone with more Unix/make knowledge
299 can comment on exactly what the rules mean/do.
300
301 @file{toplevel-rules.make} is @code{#empty}
302
303 @file{po-rules.make} is @code{#empty}
304
305 @file{install-rules.make} is @code{#empty}
306
307 @file{generic-targets.make} contains 2 lines of comments.
308
309 @file{lilypond-targets.make} contains only:
310
311 @example
312 ## TODO: fail dist or web if no \version present.
313 check-version:
314         grep -L version $(LY_FILES)
315 @end example
316
317 @file{stepmake/generic-targets.make} contains lots of rules - too
318 many to list here - it seems to be the main file for rules. (FWIW
319 I haven't actually found a rule for website: anywhere, although
320 it clearly exists.  I have also found that you can display a rule
321 in the terminal by typing, say @code{make -n website}.  This is
322 probably common knowledge.
323
324 @file{stepmake/toplevel-targets.make} adds a load of other (and
325 occasionally the same) rules to the gernric-targets.
326
327 @file{stepmake/po-targets.make} is rules for po* makes.
328
329 @file{stepmake/install-targets.make} has rules for local-install*.
330
331 And that's the end of stepmake.make.  Back to
332 @file{GNUmakefile.in}.
333
334 A bit more info from 27 March.  I've put some error traces into
335 @code{GNUmakefile} in the build directory, and it looks like the
336 following lines actually cause the make to run (putting an error
337 call above them - no make; below them - make):
338
339 @smallexample
340 ifeq ($(out),www)
341 # All web targets, except info image symlinks and info docs are
342 # installed in non-recursing target from TOP-SRC-DIR
343 install-WWW:
344         -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
345         rsync -rl --exclude='*.signature' $(outdir)/offline-root $(DESTDIR)$(webdir)
346         $(MAKE) -C Documentation omf-local-install
347 @end smallexample
348
349 I don't currently understand the @code{ifeq}, since @code{$(out)}
350 is empty at this point, but the line starting @w{@code{-$(INSTALL)}}
351 translates to:
352
353 @example
354 -/usr/bin/python /home/phil/lilypond-git/stepmake/bin/install.py \
355   -c -m 755 -d /usr/local/share/doc/lilypond/html
356 @end example
357
358 End of work for Sunday 27th.
359
360 Another alterative approach to understanding the website build
361 would be to redirect @code{make -n website} and @code{make website}
362 to a text file and work through a) what it does and b) where the
363 errors are occurring.
364
365 GP: wow, all the above is much more complicated than I've ever
366 looked at stuff -- I tend to do a "back first" approach (where I
367 begin from the command-line that I want to modify, figure out
368 where it's generated, and then figure out how to change the
369 generated command-line), rather than a "front first" (where you
370 begin from the "make" command).
371
372
373 @node Doc build
374 @section Doc build
375
376 @menu
377 * The function of make doc::
378 * Building a bibliography::
379 @end menu
380
381 @node The function of make doc
382 @subsection The function of make doc
383
384 The following is a set of notes on how make doc functions.
385
386 Preliminary question to be answered some time: where do all the
387 GNUmakefiles come from.  They're in the build directory, but this
388 is not part of source.  Must be the configure script.  And it
389 looks like this comes from autogen.sh.  Must at some point kill
390 the whole git directory, repull and see what is created when.
391
392 Anyway, here's how make doc progresses:
393
394 This is the build dependency tree from
395 @file{stepmake/stepmake/generic-targets.make}:
396
397 @example
398 doc: doc-stage-1
399   doc-stage-1:
400         $(MAKE) -C $(depth)/scripts/build out=
401         $(MAKE) out=www WWW-1
402           WWW-1: local-WWW-1
403         $(LOOP)
404           $(MAKE) out=www WWW-2
405           WWW-2: local-WWW-2
406             $(LOOP)
407           $(MAKE) out=www WWW-post
408 @end example
409
410 @example
411 MAKE = make --no-builtin-rules
412 -C = Change to directory before make
413 @end example
414
415 doc-stage-1 does lots of opening and looking in files, but no
416 processing.
417
418 @example
419 Variable LOOP =
420
421 + make PACKAGE=LILYPOND package=lilypond -C python
422 && make PACKAGE=LILYPOND package=lilypond -C scripts
423 &&  make PACKAGE=LILYPOND package=lilypond -C flower
424 &&  make PACKAGE=LILYPOND package=lilypond -C lily
425 &&  make PACKAGE=LILYPOND package=lilypond -C mf
426 &&  make PACKAGE=LILYPOND package=lilypond -C ly
427 &&  make PACKAGE=LILYPOND package=lilypond -C tex
428 &&  make PACKAGE=LILYPOND package=lilypond -C ps
429 &&  make PACKAGE=LILYPOND package=lilypond -C scm
430 &&  make PACKAGE=LILYPOND package=lilypond -C po
431 &&  make PACKAGE=LILYPOND package=lilypond -C make
432 &&  make PACKAGE=LILYPOND package=lilypond -C elisp
433 &&  make PACKAGE=LILYPOND package=lilypond -C vim
434 &&  make PACKAGE=LILYPOND package=lilypond -C input
435 &&  make PACKAGE=LILYPOND package=lilypond -C stepmake
436 &&  make PACKAGE=LILYPOND package=lilypond -C Documentation
437 && true
438 @end example
439
440 From git grep:
441
442 stepmake/stepmake/generic-vars.make has this:
443
444 @smallexample
445 LOOP=+$(foreach i, $(SUBDIRS), $(MAKE) PACKAGE=$(PACKAGE) package=$(package) -C $(i) $@ &&) true
446 @end smallexample
447
448 $@ is the name of the target - WWW-1 in this case.
449
450 In GNUmakefile.in we find:
451
452 @example
453 SUBDIRS = python scripts \
454         flower lily \
455         mf ly \
456         tex ps scm \
457         po make \
458         elisp vim \
459         input \
460         stepmake $(documentation-dir)
461 @end example
462
463 So that's how we get the main make loop...
464
465 That loop expands like this:
466
467 @example
468 make PACKAGE=LILYPOND package=lilypond -C python WWW-1 &&
469 make PACKAGE=LILYPOND package=lilypond -C scripts WWW-1 &&
470 make PACKAGE=LILYPOND package=lilypond -C flower WWW-1 &&
471 make PACKAGE=LILYPOND package=lilypond -C lily WWW-1 &&
472 make PACKAGE=LILYPOND package=lilypond -C mf WWW-1 &&
473 make PACKAGE=LILYPOND package=lilypond -C ly WWW-1 &&
474 make PACKAGE=LILYPOND package=lilypond -C tex WWW-1 &&
475 make PACKAGE=LILYPOND package=lilypond -C ps WWW-1 &&
476 make PACKAGE=LILYPOND package=lilypond -C scm WWW-1 &&
477 make PACKAGE=LILYPOND package=lilypond -C po WWW-1 &&
478 make PACKAGE=LILYPOND package=lilypond -C make WWW-1 &&
479 make PACKAGE=LILYPOND package=lilypond -C elisp WWW-1 &&
480 make PACKAGE=LILYPOND package=lilypond -C vim WWW-1 &&
481 make PACKAGE=LILYPOND package=lilypond -C input WWW-1 &&
482 make PACKAGE=LILYPOND package=lilypond -C stepmake WWW-1 &&
483 make PACKAGE=LILYPOND package=lilypond -C Documentation WWW-1 &&
484 true
485 @end example
486
487 The directories up to and including vim produce no effect with
488 make in non-debug mode, although debug does show lots of action.
489
490 @file{git/build/input/GNUmakefile} is:
491
492 @example
493 depth=../
494 include $(depth)/config$(if $(conf),-$(conf),).make
495 include $(configure-srcdir)/./input/GNUmakefile
496 MODULE_INCLUDES += $(src-dir)/$(outbase)
497 @end example
498
499 The first include is:
500
501 @example
502 ..//config.make
503 @end example
504
505 (note the // which is strictly wrong)
506
507 which has lots of variables to set, but no action occurs.
508
509 The second is:
510
511 @example
512 lilypond-git/./input/GNUmakefile
513 @end example
514
515 which similarly doesn't create any actual action.
516
517 An error message at the end of build/input/GNUmakefile stops
518 make processing before it moves on to regression - so where does
519 that come from?
520
521 And the answer is - make processes all directories in the
522 directory it's entered (with some exceptions like out and out-www)
523 and so it changes to /regression.
524
525 It then seems to consider whether it needs to make/remake loads of
526 makefiles.  Don't understand this yet.  Possibly these are all the
527 makefiles it's processing, and it always checks they're up to date
528 before processing other files?
529
530 Could be correct - some of this output is:
531
532 @example
533 Must remake target `../../make/ly-inclusions.make'.
534 Failed to remake target file `../../make/ly-inclusions.make'.
535 @end example
536
537 Having decided that, it then leaves the directory and re-executes:
538
539 @example
540 make PACKAGE=LILYPOND package=lilypond -C regression WWW-1
541 @end example
542
543 The top of this make is:
544
545 @example
546 This program built for i486-pc-linux-gnu
547 Reading makefiles...
548 Reading makefile `GNUmakefile'...
549 Reading makefile `../..//config.make' (search path) (no ~ expansion)...
550 @end example
551
552 which looks like it's re-reading all its known makefiles to check
553 they're up to date.
554
555 (From the make manual:
556
557 To this end, after reading in all makefiles, make will consider each as a goal target and
558 attempt to update it. If a makefile has a rule which says how to update it (found either
559 in that very makefile or in another one) or if an implicit rule applies to it (see Chapter 10
560 [Using Implicit Rules], page 103), it will be updated if necessary. After all makefiles have
561 been checked, if any have actually been changed, make starts with a clean slate and reads
562 all the makefiles over again. (It will also attempt to update each of them over again, but
563 normally this will not change them again, since they are already up to date.)
564
565 So my assumption seems correct)
566
567 There appear to be about 74 of them.  After all the makefile
568 checking, we get this:
569
570 @smallexample
571 Updating goal targets....
572 Considering target file `WWW-1'.
573 File `WWW-1' does not exist.
574 Considering target file `local-WWW-1'.
575 File `local-WWW-1' does not exist.
576 Considering target file `out-www/collated-files.texi'.
577 File `out-www/collated-files.texi' does not exist.
578 Looking for an implicit rule for `out-www/collated-files.texi'.
579 Trying pattern rule with stem `collated-files.texi'.
580 Trying implicit prerequisite `collated-files.texi.in'.
581 Trying pattern rule with stem `collated-files.texi'.
582 Trying implicit prerequisite `collated-files.texi.in'.
583 Trying pattern rule with stem `collated-files'.
584 Trying implicit prerequisite `collated-files.tely'.
585 Trying pattern rule with stem `collated-files'.
586 Trying implicit prerequisite `out-www/collated-files.tely'.
587 Trying rule prerequisite `out-www/version.itexi'.
588 Found prerequisite `out-www/version.itexi' as VPATH `/home/phil/lilypond-git/input/regression/out-www/version.itexi'
589 @end smallexample
590
591 grep finds this if searching for local-WWW-1:
592
593 @example
594 make/lysdoc-targets.make:
595   local-WWW-1: $(outdir)/collated-files.texi $(outdir)/collated-files.pdf
596 @end example
597
598 which means that local-WWW-1 depends on coll*.texi and coll*.pdf
599 and so these will need to be checked to see if they're up to date.
600 So make needs to find rules for both of those and (as it says) it
601 certainly needs to make coll*.texi, since it doesn't exist.
602
603 In ly-rules.make we have:
604
605 @example
606 .SUFFIXES: .doc .tely .texi .ly
607 @end example
608
609 which I'll work out at some point, and also this rule:
610
611 @smallexample
612 $(outdir)/%.texi: $(outdir)/%.tely $(outdir)/version.itexi $(DOCUMENTATION_LOCALE_TARGET) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
613   LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_INCLUDES) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
614 @end smallexample
615
616 Note that the recipe is a very long line - it could probably
617 benefit from splitting.  The same makefile also has:
618
619 @smallexample
620 $(outdir)/%.texi: $(outdir)/%.tely $(outdir)/version.itexi $(DOCUMENTATION_LOCALE_TARGET) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
621   LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_INCLUDES) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
622 @end smallexample
623
624 @noindent
625 which seems to be an almost exact duplicate.  Whatever, the first
626 one is executed first.  Have not checked if the second executes.
627
628 The first recipe translates as this:
629
630 @example
631 LILYPOND_VERSION=2.15.0 /usr/bin/python   --process=' ' \
632   --output=./out-www --format= --lily-output-dir \
633     /home/phil/lilypond-git/build/out/lybook-db
634 @end example
635
636 @noindent
637 if we stop the build with an $(error), but I think this is because
638 we need to allow it to process the dependencies first.  It looks
639 like foo.texi is shown as being dependent on foo.tely, plus a load
640 of other files.
641
642 @example
643 DOCUMENTATION_LOCALE_TARGET is blank
644 INIT_LY_SOURCES = /home/phil/lilypond-git/scm/auto-beam.scm \
645   /home/phil/lilypond-git/scm/autochange.scm
646 @end example
647
648 plus 10s (100s?) of other .scm files.
649
650 @example
651 SCHEME_SOURCES = /home/phil/lilypond-git/ly/Welcome-to-LilyPond-MacOS.ly \
652   /home/phil/lilypond-git/ly/Welcome_to_LilyPond.ly
653 @end example
654
655 ditto .ly files.  This does seem a teency bit wrong - it looks like
656 the .ly and .scm files have been interchanged.  ly-vars.make has
657 these 2 lines:
658
659 @example
660 INIT_LY_SOURCES = $(wildcard $(top-src-dir)/scm/*.scm)
661 SCHEME_SOURCES = $(wildcard $(top-src-dir)/ly/*.ly)
662 @end example
663
664 Looks like a bug.....
665
666 So it now works its way through all these files, checking if they
667 need to be remade.  This is 100s of lines of the debug listing,
668 although none in the normal list.  Clearly none has to be made
669 since they're source files.  It concludes:
670
671 @example
672 Must remake target `out-www/collated-files.tely'
673 @end example
674
675 @file{lysdoc-rules.make} has this:
676
677 @smallexample
678 $(outdir)/collated-files.tely: $(COLLATED_FILES)
679         $(LYS_TO_TELY) --name=$(outdir)/collated-files.tely --title="$(TITLE)" --author="$(AUTHOR)" $^
680 @end smallexample
681
682 @file{lysdoc-vars.make} has:
683
684 @example
685 COLLATED_FILES = $(sort $(TEXINFO_SOURCES) $(LY_FILES) $(OUT_LY_FILES) )
686 @end example
687
688 We find that:
689
690 @example
691 TEXINFO_SOURCES = AAA-intro-regression.tely
692 OUT_LY_FILES is empty
693 @end example
694
695 so LY_FILES has the big long list of all the .ly files in the
696 regression directory.
697
698 This kicks off
699
700 @example
701 /home/phil/lilypond-git/build/scripts/build/out/lys-to-tely
702 @end example
703
704 with a list of all the files in the regression test directory. This
705 should (I believe) create the file collated-files.tely.
706
707 So the next rule in make is for @file{version.itexi}, and make duly
708 checks this.  There's a rule in @file{doc-i18n-root-rules.make} that this
709 depends on @file{git/VERSION}:
710
711 @smallexample
712 $(outdir)/version.%: $(top-src-dir)/VERSION
713         $(PYTHON) $(top-src-dir)/scripts/build/create-version-itexi.py > $@
714 @end smallexample
715
716 This causes create-version-itexi.py to run and create
717 version.itexi.
718
719 Once that's done, all the other *.scm and *.ly files are checked
720 and since they have no rules associated, they aren't remade (just
721 as well for source files, really).  Since version.itexi was remade
722 make concludes that collated-files.texi must be remade.  To do
723 this, it runs lilypond-book.py on collated-files.tely, as below:
724
725 @example
726 LILYPOND_VERSION=2.15.0
727   /usr/bin/python
728   /home/phil/lilypond-git/scripts/lilypond-book.py
729     -I /home/phil/lilypond-git/input/regression/
730     -I ./out-www -I /home/phil/lilypond-git/input
731     -I /home/phil/lilypond-git/Documentation
732     -I /home/phil/lilypond-git/Documentation/snippets
733     -I /home/phil/lilypond-git/input/regression/
734     -I /home/phil/lilypond-git/Documentation/included/
735     -I /home/phil/lilypond-git/build/mf/out/
736     -I /home/phil/lilypond-git/build/mf/out/
737     -I /home/phil/lilypond-git/Documentation/pictures
738     -I /home/phil/lilypond-git/build/Documentation/pictures/./out-www
739     --process='/home/phil/lilypond-git/build/out/bin/lilypond
740     -I /home/phil/lilypond-git/input/regression/
741     -I ./out-www
742     -I /home/phil/lilypond-git/input
743     -I /home/phil/lilypond-git/Documentation
744     -I /home/phil/lilypond-git/Documentation/snippets
745     -I /home/phil/lilypond-git/input/regression/
746     -I /home/phil/lilypond-git/Documentation/included/
747     -I /home/phil/lilypond-git/build/mf/out/
748     -I /home/phil/lilypond-git/build/mf/out/
749     -I /home/phil/lilypond-git/Documentation/pictures
750     -I /home/phil/lilypond-git/build/Documentation/pictures/./out-www
751     -dbackend=eps
752     --formats=ps,png,pdf
753     -dinclude-eps-fonts
754     -dgs-load-fonts
755     --header=doctitle
756     --header=doctitlecs
757     --header=doctitlede
758     --header=doctitlees
759     --header=doctitlefr
760     --header=doctitlehu
761     --header=doctitleit
762     --header=doctitleja
763     --header=doctitlenl
764     --header=doctitlezh
765     --header=texidoc
766     --header=texidoccs
767     --header=texidocde
768     --header=texidoces
769     --header=texidocfr
770     --header=texidochu
771     --header=texidocit
772     --header=texidocja
773     --header=texidocnl
774     --header=texidoczh
775     -dcheck-internal-types
776     -ddump-signatures
777     -danti-alias-factor=2'
778     --output=./out-www
779     --format=texi-html
780     --verbose
781     --lily-output-dir /home/phil/lilypond-git/build/out/lybook-db
782     out-www/collated-files.tely
783 @end example
784
785 So - lilypond-book runs on:
786
787 @example
788 input/regression/out-www/collated-files.tely
789 @end example
790
791
792 Note the --verbose flag - this is from the make variable
793 LILYPOND_BOOK_VERBOSE which is added to the make variable
794 LILYPOND_BOOK_FLAGS.
795
796 Now found the invocation to write some of the image files.  It's
797 like this:
798
799 @example
800 /home/phil/lilypond-git/build/out/bin/lilypond
801   -I /home/phil/lilypond-git/input/regression/
802   -I ./out-www -I /home/phil/lilypond-git/input
803   -I /home/phil/lilypond-git/Documentation
804   -I /home/phil/lilypond-git/Documentation/snippets
805   -I /home/phil/lilypond-git/input/regression/
806   -I /home/phil/lilypond-git/Documentation/included/
807   -I /home/phil/lilypond-git/build/mf/out/
808   -I /home/phil/lilypond-git/build/mf/out/
809   -I /home/phil/lilypond-git/Documentation/pictures
810   -I /home/phil/lilypond-git/build/Documentation/pictures/./out-www
811   -dbackend=eps
812   --formats=ps,png,pdf
813   -dinclude-eps-fonts
814   -dgs-load-fonts
815   --header=doctitle
816   --header=doctitlecs
817   --header=doctitlede
818   --header=doctitlees
819   --header=doctitlefr
820   --header=doctitlehu
821   --header=doctitleit
822   --header=doctitleja
823   --header=doctitlenl
824   --header=doctitlezh
825   --header=texidoc
826   --header=texidoccs
827   --header=texidocde
828   --header=texidoces
829   --header=texidocfr
830   --header=texidochu
831   --header=texidocit
832   --header=texidocja
833   --header=texidocnl
834   --header=texidoczh
835   -dcheck-internal-types
836   -ddump-signatures
837   -danti-alias-factor=2
838   -I  "/home/phil/lilypond-git/build/out/lybook-db"
839   -I  "/home/phil/lilypond-git/build/input/regression"
840   -I  "/home/phil/lilypond-git/input/regression"
841   -I  "/home/phil/lilypond-git/build/input/regression/out-www"
842   -I  "/home/phil/lilypond-git/input"
843   -I  "/home/phil/lilypond-git/Documentation"
844   -I  "/home/phil/lilypond-git/Documentation/snippets"
845   -I  "/home/phil/lilypond-git/input/regression"
846   -I  "/home/phil/lilypond-git/Documentation/included"
847   -I  "/home/phil/lilypond-git/build/mf/out"
848   -I  "/home/phil/lilypond-git/build/mf/out"
849   -I  "/home/phil/lilypond-git/Documentation/pictures"
850   -I  "/home/phil/lilypond-git/build/Documentation/pictures/out-www"
851   --formats=eps
852   --verbose
853   -deps-box-padding=3.000000
854   -dread-file-list
855   -dno-strip-output-dir
856   "/home/phil/lilypond-git/build/out/lybook-db/snippet-names--415419468.ly"'
857 @end example
858
859 Note the --verbose.  This causes 100s of lines of Lily debug output.
860 But at present I can't work out where the flag comes from. Later.
861
862
863 @node Building a bibliography
864 @subsection Building a bibliography
865
866 Bibliography files contain a list of citations, like this:
867
868 @example
869 @@Book@{vinci,
870   author = @{Vinci, Albert C.@},
871   title = @{Fundamentals of Traditional Music Notation@},
872   publisher = @{Kent State University Press@},
873   year = @{1989@}
874 @}
875 @end example
876
877 There are a variety of types of citation (e.g. Book (as above),
878 article, publication).  Each cited publication has a list of
879 entries that can be used to identify the publication.
880 Bibliograpies are normally stored as files with a .bib
881 extension.  One part of the doc-build process is transforming the
882 bibliography information into @code{texinfo} files.  The commands
883 to do this are in the @file{GNUmakefile} in the
884 @file{Documentation} directory.
885
886 A typical line of the makefile to translate a single bibliography
887 is:
888
889 @example
890 $(outdir)/colorado.itexi:
891         BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
892                 -s $(top-src-dir)/Documentation/lily-bib \
893                 -o $(outdir)/colorado.itexi \
894                 $(src-dir)/essay/colorado.bib
895 @end example
896
897 Line by line:
898
899 @example
900 $(outdir)/colorado.itexi:
901 @end example
902
903 We're making the file @file{colorado.itexi} and so this is the
904 make instruction.
905
906 @example
907         BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
908 @end example
909
910 It's in the @file{essay} directory and we want to run the
911 bib2texi.py script against it.
912
913 @example
914                 -s $(top-src-dir)/Documentation/lily-bib \
915 @end example
916
917 The style template is @file{lily-bib.bst} and is found in the
918 @file{Documentation} directory.
919
920 @example
921                 -o $(outdir)/colorado.itexi \
922 @end example
923
924 The output file in @file{colorado.itexi}.
925
926 @example
927                 $(src-dir)/essay/colorado.bib
928 @end example
929
930 The input file is @file{colorado.bib} in the @file{essay}
931 directory.
932
933 The @code{bib2texi} Python script used to be used with a variety
934 of options, but now is always called using the same options, as
935 above.  Its job is to create the file containing the options for
936 @code{bibtex} (the program that actually does the translation),
937 run bibtex, and then clean up some temporary files.  Its main
938 "value add" is the creation of the options file, using this code:
939
940 @example
941 open (tmpfile + '.aux', 'w').write (r'''
942 \relax
943 \citation@{*@}
944 \bibstyle@{%(style)s@}
945 \bibdata@{%(files)s@}''' % vars ())
946 @end example
947
948 The key items are the style file (now always lily-bib for us) and
949 the input file.
950
951 The style file is written in its own specialised language,
952 described to some extent at
953
954 @example
955 @uref{http://amath.colorado.edu/documentation/LaTeX/reference/faq/bibtex.pdf}
956 @end example
957
958 The file @file{lily-bib.bst} also has fairly extensive commenting.
959
960 @node Website build
961 @section Website build
962
963 @warning{This information applies only to the standard @code{make
964 website} from the normal build directory.  The process is
965 different for @code{dev/website-build}.}
966
967 The rule for make website is found in GNUmakefile.in:
968
969 @example
970 website:
971 $(MAKE) config_make=$(config_make) \
972         top-src-dir=$(top-src-dir) \
973         -f $(top-src-dir)/make/website.make \
974         website
975 @end example
976
977 This translates as:
978
979 @example
980 make --no-builtin-rules config_make=./config.make \
981                 top-src-dir=/home/phil/lilypond-git \
982                 -f /home/phil/lilypond-git/make/website.make \
983                 website
984 @end example
985
986 which has the effect of setting the variables @code{config_make}
987 and @code{top-src-dir} and then processing the file
988 @code{git/make/website.make} with the target of website.
989
990 @code{website.make} starts with the following:
991
992 @example
993 ifeq (@$(WEBSITE_ONLY_BUILD),1)
994 @end example
995
996 which checks to see whether the variable @code{WEBSITE_ONLY_BUILD}
997 was set to one on the command line.  This is only done for
998 standalone website builds, not in the normal case.  The result of
999 the test determines the value of some variables that are set.  A
1000 number of other variables are set, in order to establish locations
1001 of various files.  An example is:
1002
1003 @example
1004 CREATE_VERSION=python @$(script-dir)/create-version-itexi.py
1005 @end example
1006
1007 The rule for website is:
1008
1009 @smallexample
1010 website: website-texinfo website-css website-pictures website-examples web-post
1011         cp @$(SERVER_FILES)/favicon.ico @$(OUT)/website
1012         cp @$(SERVER_FILES)/robots.txt @$(OUT)/website
1013         cp @$(top-htaccess) @$(OUT)/.htaccess
1014         cp @$(dir-htaccess) @$(OUT)/website/.htaccess
1015 @end smallexample
1016
1017 so we see that this starts by running the rules for 5 other
1018 targets, then finishes by copying some files.  We'll cover that
1019 later - first @code{website-texinfo}.  That rule is:
1020
1021 @example
1022 website-texinfo: website-version website-xrefs website-bibs
1023         for l in '' @$(WEB_LANGS); do \
1024                 if test -n "@$@$l"; then \
1025                         langopt=--lang="@$@$l"; \
1026                         langsuf=.@$@$l; \
1027                 fi; \
1028                 @$(TEXI2HTML) --prefix=index \
1029                         --split=section \
1030                         --I=@$(top-src-dir)/Documentation/"@$@$l" \
1031                         --I=@$(top-src-dir)/Documentation \
1032                         --I=@$(OUT) \
1033                         @$@$langopt \
1034                         --init-file=@$(texi2html-init-file) \
1035                         -D web_version \
1036                         --output=@$(OUT)/"@$@$l" \
1037                         @$(top-src-dir)/Documentation/"@$@$l"/web.texi ; \
1038                 ls @$(OUT)/@$@$l/*.html | xargs grep -L \
1039                         'UNTRANSLATED NODE: IGNORE ME' | \
1040                         sed 's!@$(OUT)/'@$@$l'/!!g' | xargs \
1041                         @$(MASS_LINK) --prepend-suffix="@$@$langsuf" \
1042                         hard @$(OUT)/@$@$l/ @$(OUT)/website/ ; \
1043         done
1044 @end example
1045
1046 which therefore depends on @code{website-version},
1047 @code{website-xrefs} and @code{website-bibs}.
1048
1049 @example
1050 website-version:
1051         mkdir -p @$(OUT)
1052         @$(CREATE_VERSION) @$(top-src-dir) > @$(OUT)/version.itexi
1053         @$(CREATE_WEBLINKS) @$(top-src-dir) > @$(OUT)/weblinks.itexi
1054 @end example
1055
1056 which translates as:
1057
1058 @example
1059 mkdir -p out-website
1060 python /home/phil/lilypond-git/scripts/build/create-version-itexi.py
1061         /home/phil/lilypond-git > out-website/version.itexi
1062 python /home/phil/lilypond-git/scripts/build/create-weblinks-itexi.py
1063         /home/phil/lilypond-git > out-website/weblinks.itexi
1064 @end example
1065
1066 So, we make out-website then send the output of
1067 @code{create-version-itexi.py} to @code{out-website/version.itexi}
1068 and @code{create-weblinks-itexi.py} to
1069 @code{out-website/weblinks.itexi}.
1070
1071 @code{create-version-itexi.py} parses the file @code{VERSION} in
1072 the top source dir.  It contains:
1073
1074 @example
1075 PACKAGE_NAME=LilyPond
1076 MAJOR_VERSION=2
1077 MINOR_VERSION=15
1078 PATCH_LEVEL=13
1079 MY_PATCH_LEVEL=
1080 VERSION_STABLE=2.14.2
1081 VERSION_DEVEL=2.15.12
1082 @end example
1083
1084 currently.  @code{c-v-i.py} parses this to:
1085
1086 @example
1087 @@c ************************ Version numbers ************
1088 @@macro version
1089 2.15.13
1090 @@end macro
1091
1092 @@macro versionStable
1093 2.14.2
1094 @@end macro
1095
1096 @@macro versionDevel
1097 2.15.12
1098 @@end macro
1099 @end example
1100
1101 @code{create-weblinks-itexi.py} creates a load of texi macros (of
1102 the order of 1000) similar to:
1103
1104 @example
1105 @@macro manualStableGlossaryPdf
1106 @@uref{../doc/v2.14/Documentation/music-glossary.pdf,Music glossary.pdf}
1107 @@end macro.
1108 @end example
1109
1110 It loads its languages from langdefs.py, and therefore outputs the following unhelpful warning:
1111
1112 @code{langdefs.py: warning: lilypond-doc gettext domain not found.}
1113
1114 Next:
1115
1116 @example
1117 website-xrefs: website-version
1118         for l in '' @$(WEB_LANGS); do \
1119 @end example
1120
1121 is the start of the rule, truncated for brevity.  This loops
1122 through the languages to be used on the website, processing some
1123 variables which I don't fully understand, to run this command:
1124
1125 @smallexample
1126 python /home/phil/lilypond-git/scripts/build/extract_texi_filenames.py \
1127         -I /home/phil/lilypond-git/Documentation \
1128         -I /home/phil/lilypond-git/Documentation/"@$l" \
1129         -I out-website -o out-website --split=node \
1130         --known-missing-files= \
1131                  /home/phil/lilypond-git/scripts/build/website-known-missing-files.txt \
1132         -q \
1133         /home/phil/lilypond-git/Documentation/"@$l"/web.texi ;\
1134 @end smallexample
1135
1136 There's a good description of what
1137 @code{extract_texi_filenames.py} does at the top of the script,
1138 but a shortened version is:
1139
1140 @code{If this script is run on a file texifile.texi, it produces
1141 a file texifile[.LANG].xref-map with tab-separated entries
1142 of the form NODE\tFILENAME\tANCHOR.}
1143
1144 An example from
1145 @code{web.nl.xref-map} is:
1146
1147 @example
1148 Inleiding        Introduction        Introduction
1149 @end example
1150
1151 @code{e-t-f.py} follows the includes from document to document.
1152 We know some have not been created yet, and
1153 @code{known-missing-files} option tells @code{e-t-f.py} which
1154 these are.
1155
1156 It then does this:
1157
1158 @example
1159 for m in @$(MANUALS); do \
1160 @end example
1161
1162 to run @code{e-t-f.py} against all of the manuals, in each
1163 language. Next:
1164
1165 @example
1166 website-bibs: website-version
1167         BSTINPUTS=@$(top-src-dir)/Documentation/web \
1168                 @$(WEB_BIBS) -s web \
1169                 -s @$(top-src-dir)/Documentation/lily-bib \
1170                 -o @$(OUT)/others-did.itexi \
1171                 @$(quiet-flag) \
1172                 @$(top-src-dir)/Documentation/web/others-did.bib
1173 @end example
1174
1175 This is half the command.  It runs @code{bib2texi.py} on 2
1176 @code{.bib} files - @code{others-did.bib} and @code{we-wrote.bib}.
1177 This converts bibliography files into texi files with
1178 @code{bibtex}.
1179
1180 Next the commands in the @code{website-texinfo} rule are run:
1181
1182 @example
1183 for l in '' @$(WEB_LANGS); do \
1184 @end example
1185
1186 run @code{texi2html}.  This is the program that outputs the
1187 progress message (found in
1188 @code{Documentation/lilypond-texi2html.init}):
1189
1190 @code{Processing web site: []}
1191
1192 It also outputs warning messages like:
1193
1194 @code{WARNING: Unable to find node 'ŘeÅ¡ení potíží' in book usage.}
1195
1196 @example
1197 website-css:
1198         cp @$(top-src-dir)/Documentation/css/*.css @$(OUT)/website
1199 @end example
1200
1201 Copies 3 css files to out-website/website.  Then:
1202
1203 @example
1204 website-pictures:
1205         mkdir -p @$(OUT)/website/pictures
1206         if [ -d @$(PICTURES) ]; \
1207         then \
1208                 cp @$(PICTURES)/* @$(OUT)/website/pictures ; \
1209                 ln -sf website/pictures @$(OUT)/pictures  ;\
1210         fi
1211 @end example
1212
1213 which translates as:
1214
1215 @smallexample
1216 if [ -d Documentation/pictures/out-www ]; \
1217     then \
1218         cp Documentation/pictures/out-www/* out-website/website/pictures ; \
1219         ln -sf website/pictures out-website/pictures  ;\
1220     fi
1221 @end smallexample
1222
1223 i.e. it copies the contents of
1224 @code{build/Documentation/pictures/out-www/*} to
1225 @code{out-website/website/pictures}.  Unfortunately, the pictures
1226 are only created once @code{make doc} has been run, so an initial
1227 run of @code{make website} copies nothing, and the pictures on the
1228 website (e.g. the logo) do not exist.  Next:
1229
1230 @example
1231 website-examples:
1232         mkdir -p @$(OUT)/website/ly-examples
1233         if [ -d @$(EXAMPLES) ]; \
1234         then \
1235                 cp @$(EXAMPLES)/* @$(OUT)/website/ly-examples ; \
1236         fi
1237 @end example
1238
1239 translates to:
1240
1241 @smallexample
1242 mkdir -p out-website/website/ly-examples
1243 if [ -d Documentation/web/ly-examples/out-www ]; \
1244     then \
1245         cp Documentation/web/ly-examples/out-www/* out-website/website/ly-examples ; \
1246     fi
1247 @end smallexample
1248
1249 This does the same with the LilyPond examples (found at
1250 @uref{http://lilypond.org/examples.html}).  Again, these are
1251 actually only created by @code{make doc} (and since they are
1252 generated from LilyPond source files, require a working LilyPond
1253 @code{exe} made with @code{make}).  So this does nothing
1254 initially.  Then:
1255
1256 @example
1257 web-post:
1258         @$(WEB_POST) @$(OUT)/website
1259 @end example
1260
1261 which is:
1262
1263 @smallexample
1264 python /home/phil/lilypond-git/scripts/build/website_post.py out-website/website
1265 @end smallexample
1266
1267 which describes itself as:
1268
1269 @code{This is web_post.py. This script deals with translations
1270 in the "make website" target.}
1271
1272 It also does a number of other things, including adding the Google
1273 tracker code and the language selection footer.  We're now at
1274 the end of our story.  The final 4 lines of the recipe for website
1275 are:
1276
1277 @example
1278 cp @$(SERVER_FILES)/favicon.ico @$(OUT)/website
1279 cp @$(SERVER_FILES)/robots.txt @$(OUT)/website
1280 cp @$(top-htaccess) @$(OUT)/.htaccess
1281 cp @$(dir-htaccess) @$(OUT)/website/.htaccess
1282 @end example
1283
1284 The first translates as:
1285
1286 @smallexample
1287 cp /home/phil/lilypond-git/Documentation/web/server/favicon.ico out-website/website
1288 @end smallexample
1289
1290 so we see these are just copying the support files for the web
1291 server.
1292
1293 @subsubheading website.make summary
1294
1295 Recipes in @file{website.make}:
1296
1297 @itemize
1298
1299 @item
1300 @code{website:}
1301 this is the "master" rule.  It calls the other rules in order,
1302 then copies some extra files around - see below for further
1303 of the process it produces.
1304
1305 @item
1306 @code{website-version}:
1307 this calls the python scripts below:
1308 @itemize
1309 @item
1310 @example
1311 scripts/build/create-version-itexi.py
1312 @end example
1313
1314 This writes a @@version, @@versionStable, and @@versionDevel based
1315 on the top-level VERSIONS file, to
1316 @code{out-website/version.itexi}
1317
1318 @item
1319 @example
1320 scripts/build/create-weblinks-itexi.py
1321 @end example
1322
1323 This creates a ton of macros in @code{out-website/weblinks.itexi}.
1324 Stuff like @@downloadStableLinuxNormal, @@downloadStableWidows,
1325 @code{@@stableDocsNotationPdf@{@}}, @@downloadDevelSourch-zh.
1326
1327 It's quite monstrous because it deals with combinations of
1328 stable/devel, source/docs, lang/lang/lang*10, etc.
1329
1330 @end itemize
1331
1332 @item
1333 @code{website-xrefs:}
1334 creates files used for complicated "out-of-build" references to
1335 @code{out-website/*.xref-map}
1336
1337 If you just write @@ref@{@}, then all's groovy and we wouldn't
1338 need this.  But if you write @@rlearning@{@}, then our custom
1339 texi2html init file needs to know about our custom xref file
1340 format, which tells our custom texi2html init file how to create
1341 the link.
1342
1343 GP: we should have a separate @@node to discuss xrefs.  Also, take a
1344 quick look at a generated xref file -- it's basically just a list
1345 of @@node's [sic teenager pluralization rule] from the file.
1346
1347 @item
1348 @code{website-bib:}
1349 generates the bibliography texinfo files from the .bib files - in
1350 the case of the website build these are @file{others-did.bib} and
1351 @file{we-wrote.bib}.
1352
1353 @item
1354 @code{website-texinfo:}
1355 this is the main part; it calles texi2html to generate the actual
1356 html.  It also has a ton of options to texi2html to pass info to
1357 our custom init file.
1358
1359 The file actually built is called @file{web.texi}, and is either
1360 in the @file{Documentation} directory, or a sub-directory specific
1361 to the language.
1362
1363 The options file is @file{/Documentation/lilypond-texi2html.init}.
1364 This contains *lots* of option and configuration stuff, and also
1365 includes the line:
1366
1367 @smallexample
1368 print STDERR "Initializing settings for web site: [$Texi2HTML::THISDOC@{current_lang@}]\n";
1369 @end smallexample
1370
1371 This is where one of the console messages is generated.
1372
1373 We have somewhere between 2-4 different ways "to pass info to our
1374 custom init file".  This is highly Not Good (tm), but that's how
1375 things work at the moment.
1376
1377 After texi2html, it does some black magick to deal with
1378 untranslated nodes in the translations.  Despite writing that
1379 part, I can't remember how it works.  But in theory, you could
1380 figure it out by copy&pasting each part of the command (by "part",
1381 I mean "stuff before each | pipe"), substituting the variables,
1382 then looking at the text that's output.  For example,
1383
1384 @example
1385   ls $(OUT)/$$l/*.html
1386 @end example
1387
1388 is going to print a list of all html files, in all languages, in
1389 the build directory.  Then more stuff happens to each of those
1390 files (that's what xargs does).
1391
1392 @item
1393 @code{website-css:}
1394 just copies files to the build dir.
1395
1396 @item
1397 @code{website-pictures, website-examples:}
1398 more file copies, with an if statement to handle if you don't have
1399 any generated pictures/examples.
1400
1401 @item
1402 @code{web-post:}
1403 runs:
1404
1405 @example
1406 scripts/build/website_post.py
1407 @end example
1408
1409 which, it adds the "this page is translated in klingon" to the
1410 bottom of html pages, and adds the google analytics javascript.
1411 It also has hard-coded lilypond version numbers, which is Bad
1412 (tm).
1413
1414 @end itemize
1415
1416 Here's a summary of what gets called, in what order, when we run
1417 @code{make website}
1418
1419 @example
1420 website:
1421   website-texinfo:
1422     website-version:
1423       creates version.itexi and weblinks.itexi
1424     website-xrefs:
1425       runs extract_texi_filenames.py
1426     website-bibs:
1427       creates bibliography files, described above
1428   website-css:
1429     copies css files
1430   website-pictures:
1431     copies pictures
1432   website-examples:
1433     copies examples
1434   web-post:
1435     runs website_post.py
1436   Then some file copying
1437 @end example
1438
1439 @node Building an Ubuntu distro
1440 @section Building an Ubuntu distro
1441
1442
1443 Here's the short instruction on how to create lilybuntu iso image
1444 (Jonathan Kulp did this on a spare drive,
1445 but he supposes it can be done in a VM too):
1446
1447 @enumerate
1448
1449 @item
1450 Install ubuntu, reboot.
1451 @item
1452 Run all updates, reboot if asked.
1453 @item
1454 Enable src repos, refresh package lists.
1455 @item
1456 Install LilyPond build deps:
1457 @example
1458 sudo apt-get build-dep lilypond
1459 @end example
1460 @item
1461 Install git and autoconf:
1462 @example
1463 sudo apt-get install git-core gitk autoconf
1464 @end example
1465
1466 @item
1467 Test to see whether everything works fine now:
1468 @enumerate
1469 @item
1470 use @command{lily-git.tcl} to grab source files
1471 @item
1472 go to source dir and do
1473 @example
1474 "./autogen.sh" ; make ; make doc
1475 @end example
1476 @item
1477 if all compiles, move on to iso creation...
1478 @end enumerate
1479
1480 @item
1481 Download & install "remastersys":
1482 @uref{http://sourceforge.net/projects/remastersys/, http://sourceforge.net/projects/remastersys/}
1483 @item
1484 Copy @command{lily-git.tcl} script file into @file{/etc/skel/}.
1485 @item
1486 Modify @file{/etc/remastersys.conf} as desired (change @code{.iso} name,
1487 default live session username, etc).
1488 @item
1489 Remove non-essential desktop software as desired.
1490 @item
1491 Create iso:
1492 @example
1493 sudo remastersys dist
1494 @end example
1495 New iso is in @file{/home/remastersys/remastersys/}.
1496 @item
1497 Test iso by installing in VM and repeating steps above for
1498 getting source files and building lp and docs.
1499
1500 @end enumerate