Looking for puzzles*.tar.gz in the right directory is liable to make
[sgt/puzzles] / Buildscr
1 # -*- sh -*-
2 # Build script to build Puzzles.
3
4 # First build some local binaries, to run the icon build.
5 in puzzles do perl mkfiles.pl
6 in puzzles do make
7
8 # Now build the screenshots and icons.
9 in 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.
13 in puzzles do make clean
14
15 # Build the OS X .dmg archive.
16 delegate osx
17 in puzzles do make -f Makefile.osx clean
18 in puzzles do make -f Makefile.osx release
19 return puzzles/Puzzles.dmg
20 enddelegate
21
22 # Build the Windows binaries and the CHM file.
23 in puzzles do make -f Makefile.doc clean
24 in puzzles do make -f Makefile.doc chm
25 delegate 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'
31 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc'
32 return puzzles/puzzles.chm
33 return puzzles/*.exe
34 enddelegate
35
36 # Build the help file and the HTML docs.
37 in puzzles do make -f Makefile.doc clean
38 in puzzles do make -f Makefile.doc
39 in puzzles do mkdir doc
40 in puzzles do mkdir devel
41 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
42 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
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.
48 in puzzles do mkdir winbin
49 in puzzles do mv `cat wingames.lst` winbin
50
51 # Make a zip file of the Windows binaries and help files.
52 in 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.)
56 in puzzles do ./makedist.sh $(revision)
57
58 # Set up .htaccess containing a redirect for the archive filename.
59 in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
60 in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess
61 in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess
62 in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess
63
64 # Phew, we're done. Deliver everything!
65 deliver puzzles/icons/*-web.png $@
66 deliver puzzles/winbin/*.exe $@
67 deliver puzzles/.htaccess $@
68 deliver puzzles/doc/*.html doc/$@
69 deliver puzzles/devel/*.html devel/$@
70 deliver puzzles/Puzzles.dmg $@
71 deliver puzzles/puzzles.chm $@
72 deliver puzzles/puzzles.hlp $@
73 deliver puzzles/puzzles.cnt $@
74 deliver puzzles/puzzles.zip $@
75 # This one isn't in the puzzles subdir, because makedist.sh left it
76 # one level up.
77 deliver puzzles*.tar.gz $@