2 # Build script to build Puzzles.
6 # Start by substituting the right version number in configure.ac.
7 in puzzles do perl -i~ -pe 's/rNNNN/r$(revision)/' configure.ac
8 in puzzles do rm configure.ac~
10 # First build some local binaries, to run the icon build.
11 in puzzles do perl mkfiles.pl -U
14 # Now build the screenshots and icons.
15 in puzzles/icons do xvfb-run -s "-screen 0 1024x768x24" make web winicons gtkicons
17 # Destroy the local binaries and autoconf detritus, mostly to avoid
18 # wasting network bandwidth by transferring them to the delegate
20 in puzzles do make distclean
22 # Re-run mkfiles.pl now that it knows the icons are there.
23 in puzzles do perl mkfiles.pl
25 # Rebuild the configure script.
26 in puzzles do ./mkauto.sh
28 # Build the OS X .dmg archive.
29 # 2012-04-03: commented out because my Mac is dead.
31 # in puzzles do make -f Makefile.osx clean
32 # in puzzles do make -f Makefile.osx release VER=-DREVISION=$(revision)
33 # return puzzles/Puzzles.dmg
36 # Build the Windows binaries and installer, and the CHM file.
37 in puzzles do make -f Makefile.doc clean
38 in puzzles do make -f Makefile.doc chm
39 in puzzles do make -f Makefile.doc # build help file for installer
40 in puzzles do perl winiss.pl $(revision) gamedesc.txt > puzzles.iss
42 # Ignore the poorly controlled return value from HHC, and instead
43 # just test that the output file was generated.
44 in puzzles do hhc puzzles.hhp; test -f puzzles.chm
45 # FIXME: Cygwin alternative?
46 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc clean'
47 in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc VER=-DREVISION=$(revision)'
49 in puzzles do iscc puzzles.iss
50 return puzzles/puzzles.chm
52 return puzzles/Output/setup.exe
54 in puzzles do chmod +x *.exe
56 # Build the Pocket PC binaries and CAB.
58 # NOTE: This part of the build script requires the Windows delegate
59 # server to have the cabwiz program on its PATH. This will
62 # C:\Program Files\Windows CE Tools\WCE420\POCKET PC 2003\Tools
64 # but it might not be if you've installed it somewhere else, or
65 # have a different version.
67 # NOTE ALSO: This part of the build is commented out, for the
68 # moment, because cabwiz does unhelpful things when run from within
69 # a bob delegate process (or, more generally, when run from any
70 # terminal-based remote login to a Windows machine, including
71 # Cygwin opensshd and Windows Telnet). The symptom is that cabwiz
72 # just beeps and sits there. Until I figure out how to build the
73 # .cab from an automated process (and I'm willing to consider silly
74 # approaches such as a third-party CAB generator), I don't think I
75 # can sensibly enable this build.
77 #in puzzles do perl wceinf.pl gamedesc.txt > puzzles.inf
79 # in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce clean'
80 # in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce VER=-DREVISION=$(revision)'
81 # # Nasty piece of sh here which saves the return code from cabwiz,
82 # # outputs its errors and/or warnings, and then propagates the
83 # # return code back to bob. If only cabwiz could output to
84 # # standard error LIKE EVERY OTHER COMMAND-LINE UTILITY IN THE
85 # # WORLD, I wouldn't have to do this.
86 # in puzzles do cat puzzles.inf
87 # in puzzles do cmd /c 'wcearmv4 & bash -c cabwiz puzzles.inf /err cabwiz.err /cpu ARMV4'; a=$$?; cat cabwiz.err; exit $$a
88 # return puzzles/puzzles.armv4.cab
91 # Build the help file and the HTML docs.
92 in puzzles do make -f Makefile.doc clean # remove CHM-target HTML
93 in puzzles do make -f Makefile.doc # and rebuild help file...
94 in puzzles do mkdir doc
95 in puzzles do mkdir devel
96 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
97 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
99 # Move the deliver-worthy Windows binaries (those specified in
100 # gamedesc.txt, which is generated by mkfiles.pl and helpfully
101 # excludes the command-line auxiliary utilities such as solosolver,
102 # and nullgame.exe) into a subdirectory for easy access.
103 in puzzles do mkdir winbin
104 in puzzles do mv `cut -f2 -d: gamedesc.txt` winbin
106 # Make a zip file of the Windows binaries and help files.
107 in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt
109 # Create the source archive. (That writes the archive into the
110 # _parent_ directory, so be careful when we deliver it.)
111 in puzzles do ./makedist.sh $(revision)
113 ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl -i~ -pe 'print "!srcdir unfinished/\n" if /!srcdir icons/' Recipe
114 ifneq "$(JAVA_UNFINISHED)" "" in puzzles do ln -s unfinished/group.R .
115 ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl mkfiles.pl
117 # Build the Java applets.
119 in puzzles do make -f Makefile.nestedvm NESTEDVM="$$NESTEDVM" VER=-DREVISION=$(revision)
123 # Build the Javascript applets. Since my master build machine doesn't
124 # have the right dependencies installed for Emscripten, I do this by a
126 in puzzles do mkdir js # so we can tell output .js files from emcc*.js
128 in puzzles do make -f Makefile.emcc OUTPREFIX=js/ clean
129 in puzzles do make -f Makefile.emcc OUTPREFIX=js/
130 return puzzles/js/*.js
133 # Set up .htaccess containing a redirect for the archive filename.
134 in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
135 in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess
136 in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess
137 in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess
138 in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.exe '$$1'puzzles-r$(revision)-installer.exe >> .htaccess
140 # Phew, we're done. Deliver everything!
141 deliver puzzles/icons/*-web.png $@
142 deliver puzzles/winbin/*.exe $@
143 deliver puzzles/.htaccess $@
144 deliver puzzles/doc/*.html doc/$@
145 deliver puzzles/devel/*.html devel/$@
146 #deliver puzzles/Puzzles.dmg $@ # 2012-04-03 commented out, see above
147 deliver puzzles/puzzles.chm $@
148 deliver puzzles/puzzles.hlp $@
149 deliver puzzles/puzzles.cnt $@
150 deliver puzzles/puzzles.zip $@
151 deliver puzzles/Output/setup.exe puzzles-r$(revision)-installer.exe
152 deliver puzzles/*.jar java/$@
153 deliver puzzles/js/*.js js/$@
154 deliver puzzles/html/*.html html/$@
155 deliver puzzles/html/*.pl html/$@
157 # deliver puzzles/puzzles.armv4.cab $@ # (not built at the moment)
159 # This one isn't in the puzzles subdir, because makedist.sh left it
161 deliver puzzles*.tar.gz $@