module puzzles
+# Start by substituting the right version number in configure.ac.
+in puzzles do perl -i~ -pe 's/rNNNN/r$(revision)/' configure.ac
+in puzzles do rm configure.ac~
+
# First build some local binaries, to run the icon build.
-in puzzles do perl mkfiles.pl
+in puzzles do perl mkfiles.pl -U
in puzzles do make
# Now build the screenshots and icons.
in puzzles/icons do xvfb-run -s "-screen 0 1024x768x24" make web winicons gtkicons
+# Destroy the local binaries and autoconf detritus, mostly to avoid
+# wasting network bandwidth by transferring them to the delegate
+# servers.
+in puzzles do make distclean
+
# Re-run mkfiles.pl now that it knows the icons are there.
in puzzles do perl mkfiles.pl
-# Destroy the local binaries, mostly to avoid wasting network
-# bandwidth by transferring them to the delegate servers.
-in puzzles do make clean
+# Rebuild the configure script.
+in puzzles do ./mkauto.sh
# Build the OS X .dmg archive.
-# 2012-04-03: commented out because my Mac is dead.
-#delegate osx
-# in puzzles do make -f Makefile.osx clean
-# in puzzles do make -f Makefile.osx release VER=-DREVISION=$(revision)
-# return puzzles/Puzzles.dmg
-#enddelegate
+delegate osx
+ in puzzles do make -f Makefile.osx clean
+ in puzzles do make -f Makefile.osx release VER=-DREVISION=$(revision)
+ return puzzles/Puzzles.dmg
+enddelegate
# Build the Windows binaries and installer, and the CHM file.
in puzzles do make -f Makefile.doc clean
in puzzles do make -f Makefile.doc chm
in puzzles do make -f Makefile.doc # build help file for installer
-in puzzles do perl winiss.pl $(revision) wingames.lst > puzzles.iss
+in puzzles do perl winiss.pl $(revision) gamedesc.txt > puzzles.iss
delegate windows
# Ignore the poorly controlled return value from HHC, and instead
# just test that the output file was generated.
# approaches such as a third-party CAB generator), I don't think I
# can sensibly enable this build.
-#in puzzles do perl wceinf.pl wingames.lst > puzzles.inf
+#in puzzles do perl wceinf.pl gamedesc.txt > puzzles.inf
#delegate windows
# in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce clean'
# in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce VER=-DREVISION=$(revision)'
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
# Move the deliver-worthy Windows binaries (those specified in
-# wingames.lst, which is generated by mkfiles.pl and helpfully
+# gamedesc.txt, which is generated by mkfiles.pl and helpfully
# excludes the command-line auxiliary utilities such as solosolver,
# and nullgame.exe) into a subdirectory for easy access.
in puzzles do mkdir winbin
-in puzzles do mv `cut -f1 -d: wingames.lst` winbin
+in puzzles do mv `cut -f2 -d: gamedesc.txt` winbin
# Make a zip file of the Windows binaries and help files.
in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt
ifneq "$(JAVA_UNFINISHED)" "" in puzzles do ln -s unfinished/group.R .
ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl mkfiles.pl
-# Build the Java applets. This requires .bob.conf on the master
-# build machine to have defined the variable NESTEDVM pointing at
-# the top-level directory of an installation of the NestedVM
-# compiler and tools.
-in puzzles do make -f Makefile.nestedvm NESTEDVM=$(NESTEDVM) VER=-DREVISION=$(revision)
+# Build the Java applets.
+delegate nestedvm
+ in puzzles do make -f Makefile.nestedvm NESTEDVM="$$NESTEDVM" VER=-DREVISION=$(revision)
+ return puzzles/*.jar
+enddelegate
+
+# Build the Javascript applets. Since my master build machine doesn't
+# have the right dependencies installed for Emscripten, I do this by a
+# delegation.
+in puzzles do mkdir js # so we can tell output .js files from emcc*.js
+delegate emscripten
+ in puzzles do make -f Makefile.emcc OUTPREFIX=js/ clean
+ in puzzles do make -f Makefile.emcc OUTPREFIX=js/
+ return puzzles/js/*.js
+enddelegate
# Set up .htaccess containing a redirect for the archive filename.
in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
deliver puzzles/.htaccess $@
deliver puzzles/doc/*.html doc/$@
deliver puzzles/devel/*.html devel/$@
-#deliver puzzles/Puzzles.dmg $@ # 2012-04-03 commented out, see above
+deliver puzzles/Puzzles.dmg $@
deliver puzzles/puzzles.chm $@
deliver puzzles/puzzles.hlp $@
deliver puzzles/puzzles.cnt $@
deliver puzzles/puzzles.zip $@
deliver puzzles/Output/setup.exe puzzles-r$(revision)-installer.exe
deliver puzzles/*.jar java/$@
+deliver puzzles/js/*.js js/$@
+deliver puzzles/html/*.html html/$@
+deliver puzzles/html/*.pl html/$@
# deliver puzzles/puzzles.armv4.cab $@ # (not built at the moment)