I _think_, after some fairly random experimentation, that this ought
[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.
d51ac519 11in puzzles/icons do xvfb-run -s "-cc TrueColor" make web winicons gtkicons
9bb2f5af 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
d09d659f 27# Build the Windows binaries and installer, and the CHM file.
9bb2f5af 28in puzzles do make -f Makefile.doc clean
29in puzzles do make -f Makefile.doc chm
d09d659f 30in puzzles do make -f Makefile.doc # build help file for installer
31in puzzles do perl winiss.pl $(revision) wingames.lst > puzzles.iss
9bb2f5af 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'
1310cbd2 38 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc VER=-DREVISION=$(revision)'
d09d659f 39 # Build installer.
40 in puzzles do iscc puzzles.iss
9bb2f5af 41 return puzzles/puzzles.chm
42 return puzzles/*.exe
d09d659f 43 return puzzles/Output/setup.exe
9bb2f5af 44enddelegate
45
c1549393 46# Build the Pocket PC binaries and CAB.
47#
48# NOTE: This part of the build script requires the Windows delegate
49# server to have the cabwiz program on its PATH. This will
50# typically be at
51#
52# C:\Program Files\Windows CE Tools\WCE420\POCKET PC 2003\Tools
53#
54# but it might not be if you've installed it somewhere else, or
55# have a different version.
56#
57# NOTE ALSO: This part of the build is commented out, for the
58# moment, because cabwiz does unhelpful things when run from within
59# a bob delegate process (or, more generally, when run from any
60# terminal-based remote login to a Windows machine, including
61# Cygwin opensshd and Windows Telnet). The symptom is that cabwiz
62# just beeps and sits there. Until I figure out how to build the
63# .cab from an automated process (and I'm willing to consider silly
64# approaches such as a third-party CAB generator), I don't think I
65# can sensibly enable this build.
66
67#in puzzles do perl wceinf.pl wingames.lst > puzzles.inf
68#delegate windows
69# in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce clean'
70# in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce VER=-DREVISION=$(revision)'
71# # Nasty piece of sh here which saves the return code from cabwiz,
72# # outputs its errors and/or warnings, and then propagates the
73# # return code back to bob. If only cabwiz could output to
74# # standard error LIKE EVERY OTHER COMMAND-LINE UTILITY IN THE
75# # WORLD, I wouldn't have to do this.
76# in puzzles do cat puzzles.inf
77# in puzzles do cmd /c 'wcearmv4 & bash -c cabwiz puzzles.inf /err cabwiz.err /cpu ARMV4'; a=$$?; cat cabwiz.err; exit $$a
78# return puzzles/puzzles.armv4.cab
79#enddelegate
80
9bb2f5af 81# Build the help file and the HTML docs.
d09d659f 82in puzzles do make -f Makefile.doc clean # remove CHM-target HTML
83in puzzles do make -f Makefile.doc # and rebuild help file...
9bb2f5af 84in puzzles do mkdir doc
85in puzzles do mkdir devel
86in 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
87in 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
88
89# Move the deliver-worthy Windows binaries (those specified in
90# wingames.lst, which is generated by mkfiles.pl and helpfully
91# excludes the command-line auxiliary utilities such as solosolver,
92# and nullgame.exe) into a subdirectory for easy access.
93in puzzles do mkdir winbin
d09d659f 94in puzzles do mv `cut -f1 -d: wingames.lst` winbin
9bb2f5af 95
96# Make a zip file of the Windows binaries and help files.
97in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt
98
99# Create the source archive. (That writes the archive into the
100# _parent_ directory, so be careful when we deliver it.)
101in puzzles do ./makedist.sh $(revision)
102
103# Set up .htaccess containing a redirect for the archive filename.
104in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
105in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess
106in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess
0c315fc3 107in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess
a7b795ac 108in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.exe '$$1'puzzles-r$(revision)-installer.exe >> .htaccess
9bb2f5af 109
110# Phew, we're done. Deliver everything!
111deliver puzzles/icons/*-web.png $@
112deliver puzzles/winbin/*.exe $@
113deliver puzzles/.htaccess $@
114deliver puzzles/doc/*.html doc/$@
115deliver puzzles/devel/*.html devel/$@
116deliver puzzles/Puzzles.dmg $@
117deliver puzzles/puzzles.chm $@
118deliver puzzles/puzzles.hlp $@
119deliver puzzles/puzzles.cnt $@
120deliver puzzles/puzzles.zip $@
d09d659f 121deliver puzzles/Output/setup.exe puzzles-r$(revision)-installer.exe
c1549393 122
123# deliver puzzles/puzzles.armv4.cab $@ # (not built at the moment)
124
9bb2f5af 125# This one isn't in the puzzles subdir, because makedist.sh left it
126# one level up.
127deliver puzzles*.tar.gz $@