Now we have the new `module' command, use it.
[sgt/puzzles] / Buildscr
1 # -*- sh -*-
2 # Build script to build Puzzles.
3
4 module puzzles
5
6 # First build some local binaries, to run the icon build.
7 in puzzles do perl mkfiles.pl
8 in puzzles do make
9
10 # Now build the screenshots and icons.
11 in puzzles/icons do xvfb-run make web winicons gtkicons
12
13 # Re-run mkfiles.pl now that it knows the icons are there.
14 in puzzles do perl mkfiles.pl
15
16 # Destroy the local binaries, mostly to avoid wasting network
17 # bandwidth by transferring them to the delegate servers.
18 in puzzles do make clean
19
20 # Build the OS X .dmg archive.
21 delegate osx
22 in puzzles do make -f Makefile.osx clean
23 in puzzles do make -f Makefile.osx release VER=-DREVISION=$(revision)
24 return puzzles/Puzzles.dmg
25 enddelegate
26
27 # Build the Windows binaries and the CHM file.
28 in puzzles do make -f Makefile.doc clean
29 in puzzles do make -f Makefile.doc chm
30 delegate windows
31 # Ignore the poorly controlled return value from HHC, and instead
32 # just test that the output file was generated.
33 in puzzles do hhc puzzles.hhp; test -f puzzles.chm
34 # FIXME: Cygwin alternative?
35 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc clean'
36 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc VER=-DREVISION=$(revision)'
37 return puzzles/puzzles.chm
38 return puzzles/*.exe
39 enddelegate
40
41 # Build the help file and the HTML docs.
42 in puzzles do make -f Makefile.doc clean
43 in puzzles do make -f Makefile.doc
44 in puzzles do mkdir doc
45 in puzzles do mkdir devel
46 in puzzles/doc do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../puzzles.but
47 in puzzles/devel do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../devel.but
48
49 # Move the deliver-worthy Windows binaries (those specified in
50 # wingames.lst, which is generated by mkfiles.pl and helpfully
51 # excludes the command-line auxiliary utilities such as solosolver,
52 # and nullgame.exe) into a subdirectory for easy access.
53 in puzzles do mkdir winbin
54 in puzzles do mv `cat wingames.lst` winbin
55
56 # Make a zip file of the Windows binaries and help files.
57 in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt
58
59 # Create the source archive. (That writes the archive into the
60 # _parent_ directory, so be careful when we deliver it.)
61 in puzzles do ./makedist.sh $(revision)
62
63 # Set up .htaccess containing a redirect for the archive filename.
64 in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
65 in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess
66 in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess
67 in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess
68
69 # Phew, we're done. Deliver everything!
70 deliver puzzles/icons/*-web.png $@
71 deliver puzzles/winbin/*.exe $@
72 deliver puzzles/.htaccess $@
73 deliver puzzles/doc/*.html doc/$@
74 deliver puzzles/devel/*.html devel/$@
75 deliver puzzles/Puzzles.dmg $@
76 deliver puzzles/puzzles.chm $@
77 deliver puzzles/puzzles.hlp $@
78 deliver puzzles/puzzles.cnt $@
79 deliver puzzles/puzzles.zip $@
80 # This one isn't in the puzzles subdir, because makedist.sh left it
81 # one level up.
82 deliver puzzles*.tar.gz $@