From: brian Date: Sun, 4 Apr 2004 21:27:15 +0000 (-0700) Subject: usr variable for build process X-Git-Tag: merge~45 X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=commitdiff_plain;h=2127ae8abd0f5f574618d78fa02b9dd3045431f6 usr variable for build process darcs-hash:20040404212715-24bed-8eb3ea011308ae7ea9a384d38f142baa302c8c81.gz --- diff --git a/Makefile b/Makefile index a24c223..9e5f04a 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,8 @@ mips_objects = $(mips_sources:%.c=build/org/xwt/mips/%.o) $(mips_asm_sources:%.s .SECONDARY: -PATH := $(mips2java_root)/upstream/install/bin:$(PATH) +usr = $(mips2java_root)/upstream/install +PATH := $(usr)/bin:$(PATH) export PATH # @@ -79,15 +80,15 @@ all: build/mips2java$(EXE_EXT) $(mips_objects) endif $(tasks)/%: - $(MAKE) -C upstream tasks/$* MIPS_LDFLAGS="$(MIPS_LDFLAGS)" MIPS_CFLAGS="$(flags) $(mips_optflags)" + $(MAKE) -C upstream tasks/$* usr="$(usr)" MIPS_LDFLAGS="$(MIPS_LDFLAGS)" MIPS_CFLAGS="$(flags) $(mips_optflags)" upstream_clean_%: - $(MAKE) -C upstream clean_$* + $(MAKE) -C upstream clean_$* usr="$(usr)" -errno_h = upstream/install/mips-unknown-elf/include/sys/errno.h +errno_h = $(usr)/mips-unknown-elf/include/sys/errno.h $(errno_h): $(tasks)/build_newlib -unistd_h = upstream/install/mips-unknown-elf/include/sys/unistd.h +unistd_h = $(usr)/mips-unknown-elf/include/sys/unistd.h $(unistd_h): $(tasks)/build_newlib # @@ -102,8 +103,8 @@ build/org/xwt/mips/util/.Dummy.class: $(java_classes): build/org/xwt/mips/util/.Dummy.class endif -$(java_classes): $(tasks)/unpack_bcel $(java_sources) $(java_gen_sources) - $(JAVAC) -classpath $(CLASSPATH) -d build $(java_sources) $(java_gen_sources) +$(java_classes): $(java_sources) $(java_gen_sources) $(bcel_jar) + $(JAVAC) -classpath $(classpath) -d build $(java_sources) $(java_gen_sources) build/org/xwt/mips/UsermodeConstants.java: src/org/xwt/mips/syscalls.h $(errno_h) $(unistd_h) @mkdir -p `dirname $@` @@ -152,15 +153,15 @@ build/%.mips.stripped: build/%.mips # MIPS Compiler generated class compilation ifdef DO_JAVASOURCE -build/%.java: build/%.mips build/org/xwt/mips/JavaSourceCompiler.class $(tasks)/unpack_bcel - $(JAVA) -cp $(CLASSPATH) org.xwt.mips.Compiler -outformat javasource $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $< > build/$*.java +build/%.java: build/%.mips build/org/xwt/mips/JavaSourceCompiler.class + $(JAVA) -cp $(classpath) org.xwt.mips.Compiler -outformat javasource $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $< > build/$*.java build/%.class: build/%.java build/org/xwt/mips/Runtime.class $(JAVAC) $(JAVAC_NODEBUG_FLAGS) -classpath build -d build $< else -build/%.class: build/%.mips build/org/xwt/mips/ClassFileCompiler.class $(tasks)/unpack_bcel - $(JAVA) -cp $(CLASSPATH) org.xwt.mips.Compiler -outformat class -outfile $@ $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $< +build/%.class: build/%.mips build/org/xwt/mips/ClassFileCompiler.class + $(JAVA) -cp $(classpath) org.xwt.mips.Compiler -outformat class -outfile $@ $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $< endif @@ -175,9 +176,9 @@ clean: # # env.sh # -env.sh: Makefile $(tasks)/full_toolchain build/org/xwt/mips/Compiler.class $(tasks)/unpack_bcel +env.sh: Makefile $(tasks)/full_toolchain build/org/xwt/mips/Compiler.class @rm -f "$@~" - @echo 'PATH="$(mips2java_root)/build:$(mips2java_root)/upstream/install/bin:$$PATH"; export PATH' >> $@~ + @echo 'PATH="$(mips2java_root)/build:$(usr)/bin:$$PATH"; export PATH' >> $@~ @echo 'CC=mips-unknown-elf-gcc; export CC' >> $@~ @echo 'CXX=mips-unknown-elf-g++; export CXX' >> $@~ @echo 'AS=mips-unknown-elf-as; export AS' >> $@~ diff --git a/upstream/Makefile b/upstream/Makefile index d525669..e633ef7 100644 --- a/upstream/Makefile +++ b/upstream/Makefile @@ -27,9 +27,9 @@ url_bcel = http://mirrors.mix5.com/apache/jakarta/bcel/binaries/bcel-$(version_b upstream = $(shell pwd) root = $(shell dirname "`pwd`") -prefix = $(upstream)/install +usr = $(upstream)/install -PATH := $(prefix)/bin:$(PATH) +PATH := $(usr)/bin:$(PATH) export PATH # Solaris' patch doesn't work, use gnu patch on solaris @@ -42,9 +42,9 @@ tasks/build_gcc: tasks/build_binutils tasks/build_newlib: tasks/build_gcc tasks/build_libc: tasks/build_newlib tasks/build_regex tasks/build_openbsdglob - rm -f install/mips-unknown-elf/lib/crt0.o - ln -s $(root)/build/org/xwt/mips/crt0.o install/mips-unknown-elf/lib/crt0.o - echo '#include ' > install/mips-unknown-elf/include/getopt.h + rm -f $(usr)/mips-unknown-elf/lib/crt0.o + ln -s $(root)/build/org/xwt/mips/crt0.o $(usr)/mips-unknown-elf/lib/crt0.o + echo '#include ' > $(usr)/mips-unknown-elf/include/getopt.h touch $@ clean_%: @@ -82,44 +82,44 @@ tasks/patch_%: tasks/extract_% touch $@ tasks/build_%: tasks/patch_% - mkdir -p install - @[ "$*" = "newlib" ] && rm -f install/mips-unknown-elf/lib/crt0.o || true + mkdir -p $(usr) + @[ "$*" = "newlib" ] && rm -f $(usr)/mips-unknown-elf/lib/crt0.o || true mkdir -p build/$*-obj && cd build/$*-obj && \ - ../$*-$(version_$*)/configure --prefix=$(prefix) $(configure_$*) && \ + ../$*-$(version_$*)/configure --prefix=$(usr) $(configure_$*) && \ $(MAKE) TARGET_CFLAGS="$(MIPS_CFLAGS)" && \ $(MAKE) install touch $@ tasks/build_gcc_step2: tasks/patch_gcc tasks/build_libc - mkdir -p install + mkdir -p $(usr) mkdir -p build/gcc-obj && cd build/gcc-obj && \ - ../gcc-$(version_gcc)/configure --prefix=$(prefix) $(configure_gcc_step2) && \ + ../gcc-$(version_gcc)/configure --prefix=$(usr) $(configure_gcc_step2) && \ $(MAKE) TARGET_CFLAGS="$(MIPS_CFLAGS)" && \ $(MAKE) install touch $@ tasks/build_openbsdglob: tasks/download_openbsdglob tasks/build_newlib - @mkdir -p install/mips-unknown-elf/{include,lib} + @mkdir -p $(usr)/mips-unknown-elf/{include,lib} cd build && gzip -dc ../download/openbsdglob.tar.gz | tar xf - cd build/openbsdglob && \ mips-unknown-elf-gcc '-Dissetugid()=0' -DARG_MAX=65536 $(MIPS_CFLAGS) -I. -c -o glob.o glob.c && \ mips-unknown-elf-gcc -O2 -Wall -Werror -I. -c -o fnmatch.o fnmatch.c && \ mips-unknown-elf-ar cr libglob.a *.o && \ mips-unknown-elf-ranlib libglob.a && \ - cp *.h ../../install/mips-unknown-elf/include && \ - cp *.a ../../install/mips-unknown-elf/lib + cp *.h $(usr)/mips-unknown-elf/include && \ + cp *.a $(usr)/mips-unknown-elf/lib touch $@ tasks/build_regex: tasks/download_regex tasks/build_newlib - @mkdir -p install/mips-unknown-elf/{include,lib} + @mkdir -p $(usr)/mips-unknown-elf/{include,lib} mkdir -p build/regex build/regex/fake cd build/regex && \ sh ../../download/regex.shar && \ make CC=mips-unknown-elf-gcc CFLAGS="-I. $(MIPS_CFLAGS)" regcomp.o regexec.o regerror.o regfree.o && \ mips-unknown-elf-ar cr libregex.a regcomp.o regexec.o regerror.o regfree.o && \ mips-unknown-elf-ranlib libregex.a && \ - cp regex.h ../../install/mips-unknown-elf/include && \ - cp libregex.a ../../install/mips-unknown-elf/lib + cp regex.h $(usr)/mips-unknown-elf/include && \ + cp libregex.a $(usr)/mips-unknown-elf/lib touch $@