Fix a UI glitch where dragging an existing arrow could change what it
[sgt/puzzles] / Buildscr
... / ...
CommitLineData
1# -*- sh -*-
2# Build script to build Puzzles.
3
4module puzzles
5
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
13# Re-run mkfiles.pl now that it knows the icons are there.
14in 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.
18in puzzles do make clean
19
20# Build the OS X .dmg archive.
21delegate 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
25enddelegate
26
27# Build the Windows binaries and installer, and the CHM file.
28in puzzles do make -f Makefile.doc clean
29in puzzles do make -f Makefile.doc chm
30in puzzles do make -f Makefile.doc # build help file for installer
31in puzzles do perl winiss.pl $(revision) wingames.lst > puzzles.iss
32delegate windows
33 # Ignore the poorly controlled return value from HHC, and instead
34 # just test that the output file was generated.
35 in puzzles do hhc puzzles.hhp; test -f puzzles.chm
36 # FIXME: Cygwin alternative?
37 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc clean'
38 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc VER=-DREVISION=$(revision)'
39 # Build installer.
40 in puzzles do iscc puzzles.iss
41 return puzzles/puzzles.chm
42 return puzzles/*.exe
43 return puzzles/Output/setup.exe
44enddelegate
45
46# Build the help file and the HTML docs.
47in puzzles do make -f Makefile.doc clean # remove CHM-target HTML
48in puzzles do make -f Makefile.doc # and rebuild help file...
49in puzzles do mkdir doc
50in puzzles do mkdir devel
51in 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
52in 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
53
54# Move the deliver-worthy Windows binaries (those specified in
55# wingames.lst, which is generated by mkfiles.pl and helpfully
56# excludes the command-line auxiliary utilities such as solosolver,
57# and nullgame.exe) into a subdirectory for easy access.
58in puzzles do mkdir winbin
59in puzzles do mv `cut -f1 -d: wingames.lst` winbin
60
61# Make a zip file of the Windows binaries and help files.
62in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt
63
64# Create the source archive. (That writes the archive into the
65# _parent_ directory, so be careful when we deliver it.)
66in puzzles do ./makedist.sh $(revision)
67
68# Set up .htaccess containing a redirect for the archive filename.
69in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
70in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess
71in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess
72in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess
73in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.exe '$$1'puzzles-r$(revision)-installer.exe >> .htaccess
74
75# Phew, we're done. Deliver everything!
76deliver puzzles/icons/*-web.png $@
77deliver puzzles/winbin/*.exe $@
78deliver puzzles/.htaccess $@
79deliver puzzles/doc/*.html doc/$@
80deliver puzzles/devel/*.html devel/$@
81deliver puzzles/Puzzles.dmg $@
82deliver puzzles/puzzles.chm $@
83deliver puzzles/puzzles.hlp $@
84deliver puzzles/puzzles.cnt $@
85deliver puzzles/puzzles.zip $@
86deliver puzzles/Output/setup.exe puzzles-r$(revision)-installer.exe
87# This one isn't in the puzzles subdir, because makedist.sh left it
88# one level up.
89deliver puzzles*.tar.gz $@