2 # Generate files for all apps,
3 # maybe build all apps,
4 # and produce a report listing differences from checked in copies.
6 # NOTE: This script doesn't rm -rf the previous run since it can run
7 # different tests. If you want to start fresh, rm -rf tmp-all yourself.
10 trap "echo ERROR: $(date)" 0
12 echo "Starting gen-all: $(date)"
14 cgen_cpus="cris fr30 frv ip2k iq2000 lm32 m32c m32r mep mt \
15 openrisc sh64 xc16x xstormy16"
25 config) do_config=yes ;;
26 build) do_build=yes ;;
28 intrinsics) do_intrinsics=yes ;;
30 diffs) do_diffs=yes ;;
39 *) echo "Invalid option: $a" >&2 ; exit 1 ;;
47 # Paths to src,gcc relative to ${build_dir}.
52 build_sys=$(sh ${src}/config.guess)
56 prefix=${build_dir}/rel/${cpu}
58 if [ "${do_src}" = "yes" ]
60 echo "Building src $(date)"
67 true # already configured
68 elif [ "${do_config}" = "yes" ]
70 echo "Configuring: $(date)"
72 --build=${build_sys} \
74 --target=${target_sys} \
75 --enable-targets=all \
80 if [ "${do_build}" = "yes" ]
82 echo "Building: $(date)"
85 echo "Tree hasn't been configured."
91 if [ $? != 0 ] ; then exit 1 ; fi
94 if [ "${do_intrinsics}" = "yes" ]
96 (cd .. && sh ./gen-all-intrinsics ${build_dir}/${gcc})
97 if [ $? != 0 ] ; then exit 1 ; fi
100 if [ "${do_sim}" = "yes" ]
102 for cpu in ${cgen_cpus}
104 echo "Building $cpu sim $(date)"
105 mkdir -p tmp-sim-${cpu}
109 target_sys="${cpu}-elf"
112 true # already configured
113 elif [ "${do_config}" = "yes" ]
115 echo "Configuring: $(date)"
116 ../${src}/configure \
117 --build=${build_sys} \
119 --target=${target_sys} \
120 --enable-cgen-maint \
123 if [ "${do_build}" = "yes" ]
125 echo "Building: $(date)"
128 echo "Tree hasn't been configured."
134 if [ $? != 0 ] ; then exit 1 ; fi
138 if [ "${do_diffs}" = "yes" ]
140 # NOTE: cvs will return with a non-zero exit code if there are diffs.
141 (cd ${src}/opcodes && cvs diff -du >${build_dir}/opcodes.diffs)
142 (cd ${src}/sim && cvs diff -du >${build_dir}/sim.diffs)
143 (cd ${src}/sid/component/cgen-cpu && cvs diff -du >${build_dir}/sid.diffs)
144 (cd ${gcc}/gcc/config/mep && svn diff -x -u >${build_dir}/gcc.diffs)
147 echo "Ending gen-all: $(date)"