-# The `nullgame' source file is a largely blank one, which contains
-# all the correct function definitions to compile and link, but
-# which defines the null game in which nothing is ever drawn and
-# there are no valid moves. Its main purpose is to act as a
-# template for writing new game definition source files. I include
-# it in the Makefile because it will be worse than useless if it
-# ever fails to compile, so it's important that it should actually
-# be built on a regular basis.
-nullgame : [X] gtk COMMON nullgame
-nullgame : [G] WINDOWS COMMON nullgame
+!begin am
+bin_PROGRAMS = $(GAMES)
+!end
+!begin am_begin
+GAMES =
+!end
+
+# make install for Unix.
+!begin gtk
+install:
+ for i in $(GAMES); do \
+ $(INSTALL_PROGRAM) -m 755 $(BINPREFIX)$$i $(DESTDIR)$(gamesdir)/$(BINPREFIX)$$i \
+ || exit 1; \
+ done
+!end
+!begin nestedvm
+.PRECIOUS: %.class
+%.class: %.mips
+ java -cp $(NESTEDVM)/build:$(NESTEDVM)/upstream/build/classgen/build \
+ org.ibex.nestedvm.Compiler -outformat class -d . \
+ PuzzleEngine $<
+ mv PuzzleEngine.class $@
+
+org:
+ mkdir -p org/ibex/nestedvm/util
+ cp $(NESTEDVM)/build/org/ibex/nestedvm/Registers.class org/ibex/nestedvm
+ cp $(NESTEDVM)/build/org/ibex/nestedvm/UsermodeConstants.class org/ibex/nestedvm
+ cp $(NESTEDVM)/build/org/ibex/nestedvm/Runtime*.class org/ibex/nestedvm
+ cp $(NESTEDVM)/build/org/ibex/nestedvm/util/Platform*.class org/ibex/nestedvm/util
+ cp $(NESTEDVM)/build/org/ibex/nestedvm/util/Seekable*.class org/ibex/nestedvm/util
+ echo "Main-Class: PuzzleApplet" >applet.manifest
+
+PuzzleApplet.class: PuzzleApplet.java org
+ javac -source 1.3 -target 1.3 PuzzleApplet.java
+
+%.jar: %.class PuzzleApplet.class org
+ mv $< PuzzleEngine.class
+ jar cfm $@ applet.manifest PuzzleEngine.class PuzzleApplet*.class org
+ echo '<applet archive="'$@'" code="PuzzleApplet" width="700" height="500"></applet>' >$*.html
+ mv PuzzleEngine.class $<
+!end
+
+# A benchmarking and testing target for the GTK puzzles.
+!begin gtk
+test: benchmark.html benchmark.txt
+
+benchmark.html: benchmark.txt benchmark.pl
+ ./benchmark.pl benchmark.txt > $@
+
+benchmark.txt: benchmark.sh $(GAMES)
+ ./benchmark.sh > $@
+
+!end
+!begin am
+test: benchmark.html benchmark.txt
+
+benchmark.html: benchmark.txt benchmark.pl
+ ./benchmark.pl benchmark.txt > $@
+
+benchmark.txt: benchmark.sh $(GAMES)
+ ./benchmark.sh > $@
+!end