From: brian Date: Thu, 27 May 2004 06:53:21 +0000 (-0700) Subject: new classgen part 1 X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=commitdiff_plain;h=3175eeed074a015d5621de59c0fa877d4efe5112 new classgen part 1 darcs-hash:20040527065321-24bed-5997af243f7213c546cfa1b253657f892a62e714.gz --- diff --git a/Makefile b/Makefile index e85ec6d..3b64f3b 100644 --- a/Makefile +++ b/Makefile @@ -51,8 +51,8 @@ else 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 = @@ -100,12 +100,9 @@ build/org/ibex/nestedvm/util/.Dummy.class: $(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) @@ -187,7 +184,7 @@ env.sh: Makefile $(tasks)/build_gcc $(tasks)/build_libc build/org/ibex/nestedvm/ @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" @@ -217,10 +214,13 @@ runtime.jar: $(runtime_classes:%=build/org/ibex/nestedvm/%.class) 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.' 'org.ibex.nestedvm.Runtime.initPages' \ 'org.ibex.nestedvm.Runtime.clearPages' 'org.ibex.nestedvm.Runtime.syscall' \ diff --git a/upstream/Makefile b/upstream/Makefile index 648fd17..37d42b5 100644 --- a/upstream/Makefile +++ b/upstream/Makefile @@ -29,11 +29,11 @@ configure_newlib = --enable-multilib --target=mips-unknown-elf 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) @@ -53,12 +53,40 @@ tasks/build_newlib: tasks/build_gcc 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) @@ -82,12 +110,6 @@ clean_%: 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 $@ @@ -277,11 +299,6 @@ tasks/build_busybox: tasks/patch_busybox tasks/build_libc 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: