Now we have the new `module' command, use it.
[sgt/puzzles] / Buildscr
CommitLineData
9bb2f5af 1# -*- sh -*-
2# Build script to build Puzzles.
3
452ce003 4module puzzles
5
9bb2f5af 6# First build some local binaries, to run the icon build.
7in puzzles do perl mkfiles.pl
8in puzzles do make
9
10# Now build the screenshots and icons.
11in puzzles/icons do xvfb-run make web winicons gtkicons
12
30c61de3 13# Re-run mkfiles.pl now that it knows the icons are there.
14in puzzles do perl mkfiles.pl
15
9bb2f5af 16# Destroy the local binaries, mostly to avoid wasting network
17# bandwidth by transferring them to the delegate servers.
18in puzzles do make clean
19
20# Build the OS X .dmg archive.
21delegate osx
22 in puzzles do make -f Makefile.osx clean
1310cbd2 23 in puzzles do make -f Makefile.osx release VER=-DREVISION=$(revision)
9bb2f5af 24 return puzzles/Puzzles.dmg
25enddelegate
26
27# Build the Windows binaries and the CHM file.
28in puzzles do make -f Makefile.doc clean
29in puzzles do make -f Makefile.doc chm
30delegate 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'
1310cbd2 36 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc VER=-DREVISION=$(revision)'
9bb2f5af 37 return puzzles/puzzles.chm
38 return puzzles/*.exe
39enddelegate
40
41# Build the help file and the HTML docs.
42in puzzles do make -f Makefile.doc clean
43in puzzles do make -f Makefile.doc
44in puzzles do mkdir doc
45in puzzles do mkdir devel
46in 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
47in 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.
53in puzzles do mkdir winbin
54in puzzles do mv `cat wingames.lst` winbin
55
56# Make a zip file of the Windows binaries and help files.
57in 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.)
61in puzzles do ./makedist.sh $(revision)
62
63# Set up .htaccess containing a redirect for the archive filename.
64in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
65in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess
66in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess
0c315fc3 67in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess
9bb2f5af 68
69# Phew, we're done. Deliver everything!
70deliver puzzles/icons/*-web.png $@
71deliver puzzles/winbin/*.exe $@
72deliver puzzles/.htaccess $@
73deliver puzzles/doc/*.html doc/$@
74deliver puzzles/devel/*.html devel/$@
75deliver puzzles/Puzzles.dmg $@
76deliver puzzles/puzzles.chm $@
77deliver puzzles/puzzles.hlp $@
78deliver puzzles/puzzles.cnt $@
79deliver puzzles/puzzles.zip $@
80# This one isn't in the puzzles subdir, because makedist.sh left it
81# one level up.
82deliver puzzles*.tar.gz $@