#! /bin/sh # Generate files for all apps, # maybe build all apps, # and produce a report listing differences from checked in copies. # # NOTE: This script doesn't rm -rf the previous run since it can run # different tests. If you want to start fresh, rm -rf tmp-all yourself. set -e trap "echo ERROR: $(date)" 0 echo "Starting gen-all: $(date)" cgen_cpus="cris fr30 frv ip2k iq2000 lm32 m32c m32r mep mt \ openrisc sh64 xc16x xstormy16" do_config=no do_build=no do_intrinsics=no do_sim=no do_diffs=no for a in "$@" do case $a in config) do_config=yes ;; build) do_build=yes ;; src) do_src=yes ;; intrinsics) do_intrinsics=yes ;; sim) do_sim=yes ;; diffs) do_diffs=yes ;; all) do_config=yes do_build=yes do_src=yes do_intrinsics=yes do_sim=yes do_diffs=yes ;; *) echo "Invalid option: $a" >&2 ; exit 1 ;; esac done mkdir -p tmp-all cd tmp-all build_dir=$(pwd) # Paths to src,gcc relative to ${build_dir}. src=../../../src gcc=../../../gcc cpu=m32r build_sys=$(sh ${src}/config.guess) host_sys=${build_sys} target_sys=${cpu}-elf prefix=${build_dir}/rel/${cpu} if [ "${do_src}" = "yes" ] then echo "Building src $(date)" mkdir -p tmp-src ( set -e cd tmp-src if [ -f Makefile ] then true # already configured elif [ "${do_config}" = "yes" ] then echo "Configuring: $(date)" ../${src}/configure \ --build=${build_sys} \ --host=${host_sys} \ --target=${target_sys} \ --enable-targets=all \ --enable-shared \ --enable-cgen-maint \ --enable-languages=c fi if [ "${do_build}" = "yes" ] then echo "Building: $(date)" if [ ! -f Makefile ] then echo "Tree hasn't been configured." exit 1 fi make -j3 all-binutils all-gas all-ld all-gdb all-sid # SID doesn't support --enable-cgen-maint, sigh. (cd sid/component/cgen-cpu && make cgen-all) if [ $? != 0 ] ; then exit 1 ; fi make -j3 all-sid fi ) if [ $? != 0 ] ; then exit 1 ; fi fi if [ "${do_intrinsics}" = "yes" ] then (cd .. && sh ./gen-all-intrinsics ${build_dir}/${gcc}) if [ $? != 0 ] ; then exit 1 ; fi fi if [ "${do_sim}" = "yes" ] then for cpu in ${cgen_cpus} do echo "Building $cpu sim $(date)" mkdir -p tmp-sim-${cpu} ( set -e cd tmp-sim-${cpu} target_sys="${cpu}-elf" if [ -f Makefile ] then true # already configured elif [ "${do_config}" = "yes" ] then echo "Configuring: $(date)" ../${src}/configure \ --build=${build_sys} \ --host=${host_sys} \ --target=${target_sys} \ --enable-cgen-maint \ --enable-languages=c fi if [ "${do_build}" = "yes" ] then echo "Building: $(date)" if [ ! -f Makefile ] then echo "Tree hasn't been configured." exit 1 fi make -j3 all-sim fi ) if [ $? != 0 ] ; then exit 1 ; fi done fi if [ "${do_diffs}" = "yes" ] then # NOTE: cvs will return with a non-zero exit code if there are diffs. (cd ${src}/opcodes && cvs diff -du >${build_dir}/opcodes.diffs) (cd ${src}/sim && cvs diff -du >${build_dir}/sim.diffs) (cd ${src}/sid/component/cgen-cpu && cvs diff -du >${build_dir}/sid.diffs) (cd ${gcc}/gcc/config/mep && svn diff -x -u >${build_dir}/gcc.diffs) fi echo "Ending gen-all: $(date)" trap "" 0