JAVAC_NODEBUG_FLAGS = -g:none
endif
-bcel_jar = upstream/build/bcel-5.1/bcel-5.1.jar
-classpath = build:$(bcel_jar)
+CLASSGEN_PATH = upstream/build/classgen/build
+classpath = build:$(CLASSGEN_PATH)
GCJ = gcj
EXE_EXT =
$(java_classes): build/org/ibex/nestedvm/util/.Dummy.class
endif
-$(java_classes): $(java_sources) $(bcel_jar)
+$(java_classes): $(java_sources) $(tasks)/build_darcs_classgen
$(JAVAC) -classpath $(classpath) -d build $(java_sources)
-$(bcel_jar): upstream/tasks/extract_bcel
- @true
-
# GCJ Stuff
# FIXME: We're cramming more than we need into the binary here
build/mips2java$(EXE_EXT): $(java_sources) $(java_gen_sources)
@echo 'CFLAGS="$(mips_optflags)"; export CFLAGS' >> $@~
@echo 'CXXFLAGS="$(mips_optflags)"; export CXXFLAGS' >> $@~
@echo 'LDFLAGS="$(MIPS_LDFLAGS)"; export LDFLAGS' >> $@~
- @echo 'CLASSPATH=$(mips2java_root)/build:$(mips2java_root)/$(bcel_jar):.; export CLASSPATH' >> $@~
+ @echo 'CLASSPATH=$(mips2java_root)/build:$(mips2java_root)/upstream/build/classgen/build:.; export CLASSPATH' >> $@~
@mv "$@~" "$@"
@echo "$@ created successfully"
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
+compact_runtime_compiler.jar: $(java_classes) .manifest $(tasks)/build_darcs_gcclass
mkdir -p tmp/pruned
- java -cp upstream/build/gcclass/build:$(bcel_jar) com.brian_web.gcclass.GCClass \
- build tmp/pruned \
+ rm -rf tmp/pruned/*
+ java -cp \
+ upstream/build/gcclass/build:upstream/build/gcclass/upstream/bcel-5.1/bcel-5.1.jar \
+ com.brian_web.gcclass.GCClass \
+ $(classpath) 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' \
url_openbsdglob = http://www.brianweb.net/xwt/openbsdglob.tar.gz
url_regex = ftp://ftp.zoo.toronto.edu/pub/regex.shar
-version_bcel = 5.1
-url_bcel = http://mirrors.mix5.com/apache/jakarta/bcel/binaries/bcel-$(version_bcel).tar.gz
-
url_linpack = http://www.math.iastate.edu/burkardt/f_src/linpack_bench/linpack_bench.f
+darcs_gcclass = http://darcs.brianweb.net/gcclass
+darcs_classgen = http://darcs.brianweb.net/classgen
+
.SECONDARY: # This is broken in gmake < 3.79.1
upstream = $(shell pwd)
cross_root := $(usr)/mips-unknown-elf
libc_a := $(cross_root)/lib/libc.a
+tasks/download_%:
+ if [ -z "$(url_$*)" ]; then echo "No url for $*" >&2; false; fi
+ mkdir -p download
+ cd download && wget --passive-ftp -N $(url_$*)
+ touch $@
+
+tasks/extract_%: tasks/download_%
+ mkdir -p build
+ cd build && \
+ gzip -dc ../download/$*-$(version_$*).tar.gz | $(TAR) -xf - && \
+ rm -f $* && \
+ ln -s $*-$(version_$*) $*
+ touch $@
+
+tasks/extract_darcs_%:
+ mkdir -p build
+ if [ -z "$(darcs_$*)" ]; then echo "No darcs url for $*" >&2; false; fi
+ cd build && darcs get --verbose "$(darcs_$*)"
+ touch $@
+
+update_darcs_%: tasks/extract_darcs_%
+ cd "build/$*" && darcs pull
+ rm "tasks/build_darcs_$*" # to force a rebuild
+
+tasks/build_darcs_%: tasks/extract_darcs_%
+ cd "build/$*" && make
+ touch $@
+
tasks/build_extraheaders: $(upstream)/misc/extraheaders.sh tasks/build_newlib
# Add extra nestedvm specific headers to include
cd $(cross_root)/include && sh $<
touch $@
-tasks/build_libc: tasks/build_newlib tasks/build_extraheaders tasks/build_regex tasks/build_openbsdglob
+tasks/build_libc: tasks/build_newlib tasks/build_extraheaders tasks/build_regex tasks/build_openbsdglob misc/extraheaders.sh $(patsubst %,$(root)/build/org/ibex/nestedvm/%.o, crt0 support support_aux)
# HACK: Get the top level makefile to build the support stuff
$(MAKE) -s -C $(root) $(patsubst %,build/org/ibex/nestedvm/%.o, crt0 support support_aux)
rm -f "tasks/build_$*" "tasks/patch_$*" "tasks/extract_$*"
-tasks/download_%:
- if [ -z "$(url_$*)" ]; then echo "No url for $*" >&2; false; fi
- mkdir -p download
- cd download && wget --passive-ftp -N $(url_$*)
- touch $@
-
tasks/download_gcc: tasks/download_gcc-core tasks/download_gcc-c++ tasks/download_gcc-g77
touch $@
cd build/busybox && $(MAKE) LDFLAGS="$(MIPS_LDFLAGS)" CFLAGS_EXTRA="$(MIPS_CFLAGS) -DNESTEDVM -g"
touch $@
-tasks/build_gcclass:
- cd build && darcs get --verbose http://darcs.brianweb.net/gcclass
- cd build/gcclass && make
- touch $@
-
# TeX Stuff
tasks/extract_tex_tangle: