+runtime_classes = Runtime Registers UsermodeConstants util/Seekable
+unix_runtime_classes = $(runtime_classes) UnixRuntime util/Platform util/InodeCache
+
+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
+
+unix_runtime.jar: $(unix_runtime_classes:%=build/org/ibex/nestedvm/%.class)
+ cd build && jar cf ../$@ \
+ $(unix_runtime_classes:%=org/ibex/nestedvm/%.class) \
+ org/ibex/nestedvm/Runtime\$$*.class \
+ org/ibex/nestedvm/util/Seekable\$$*.class \
+ org/ibex/nestedvm/UnixRuntime\$$*.class \
+ org/ibex/nestedvm/util/Platform\$$*.class \
+ org/ibex/nestedvm/util/Sort*.class
+
+.manifest:
+ printf "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)
+ cd $(CLASSGEN_PATH) && jar uf $(mips2java_root)/$@ .
+
+.gcclass_hints: $(java_sources)
+ sed -n 's/.*GCCLASS_HINT: \([^ ]*\) \([^ ]*\).*/hint:\1:\2/p' $(java_sources) > $@
+
+compact_runtime_compiler.jar: $(java_classes) .manifest $(tasks)/build_darcs_gcclass .gcclass_hints
+ mkdir -p tmp/pruned
+ rm -rf tmp/pruned/*
+ $(JAVA) -cp \
+ upstream/build/gcclass/build:upstream/build/gcclass/upstream/bcel-5.2/bcel-5.2.jar \
+ com.brian_web.gcclass.GCClass \
+ "$(classpath)" tmp/pruned org.ibex.nestedvm.RuntimeCompiler.main `cat .gcclass_hints`
+ cd tmp/pruned && jar cfm ../../$@ ../../.manifest .
+
+sizecheck: compact_runtime_compiler.jar
+ @for c in `find tmp/pruned -name '*.class'|fgrep -v '$$'`; do \
+ for f in `echo $$c|sed 's,\.class$$,,;'`*.class; do gzip -c $$f; done | wc -c | tr -d '\n'; \
+ echo -e "\t`echo $$c | sed 's,tmp/pruned/org/ibex,,;s,\.class$$,,;s,/,.,g;'`"; \
+ done | sort -rn | awk '{ sum += $$1; print } END { print sum,"Total"; }'