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