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