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."
88 make -j3 all-binutils all-gas all-ld all-gdb all-sid
89 # SID doesn't support --enable-cgen-maint, sigh.
90 (cd sid/component/cgen-cpu && make cgen-all)
91 if [ $? != 0 ] ; then exit 1 ; fi
95 if [ $? != 0 ] ; then exit 1 ; fi
98 if [ "${do_intrinsics}" = "yes" ]
100 (cd .. && sh ./gen-all-intrinsics ${build_dir}/${gcc})
101 if [ $? != 0 ] ; then exit 1 ; fi
104 if [ "${do_sim}" = "yes" ]
106 for cpu in ${cgen_cpus}
108 echo "Building $cpu sim $(date)"
109 mkdir -p tmp-sim-${cpu}
113 target_sys="${cpu}-elf"
116 true # already configured
117 elif [ "${do_config}" = "yes" ]
119 echo "Configuring: $(date)"
120 ../${src}/configure \
121 --build=${build_sys} \
123 --target=${target_sys} \
124 --enable-cgen-maint \
127 if [ "${do_build}" = "yes" ]
129 echo "Building: $(date)"
132 echo "Tree hasn't been configured."
138 if [ $? != 0 ] ; then exit 1 ; fi
142 if [ "${do_diffs}" = "yes" ]
144 # NOTE: cvs will return with a non-zero exit code if there are diffs.
145 (cd ${src}/opcodes && cvs diff -du >${build_dir}/opcodes.diffs)
146 (cd ${src}/sim && cvs diff -du >${build_dir}/sim.diffs)
147 (cd ${src}/sid/component/cgen-cpu && cvs diff -du >${build_dir}/sid.diffs)
148 (cd ${gcc}/gcc/config/mep && svn diff -x -u >${build_dir}/gcc.diffs)
151 echo "Ending gen-all: $(date)"