.SECONDARY:
-PATH := $(mips2java_root)/upstream/install/bin:$(PATH)
+usr = $(mips2java_root)/upstream/install
+PATH := $(usr)/bin:$(PATH)
export PATH
#
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
#
$(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 $@`
# 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
#
# 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' >> $@~
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
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 <unistd.h>' > 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 <unistd.h>' > $(usr)/mips-unknown-elf/include/getopt.h
touch $@
clean_%:
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 $@