X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=Makefile.upstream;fp=upstream%2FMakefile;h=46f6c5d7318c19f80d802eb41de6b338220df6a2;hp=0c76cc31dbf5d08e06ff687fddc4a48866b9d024;hb=60fefa9ae5acd22f8eeb95a6f6a59c700af155b6;hpb=bc9dd4abbcef277698861a1666f9a747e51d5d2f diff --git a/upstream/Makefile b/Makefile.upstream similarity index 51% rename from upstream/Makefile rename to Makefile.upstream index 0c76cc3..46f6c5d 100644 --- a/upstream/Makefile +++ b/Makefile.upstream @@ -3,8 +3,8 @@ # The XWT upstream code Makefile # -# upstream packages we need -packages := jikes-1.18 binutils-2.13.2.1 newlib-1.11.0 w32api-2.3 mingw-runtime-3.0 freetype-2.1.4 gcc-3.3 jpeg-6b +# deal with Apple's brokenness +setcc := CC="$(patsubst Darwin,/usr/bin/gcc3 -no-cpp-precomp,$(findstring Darwin,$(shell uname)))" # where to get stuff url_newlib-1.11.0 := ftp://sources.redhat.com/pub/newlib/newlib-1.11.0.tar.gz @@ -16,6 +16,9 @@ url_gcc-3.3 := http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc url_jpeg-6b := http://www.ijg.org/files/jpegsrc.v6b.tar.gz url_jikes-1.18 := http://www.megacz.com/tmp/jikes-1.18.tgz #ftp://www-126.ibm.com/pub/jikes/1.18/jikes-1.18.tar.gz +# building gcc requires binutils +configure_gcc-3.3: binutils-2.13.2.1 .configure_gcc-3.3 + # how to configure it configure_gcc-3.3 := --enable-languages=c,c++,java --enable-gc-type=boehm --disable-shared --disable-jvmpi configure_gcc-3.3 += --disable-java-awt --disable-interpreter --enable-static @@ -26,6 +29,48 @@ configure_gcc-3.3-i686-pc-linux-gnu := --enable-threads=posix --enable-hash- configure_gcc-3.3-sparc-sun-solaris2.7 := --enable-threads=posix --disable-multilib configure_gcc-3.3-mips := --enable-languages=c --nfp --with-newlib=yes --enable-multilib --disable-threads +# vendor-supplied binaries and headers; this is stuff that comes with various OSes +vendor: .vendor +.vendor: + curl http://www.megacz.com/vendor.tgz | tar xzf - -C upstream/install + curl $(url_w32api-2.3) | tar xzf - -C upstream/install/i686-pc-mingw32 + curl $(url_mingw-runtime-3.0) | tar xzf - -C upstream/install/i686-pc-mingw32 + touch .vendor + +download_%: .download_% +.download_%: + echo -e "\ndownloading %..." + mkdir -p upstream/$* + curl $(url_$*) | tar xzf - -C upstream/$* + mv upstream/$*/$* upstream/$*/src; true + (test -e upstream/$*/patches && cd upstream/$*/src && for A in ../patches/*.patch; do patch -p0 < $$A; done); true + touch $@ + +configure_%: .configure_% +.configure_%: download_% + echo -e "\nconfiguring %..." + mkdir -p $*/build-$(target) + cd -p $*/build-$(target); \ + $(setcc) ../src/configure \ + --target=$(target) \ + --prefix=`pwd`/../../install \ + $(configure_$*) \ + $(configure_$*)-$(target) + touch $@ + +install_%: .install_% +.install_%: configure_% + echo -e "\nbuilding $*..." + cd upstream/$*/build-$(target); $(setcc) PATH=$$PATH:`pwd`/../../install/bin make + echo -e "\ninstalling $*..." + cd upstream/$*/build-$(target); $(setcc) PATH=$$PATH:`pwd`/../../install/bin make install + touch $@ + +.install_freetype-2.1.4: download_freetype-2.1.4 install_binutils-2.13.2.1 install_gcc-3.3 + cd upstream/freetype-2.1.4/src; make setup ansi; PATH=$$PATH:`pwd`/../install/bin make CC=mips-gcc AR=mips-ar + ../install/bin/mips-ranlib freetype-2.1.4/objs/libfreetype.a + touch $@ + # jikes has a special target to autodetect a pre-installed jikes, and to autodetect the JVM's $CLASSPATH .jikes: echo "#!/bin/sh" > .jikes @@ -43,62 +88,3 @@ configure_gcc-3.3-mips := --enable-languages=c --nfp --with-new echo 'for A in `find build/class -name \*.class`; do test -e $$A.old && rm $$A.old; done' >> .jikes echo 'exit $$EXIT' >> .jikes chmod +x .jikes - -# make the package's directory (if it doesn't exist) -$(packages): - mkdir -p $@ install - -.headers: - curl http://www.megacz.com/upstream.tgz | tar xzf - -C upstream/install - touch .headers - -# if the make target was specified in $(package)-$(target) format, break it apart and recurse -$(packages:%=%-$(target)): %-$(target): % - make $