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