-gpc := $(usr)/bin/mips-unknown-elf-gpc
-gpc_flags := --big-endian -w -lgpc -lc $(usr)/mips-unknown-elf/lib/support*.o
-gpc_flags += -Wl,-T,$(usr)/mips-unknown-elf/lib/linker.ld
-g77 := $(usr)/bin/mips-unknown-elf-g77
-g77_flags := --big-endian -w -lg2c -lc $(usr)/mips-unknown-elf/lib/support*.o
-g77_flags += -Wl,-T,$(usr)/mips-unknown-elf/lib/linker.ld
-
-# FIXME ugly path hacks evil bad
-nestedvm := java -cp $(usr)/../build/bcel/bcel-5.1.jar:$(usr)/../../build org.ibex.nestedvm.Compiler -outformat class
-
-tasks/download_tex: ; mkdir -p build/tex; touch $@
-build/tex/tex.web: ; curl -o $@ http://www.math.uni.wroc.pl/~hebisch/tex_p/tex.web
-build/dtex/tangle.p: ; curl http://www.gnu-pascal.de/crystal/gpc/en/attachments/5593/tangle.p.gz | zcat > $@
-tasks/extract_tex: build/tex/tex.web build/tex/tangle.p; touch $@
-
-build/tex/tangle.mips: build/tex/tangle.p tasks/full_toolchain tasks/extract_tex tasks/build_gcc_step2
- cd build/tex; $(gpc) tangle.p $(gpc_flags) -o tangle.mips
-build/tex/Tangle.class: build/tex/tangle.mips
- $(nestedvm) -o unixruntime -outfile $@ Tangle $<
-build/tex/tex.p: build/tex/tex.web build/tex/tex.ch build/tex/Tangle.class
- rm -f build/tex/tex.p build/tex/tex.pool
- cd build/tex; java -cp .:$(usr)/../../build Tangle \
- --gpc-rts=-nPascalfile:tex.p \
- --gpc-rts=-npool:tex.pool \
- --gpc-rts=-nwebfile:tex.web \
- --gpc-rts=-nchangefile:tex.ch
-build/tex/tex.mips: build/tex/tex.p tasks/full_toolchain tasks/build_gcc_step2
- cd build/tex; $(gpc) tex.p $(gpc_flags) -o tex.mips
-tasks/build_tex: build/tex/tex.mips
- cd build/tex; $(nestedvm) -o unixruntime -outfile TeX.class TeX tex.mips
- touch $@
-tasks/extract_texinputs: tasks/build_tex tasks/download_texinputs
- cd build/tex; tar xvzf ../../download/texinputs-1.0.tgz
- touch $@
-tasks/extract_linpack: tasks/download_linpack ; touch $@
-tasks/download_linpack:
- mkdir -p build/linpack
- cd build/linpack; wget -N http://www.math.iastate.edu/burkardt/f_src/linpack_bench/linpack_bench.f
- touch $@
-
-tasks/build_linpack: tasks/full_toolchain tasks/extract_linpack
- cd build/linpack; $(g77) linpack_bench.f $(g77_flags) -o linpack.mips
- cd build/linpack; $(nestedvm) -o unixruntime -outfile Linpack.class Linpack linpack.mips
- touch $@
-
-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++
- touch $@
-
-tasks/extract_%: tasks/download_%
- mkdir -p build
- cd build && \
- gzip -dc ../download/$*-$(version_$*).tar.gz | tar xf - && \
- rm -f $* && \
- ln -s $*-$(version_$*) $*