-runtime_util_classes = SeekableData SeekableByteArray SeekableFile SeekableInputStream
-runtime_classes = Runtime Registers UsermodeConstants $(runtime_util_classes:%=util/%)
-unixruntime_classes = $(runtime_classes) UnixRuntime
-
-runtime.jar: $(runtime_classes:%=build/org/xwt/mips/%.class)
- cd build && jar cf ../$@ $(runtime_classes:%=org/xwt/mips/%*.class)
-
-unixruntime.jar: $(unixruntime_classes:%=build/org/xwt/mips/%.class)
- cd build && jar cf ../$@ $(unixruntime_classes:%=org/xwt/mips/%*.class)
+runtime_classes = Runtime Registers UsermodeConstants util/Seekable
+
+tex.jar: $(mips_objects) $(runtime_classes:%=build/org/ibex/nestedvm/%.class) build/tests/TeX.class
+ echo -e "Manifest-Version: 1.0\nMain-Class: Tex\n" > .manifest
+ cp upstream/build/tex/TeX.class build
+ cd build && jar cfm ../$@ ../.manifest \
+ $(runtime_classes:%=org/ibex/nestedvm/%.class) \
+ org/ibex/nestedvm/Runtime\$$*.class \
+ org/ibex/nestedvm/util/Seekable\$$*.class
+
+runtime.jar: $(runtime_classes:%=build/org/ibex/nestedvm/%.class)
+ cd build && jar cf ../$@ \
+ $(runtime_classes:%=org/ibex/nestedvm/%.class) \
+ org/ibex/nestedvm/Runtime\$$*.class \
+ org/ibex/nestedvm/util/Seekable\$$*.class
+
+.manifest:
+ echo -ne "Manifest-Version: 1.0\nMain-Class: org.ibex.nestedvm.RuntimeCompiler\n" > $@
+
+nestedvm.jar: $(java_classes) .manifest
+ cd build && jar cfm ../$@ ../.manifest $(java_classes:build/%.class=%*.class)
+
+compact_runtime_compiler.jar: $(java_classes) .manifest $(tasks)/build_gcclass
+ mkdir -p tmp/pruned
+ java -cp upstream/build/gcclass/build:$(bcel_jar) com.brian_web.gcclass.GCClass \
+ build tmp/pruned \
+ org.ibex.nestedvm.RuntimeCompiler.main 'org.ibex.nestedvm.Runtime.decodeData' \
+ 'org.ibex.nestedvm.UnixRuntime.<init>' 'org.ibex.nestedvm.Runtime.initPages' \
+ 'org.ibex.nestedvm.Runtime.clearPages' 'org.ibex.nestedvm.Runtime.syscall' \
+ 'org.ibex.nestedvm.Runtime$$CPUState.dup'
+ cd tmp/pruned && jar cfm ../../$@ ../../.manifest .