Find file
Fetching contributors…
Cannot retrieve contributors at this time
734 lines (673 sloc) 33.7 KB
<project name="moxiedev" default="usage">
<property file="${user.home}/moxiedev.properties"/>
<property environment="env"/>
<!-- =================================================================== -->
<!-- Help on usage -->
<!-- =================================================================== -->
<target name="usage">
<echo message=""/>
<echo message=""/>
<echo message="moxiedev Build instructions"/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=" available targets are:"/>
<echo message=""/>
<echo message=" benchmark --> run selected MiBench benchmarks"/>
<echo message=" build --> builds and installs in root dir"/>
<echo message=" arm-build --> builds and installs an arm-eabi toolchain in arm-root"/>
<echo message=" clean --> cleans tree of all generated files"/>
<echo message=" check --> runs all testsuites for moxie-elf tools"/>
<echo message=" check.binutils --> runs binutils/gas/ld testsuites for moxie-elf"/>
<echo message=" check.gcc --> runs gcc testsuite on the moxie simulator"/>
<echo message=" check.gdb --> runs gdb testsuite on the moxie simulator"/>
<echo message=" srpm --> create source RPM files for the tools"/>
<echo message=" usage --> provides help on using the build tool (default)"/>
<echo message=""/>
<echo message=" See comments inside the build.xml file for more details."/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=""/>
</target>
<!-- =================================================================== -->
<!-- Update dejagnu config file -->
<!-- =================================================================== -->
<target name="config.dejagnu">
<copy file="${basedir}/scripts/dejagnu/site.exp.in" tofile="${basedir}/scripts/dejagnu/site.exp" />
<replace file="${basedir}/scripts/dejagnu/site.exp" token="@DEJAGNUDIR@" value="${basedir}/scripts/dejagnu" />
</target>
<!-- =================================================================== -->
<!-- Clean the tree -->
<!-- =================================================================== -->
<target name="clean">
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd qemu; make distclean > /dev/null 2>&amp;1)"/>
</exec>
<exec executable="make">
<arg value="--directory=dtc"/>
<arg value="clean"/>
</exec>
<exec executable="make">
<arg value="--directory=linux-2.6"/>
<arg value="mrproper"/>
</exec>
<exec executable="make">
<arg value="--directory=uClibc"/>
<arg value="clean"/>
</exec>
<delete dir="dist"/>
<delete dir="root"/>
<delete dir="arm-root"/>
<delete dir="build"/>
<delete dir="arm-build"/>
<delete>
<fileset dir="." includes="**/*~"/>
<fileset dir="." includes="**/.#*~"/>
<fileset dir="." includes="*~"/>
</delete>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd benchmarks/MiBench; ./all__delete_work_dirs)"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Build arm-everything -->
<!-- =================================================================== -->
<target name="arm-build">
<mkdir dir="arm-root/usr"/>
<mkdir dir="arm-build/src"/>
<echo message="===================================================================="/>
<echo message="====== Running sanity check on build system ========================"/>
<echo message="===================================================================="/>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd arm-build; ../scripts/precheck/configure)"/>
</exec>
<available file="arm-build/FAIL" property="isFileAvail"/>
<fail if="isFileAvail" message="Sanity precheck test failed! Something is missing."/>
<echo message="===================================================================="/>
<echo message="====== Building binutils ==========================================="/>
<echo message="===================================================================="/>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd arm-build/src; ../../src/configure --target=arm-eabi --disable-gdbtk --prefix=`(cd ../../arm-root/usr; pwd)`)"/>
</exec>
<exec executable="make">
<arg value="--directory=arm-build/src"/>
<arg value="-j4"/>
<arg value="all-binutils"/>
<arg value="all-gas"/>
<arg value="all-ld"/>
<arg value="all-sim"/>
</exec>
<exec executable="make">
<arg value="--directory=arm-build/src"/>
<arg value="install-binutils"/>
<arg value="install-gas"/>
<arg value="install-ld"/>
<arg value="install-sim"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building initial gcc for newlib arm-build ======================="/>
<echo message="===================================================================="/>
<mkdir dir="arm-build/gcc"/>
<exec executable="sh">
<env key="PATH" path="${basedir}/arm-root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd arm-build/gcc; ../../gcc/configure --target=arm-eabi --prefix=`(cd ../../arm-root/usr; pwd)` --enable-languages=c --disable-libssp --with-newlib)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/arm-root/usr/bin:${env.PATH}"/>
<arg value="--directory=arm-build/gcc"/>
<arg value="-j4"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/arm-root/usr/bin:${env.PATH}"/>
<arg value="--directory=arm-build/gcc"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building newlib ============================================="/>
<echo message="===================================================================="/>
<exec executable="make">
<env key="PATH" path="${basedir}/arm-root/usr/bin:${env.PATH}"/>
<arg value="--directory=arm-build/src"/>
<arg value="all-target-newlib"/>
<arg value="install-target-newlib"/>
<arg value="CC_FOR_TARGET=arm-eabi-gcc"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/arm-root/usr/bin:${env.PATH}"/>
<arg value="--directory=arm-build/src"/>
<arg value="all-target-libgloss"/>
<arg value="install-target-libgloss"/>
<arg value="CC_FOR_TARGET=arm-eabi-gcc"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building full gcc ==========================================="/>
<echo message="===================================================================="/>
<exec executable="sh">
<env key="PATH" path="${basedir}/arm-root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd arm-build/gcc; ../../gcc/configure --target=arm-eabi --prefix=`(cd ../../arm-root/usr; pwd)` --enable-languages=c,c++ --disable-libssp --with-newlib --with-headers=`(cd ../../arm-root/usr/arm-eabi/include; pwd)`)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/arm-root/usr/bin:${env.PATH}"/>
<arg value="--directory=arm-build/gcc"/>
<arg value="-j4"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/arm-root/usr/bin:${env.PATH}"/>
<arg value="--directory=arm-build/gcc"/>
<arg value="install"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Build everything -->
<!-- =================================================================== -->
<target name="build">
<mkdir dir="root/usr/bin"/>
<mkdir dir="root/usr/moxie-rtems"/>
<mkdir dir="root/usr/moxie-uclinux"/>
<mkdir dir="build/src"/>
<echo message="===================================================================="/>
<echo message="====== Verify that all submodules have been updated ================"/>
<echo message="===================================================================="/>
<exec executable="sh">
<arg value="-c"/>
<arg value="./scripts/precheck/check-submodules"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Verify that PATH is sane ===================================="/>
<echo message="===================================================================="/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="./scripts/precheck/check-path ${basedir}"/>
</exec>
<available file="build/FAIL" property="isFileAvail"/>
<fail if="isFileAvail" message="Sanity precheck test failed!"/>
<echo message="===================================================================="/>
<echo message="====== Running sanity check on build system ========================"/>
<echo message="===================================================================="/>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd build; ../scripts/precheck/configure)"/>
</exec>
<available file="build/FAIL" property="isFileAvail"/>
<fail if="isFileAvail" message="Sanity precheck test failed! Something is missing."/>
<echo message="===================================================================="/>
<echo message="====== Building the device tree compiler, dtc ======================"/>
<echo message="===================================================================="/>
<exec executable="make">
<arg value="--directory=dtc"/>
<arg value="PREFIX=`(cd ../root/usr; pwd)`"/>
</exec>
<exec executable="make">
<arg value="--directory=dtc"/>
<arg value="PREFIX=`(cd ../root/usr; pwd)`"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building libelf ============================================="/>
<echo message="===================================================================="/>
<mkdir dir="build/libelf"/>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd build/libelf; ../../libelf/configure --prefix=`(cd ../../root/usr; pwd)` --disable-shared)"/>
</exec>
<exec executable="make">
<arg value="--directory=build/libelf"/>
</exec>
<exec executable="make">
<arg value="--directory=build/libelf"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building binutils ==========================================="/>
<echo message="===================================================================="/>
<exec executable="sh" searchpath="yes">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd build/src; echo $PATH; which dtc; ../../src/configure --target=moxie-elf --disable-gdbtk --prefix=`(cd ../../root/usr; pwd)`)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/src"/>
<arg value="-j4"/>
<arg value="all-binutils"/>
<arg value="all-gas"/>
<arg value="all-ld"/>
<arg value="all-sim"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/src"/>
<arg value="install-binutils"/>
<arg value="install-gas"/>
<arg value="install-ld"/>
<arg value="install-sim"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building initial gcc for newlib build ======================="/>
<echo message="===================================================================="/>
<mkdir dir="build/gcc-boot"/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd build/gcc-boot; ../../gcc/configure --target=moxie-elf --prefix=`(cd ../../root/usr; pwd)` --enable-languages=c --disable-libssp --disable-libquadmath --without-newlib --with-libelf=`(cd ../../root/usr; pwd)` --enable-lto )"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/gcc-boot"/>
<arg value="-j4"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/gcc-boot"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building newlib ============================================="/>
<echo message="===================================================================="/>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/src"/>
<arg value="all-target-newlib"/>
<arg value="all-target-libgloss"/>
<arg value="install-target-newlib"/>
<arg value="install-target-libgloss"/>
<arg value="CC_FOR_TARGET=moxie-elf-gcc"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building full gcc ==========================================="/>
<echo message="===================================================================="/>
<mkdir dir="build/gcc"/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd build/gcc; ../../gcc/configure --target=moxie-elf --prefix=`(cd ../../root/usr; pwd)` --enable-languages=c,c++ --disable-libssp --disable-libquadmath --with-newlib --with-headers=`(cd ../../root/usr/moxie-elf/include; pwd)` --with-libelf=`(cd ../../root/usr; pwd)` --enable-lto )"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/gcc"/>
<arg value="-j4"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/gcc"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building gdb ================================================"/>
<echo message="===================================================================="/>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/src"/>
<arg value="all-gdb"/>
<arg value="install-gdb"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building qemu ==============================================="/>
<echo message="===================================================================="/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd qemu; ./configure --prefix=`(cd ../root/usr; pwd)` --target-list=moxie-softmmu)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=qemu"/>
<arg value="-j4"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building u-boot ============================================="/>
<echo message="===================================================================="/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd u-boot; ./mkconfig moxiesim moxie moxie moxiesim)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=u-boot"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Installing uClinux headers =================================="/>
<echo message="===================================================================="/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd linux-2.6; cp arch/moxie/configs/nommu_defconfig arch/moxie/defconfig)"/>
</exec>
<replace file="${basedir}/linux-2.6/arch/moxie/defconfig" token="@ROOTFS@" value="${basedir}/initfs/uclinux/initramfs.txt" />
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=linux-2.6"/>
<arg value="ARCH=moxie"/>
<arg value="CROSS_COMPILE=moxie-elf-"/>
<arg value="defconfig"/>
</exec>
<mkdir dir="root/usr/moxie-uclinux/usr"/>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=linux-2.6"/>
<arg value="ARCH=moxie"/>
<arg value="CROSS_COMPILE=moxie-elf-"/>
<arg value="INSTALL_HDR_PATH=${basedir}/root/usr/moxie-uclinux/usr"/>
<arg value="headers_install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building uClibc ============================================"/>
<echo message="===================================================================="/>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=uClibc"/>
<arg value="ARCH=moxie"/>
<arg value="CROSS=moxie-elf-"/>
<arg value="defconfig"/>
</exec>
<replace file="${basedir}/uClibc/.config" token="/usr/include" value="${basedir}/root/usr/moxie-uclinux/usr/include" />
<replace file="${basedir}/uClibc/.config" token="/usr/$(TARGET_ARCH)-linux-uclibc/usr/" value="" />
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-j4"/>
<arg value="--directory=uClibc"/>
<arg value="ARCH=moxie"/>
<arg value="CROSS=moxie-elf-"/>
</exec>
<mkdir dir="root/usr/moxie-uclinux/usr/lib"/>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=uClibc"/>
<arg value="ARCH=moxie"/>
<arg value="CROSS_COMPILE=moxie-elf-"/>
<arg value="PREFIX=${basedir}/root/usr/moxie-uclinux/usr"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building binutils for rtems ================================="/>
<echo message="===================================================================="/>
<mkdir dir="build/src-rtems"/>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd build/src-rtems; ../../src/configure --target=moxie-rtems --disable-gdbtk --prefix=`(cd ../../root/usr; pwd)` --with-sysroot=`(cd ../../root/usr/moxie-rtems; pwd)`)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/src-rtems"/>
<arg value="-j4"/>
<arg value="all-binutils"/>
<arg value="all-gas"/>
<arg value="all-ld"/>
</exec>
<exec executable="make">
<arg value="--directory=build/src-rtems"/>
<arg value="install-binutils"/>
<arg value="install-gas"/>
<arg value="install-ld"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building binutils for uClinux ==============================="/>
<echo message="===================================================================="/>
<mkdir dir="build/src-uclinux"/>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd build/src-uclinux; ../../src/configure --target=moxie-uclinux --disable-gdbtk --prefix=`(cd ../../root/usr; pwd)` --with-sysroot=`(cd ../../root/usr/moxie-uclinux; pwd)`)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/src-uclinux"/>
<arg value="-j4"/>
<arg value="all-binutils"/>
<arg value="all-gas"/>
<arg value="all-ld"/>
</exec>
<exec executable="make">
<arg value="--directory=build/src-uclinux"/>
<arg value="install-binutils"/>
<arg value="install-gas"/>
<arg value="install-ld"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building elf2flt ============================================"/>
<echo message="===================================================================="/>
<mkdir dir="build/elf2flt"/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd build/elf2flt; ../../elf2flt/configure --prefix=`(cd ../../root/usr; pwd)` --target=moxie-uclinux --with-bfd-include-dir='`(cd ../src/bfd; pwd)` -I`(cd ../../src/include/; pwd)`' --with-libiberty=../gcc/libiberty/libiberty.a --with-libbfd=../src/bfd/libbfd.a)" />
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-j4"/>
<arg value="--directory=build/elf2flt"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/elf2flt"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building newlib for rtems ==================================="/>
<echo message="===================================================================="/>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-j1"/>
<arg value="--directory=build/src-rtems"/>
<arg value="all-target-newlib"/>
<arg value="all-target-libgloss"/>
<arg value="install-target-newlib"/>
<arg value="install-target-libgloss"/>
<arg value="CC_FOR_TARGET=${basedir}/scripts/moxie-rtems-gcc-wrapper"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building full rtems gcc ====================================="/>
<echo message="===================================================================="/>
<mkdir dir="build/gcc-rtems"/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd build/gcc-rtems; ../../gcc/configure --target=moxie-rtems --enable-threads=rtems --prefix=`(cd ../../root/usr; pwd)` --enable-languages=c --disable-libssp --disable-libquadmath --with-gnu-as --with-gnu-ld --with-newlib --with-libelf=`(cd ../../root/usr; pwd)` --enable-lto )"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/gcc-rtems"/>
<arg value="-j4"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/gcc-rtems"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building full uclinux gcc ==================================="/>
<echo message="===================================================================="/>
<mkdir dir="build/gcc-uclinux"/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd build/gcc-uclinux; ../../gcc/configure --target=moxie-uclinux --enable-threads --prefix=`(cd ../../root/usr; pwd)` --enable-languages=c,c++ --disable-libssp --disable-libquadmath --with-sysroot=`(cd ../../root/usr/moxie-uclinux; pwd)` --with-build-sysroot=`(cd ../../root/usr/moxie-uclinux; pwd)` --with-libelf=`(cd ../../root/usr; pwd)` --enable-lto )"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/gcc-uclinux"/>
<arg value="-j4"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/gcc-uclinux"/>
<arg value="install"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building BusyBox ============================================"/>
<echo message="===================================================================="/>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=busybox"/>
<arg value="oldconfig"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=busybox"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building initfs for uClinux ================================="/>
<echo message="===================================================================="/>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd initfs/uclinux; cp initramfs.txt.in initramfs.txt)"/>
</exec>
<replace file="${basedir}/initfs/uclinux/initramfs.txt" token="@TOP@" value="${basedir}" />
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=initfs/uclinux/src"/>
<arg value="-j4"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building uClinux ============================================"/>
<echo message="===================================================================="/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd linux-2.6; cp arch/moxie/configs/nommu_defconfig arch/moxie/defconfig)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=linux-2.6"/>
<arg value="ARCH=moxie"/>
<arg value="CROSS_COMPILE=moxie-elf-"/>
<arg value="vmlinux"/>
</exec>
<echo message="===================================================================="/>
<echo message="====== Building rtems =============================================="/>
<echo message="===================================================================="/>
<mkdir dir="build/rtems"/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd rtems; ./bootstrap)"/>
</exec>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="-c"/>
<arg value="(cd build/rtems; ../../rtems/configure --enable-testsuites=samples --target=moxie-rtems --prefix=`(cd ../../root/usr; pwd)`)"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/rtems"/>
<arg value="RTEMS_BSP=moxiesim"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<arg value="--directory=build/rtems"/>
<arg value="install"/>
<arg value="RTEMS_BSP=moxiesim"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Run the gcc testsuite on the moxie simulator -->
<!-- =================================================================== -->
<target name="check.gcc" depends="config.dejagnu">
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<env key="DEJAGNU" path="${basedir}/scripts/dejagnu/site.exp"/>
<arg value="--directory=build/gcc/gcc"/>
<arg value="check"/>
<arg value="RUNTESTFLAGS=--target_board moxie-sim ${expfile}"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Run the gdb testsuite on the moxie simulator -->
<!-- =================================================================== -->
<target name="check.gdb" depends="config.dejagnu">
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<env key="DEJAGNU" path="${basedir}/scripts/dejagnu/site.exp"/>
<arg value="--directory=build/src/gdb"/>
<arg value="check"/>
<arg value="RUNTESTFLAGS=--target_board moxie-sim ${expfile}"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Run the binutils/gas/ld testsuite on the moxie simulator -->
<!-- =================================================================== -->
<target name="check.binutils" depends="config.dejagnu">
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<env key="DEJAGNU" path="${basedir}/scripts/dejagnu/site.exp"/>
<arg value="--directory=build/src/binutils"/>
<arg value="check"/>
<arg value="RUNTESTFLAGS=--target_board moxie-sim ${expfile}"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<env key="DEJAGNU" path="${basedir}/scripts/dejagnu/site.exp"/>
<arg value="--directory=build/src/gas"/>
<arg value="check"/>
<arg value="RUNTESTFLAGS=--target_board moxie-sim ${expfile}"/>
</exec>
<exec executable="make">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<env key="DEJAGNU" path="${basedir}/scripts/dejagnu/site.exp"/>
<arg value="--directory=build/src/ld"/>
<arg value="check"/>
<arg value="RUNTESTFLAGS=--target_board moxie-sim ${expfile}"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Run all moxie-elf tools testsuites -->
<!-- =================================================================== -->
<target name="check" depends="check.binutils,check.gcc,check.gdb"/>
<!-- =================================================================== -->
<!-- Run selected MiBench benchmarks -->
<!-- =================================================================== -->
<target name="benchmark">
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd benchmarks/MiBench; ./all__delete_work_dirs)"/>
</exec>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd benchmarks/MiBench; ./all__create_work_dirs)"/>
</exec>
<!-- Delete the benchmarks we aren't going to run -->
<!-- This benchmark SEGVs with datasets > 1. Out of memory? -->
<delete dir="benchmarks/MiBench/automotive_susan_c/src_work"/>
<!-- These next benchmarks requires more of an OS than newlib provides. -->
<delete dir="benchmarks/MiBench/consumer_lame/src_work"/>
<delete dir="benchmarks/MiBench/consumer_mad/src_work"/>
<delete dir="benchmarks/MiBench/network_patricia/src_work"/>
<delete dir="benchmarks/MiBench/office_ghostscript/src_work"/>
<delete dir="benchmarks/MiBench/office_ispell/src_work"/>
<delete dir="benchmarks/MiBench/office_rsynth/src_work"/>
<delete dir="benchmarks/MiBench/security_pgp_d/src_work"/>
<delete dir="benchmarks/MiBench/security_pgp_e/src_work"/>
<delete dir="benchmarks/MiBench/telecom_gsm/src_work"/>
<!-- These next two benchmark currently SEGV. -->
<delete dir="benchmarks/MiBench/automotive_susan_e/src_work"/>
<delete dir="benchmarks/MiBench/telecom_adpcm_c/src_work"/>
<delete dir="benchmarks/MiBench/telecom_adpcm_d/src_work"/>
<!-- There's a data error with these benchmarks. -->
<delete dir="benchmarks/MiBench/consumer_tiff2bw/src_work"/>
<delete dir="benchmarks/MiBench/consumer_tiff2rgba/src_work"/>
<delete dir="benchmarks/MiBench/consumer_tiffdither/src_work"/>
<delete dir="benchmarks/MiBench/consumer_tiffmedian/src_work"/>
<exec executable="sh">
<env key="PATH" path="${basedir}/root/usr/bin:${env.PATH}"/>
<env key="DATASETS" value="3"/>
<arg value="-c"/>
<arg value="(cd benchmarks/MiBench; ./all_run)"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Create SRPMs -->
<!-- =================================================================== -->
<target name="srpm">
<exec executable="sh">
<arg value="-c"/>
<arg value="./scripts/mksrpm.sh"/>
</exec>
</target>
</project>