9bb2f5af |
1 | # -*- sh -*- |
2 | # Build script to build Puzzles. |
3 | |
452ce003 |
4 | module puzzles |
5 | |
9bb2f5af |
6 | # First build some local binaries, to run the icon build. |
7 | in puzzles do perl mkfiles.pl |
8 | in puzzles do make |
9 | |
10 | # Now build the screenshots and icons. |
d66add28 |
11 | in puzzles/icons do xvfb-run -s "-screen 0 1024x768x24" make web winicons gtkicons |
9bb2f5af |
12 | |
30c61de3 |
13 | # Re-run mkfiles.pl now that it knows the icons are there. |
14 | in 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. |
18 | in puzzles do make clean |
19 | |
20 | # Build the OS X .dmg archive. |
64010fc4 |
21 | # 2012-04-03: commented out because my Mac is dead. |
22 | #delegate osx |
23 | # in puzzles do make -f Makefile.osx clean |
24 | # in puzzles do make -f Makefile.osx release VER=-DREVISION=$(revision) |
25 | # return puzzles/Puzzles.dmg |
26 | #enddelegate |
9bb2f5af |
27 | |
d09d659f |
28 | # Build the Windows binaries and installer, and the CHM file. |
9bb2f5af |
29 | in puzzles do make -f Makefile.doc clean |
30 | in puzzles do make -f Makefile.doc chm |
d09d659f |
31 | in puzzles do make -f Makefile.doc # build help file for installer |
32 | in puzzles do perl winiss.pl $(revision) wingames.lst > puzzles.iss |
9bb2f5af |
33 | delegate windows |
34 | # Ignore the poorly controlled return value from HHC, and instead |
35 | # just test that the output file was generated. |
36 | in puzzles do hhc puzzles.hhp; test -f puzzles.chm |
37 | # FIXME: Cygwin alternative? |
38 | in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc clean' |
1310cbd2 |
39 | in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc VER=-DREVISION=$(revision)' |
d09d659f |
40 | # Build installer. |
41 | in puzzles do iscc puzzles.iss |
9bb2f5af |
42 | return puzzles/puzzles.chm |
43 | return puzzles/*.exe |
d09d659f |
44 | return puzzles/Output/setup.exe |
9bb2f5af |
45 | enddelegate |
f5e722f7 |
46 | in puzzles do chmod +x *.exe |
9bb2f5af |
47 | |
c1549393 |
48 | # Build the Pocket PC binaries and CAB. |
49 | # |
50 | # NOTE: This part of the build script requires the Windows delegate |
51 | # server to have the cabwiz program on its PATH. This will |
52 | # typically be at |
53 | # |
54 | # C:\Program Files\Windows CE Tools\WCE420\POCKET PC 2003\Tools |
55 | # |
56 | # but it might not be if you've installed it somewhere else, or |
57 | # have a different version. |
58 | # |
59 | # NOTE ALSO: This part of the build is commented out, for the |
60 | # moment, because cabwiz does unhelpful things when run from within |
61 | # a bob delegate process (or, more generally, when run from any |
62 | # terminal-based remote login to a Windows machine, including |
63 | # Cygwin opensshd and Windows Telnet). The symptom is that cabwiz |
64 | # just beeps and sits there. Until I figure out how to build the |
65 | # .cab from an automated process (and I'm willing to consider silly |
66 | # approaches such as a third-party CAB generator), I don't think I |
67 | # can sensibly enable this build. |
68 | |
69 | #in puzzles do perl wceinf.pl wingames.lst > puzzles.inf |
70 | #delegate windows |
71 | # in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce clean' |
72 | # in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce VER=-DREVISION=$(revision)' |
73 | # # Nasty piece of sh here which saves the return code from cabwiz, |
74 | # # outputs its errors and/or warnings, and then propagates the |
75 | # # return code back to bob. If only cabwiz could output to |
76 | # # standard error LIKE EVERY OTHER COMMAND-LINE UTILITY IN THE |
77 | # # WORLD, I wouldn't have to do this. |
78 | # in puzzles do cat puzzles.inf |
79 | # in puzzles do cmd /c 'wcearmv4 & bash -c cabwiz puzzles.inf /err cabwiz.err /cpu ARMV4'; a=$$?; cat cabwiz.err; exit $$a |
80 | # return puzzles/puzzles.armv4.cab |
81 | #enddelegate |
82 | |
9bb2f5af |
83 | # Build the help file and the HTML docs. |
d09d659f |
84 | in puzzles do make -f Makefile.doc clean # remove CHM-target HTML |
85 | in puzzles do make -f Makefile.doc # and rebuild help file... |
9bb2f5af |
86 | in puzzles do mkdir doc |
87 | in puzzles do mkdir devel |
88 | 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 |
89 | 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 |
90 | |
91 | # Move the deliver-worthy Windows binaries (those specified in |
92 | # wingames.lst, which is generated by mkfiles.pl and helpfully |
93 | # excludes the command-line auxiliary utilities such as solosolver, |
94 | # and nullgame.exe) into a subdirectory for easy access. |
95 | in puzzles do mkdir winbin |
d09d659f |
96 | in puzzles do mv `cut -f1 -d: wingames.lst` winbin |
9bb2f5af |
97 | |
98 | # Make a zip file of the Windows binaries and help files. |
99 | in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt |
100 | |
101 | # Create the source archive. (That writes the archive into the |
102 | # _parent_ directory, so be careful when we deliver it.) |
103 | in puzzles do ./makedist.sh $(revision) |
104 | |
08bf2626 |
105 | ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl -i~ -pe 'print "!srcdir unfinished/\n" if /!srcdir icons/' Recipe |
106 | ifneq "$(JAVA_UNFINISHED)" "" in puzzles do ln -s unfinished/group.R . |
107 | ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl mkfiles.pl |
108 | |
d4eef073 |
109 | # Build the Java applets. This requires .bob.conf on the master |
110 | # build machine to have defined the variable NESTEDVM pointing at |
111 | # the top-level directory of an installation of the NestedVM |
112 | # compiler and tools. |
b5a922e9 |
113 | in puzzles do make -f Makefile.nestedvm NESTEDVM=$(NESTEDVM) VER=-DREVISION=$(revision) |
d4eef073 |
114 | |
9bb2f5af |
115 | # Set up .htaccess containing a redirect for the archive filename. |
116 | in puzzles do echo "AddType application/octet-stream .chm" > .htaccess |
117 | in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess |
118 | in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess |
0c315fc3 |
119 | in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess |
a7b795ac |
120 | in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.exe '$$1'puzzles-r$(revision)-installer.exe >> .htaccess |
9bb2f5af |
121 | |
122 | # Phew, we're done. Deliver everything! |
123 | deliver puzzles/icons/*-web.png $@ |
124 | deliver puzzles/winbin/*.exe $@ |
125 | deliver puzzles/.htaccess $@ |
126 | deliver puzzles/doc/*.html doc/$@ |
127 | deliver puzzles/devel/*.html devel/$@ |
64010fc4 |
128 | #deliver puzzles/Puzzles.dmg $@ # 2012-04-03 commented out, see above |
9bb2f5af |
129 | deliver puzzles/puzzles.chm $@ |
130 | deliver puzzles/puzzles.hlp $@ |
131 | deliver puzzles/puzzles.cnt $@ |
132 | deliver puzzles/puzzles.zip $@ |
d09d659f |
133 | deliver puzzles/Output/setup.exe puzzles-r$(revision)-installer.exe |
d4eef073 |
134 | deliver puzzles/*.jar java/$@ |
c1549393 |
135 | |
136 | # deliver puzzles/puzzles.armv4.cab $@ # (not built at the moment) |
137 | |
9bb2f5af |
138 | # This one isn't in the puzzles subdir, because makedist.sh left it |
139 | # one level up. |
140 | deliver puzzles*.tar.gz $@ |