-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen-all-desc
99 lines (86 loc) · 2.23 KB
/
gen-all-desc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#! /bin/sh
# Utility script to generate basic description files for all ports.
# The main purpose of this script is to have a script that will
# exercise loading of all the ports.
#
# Copyright 2012 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
#
# Run this script in the src/cgen directory.
# Exit on any error.
set -e
# For debugging.
set -x
# List of top-level .cpu files of all ports.
# ??? Some are missing: ia32, ia64
# Need to add them after some research.
# NOTE: Some of these ports are incomplete.
archs="
cpu/fr30.cpu
cpu/arm.cpu
../cpu/cris.cpu
../cpu/frv.cpu
cpu/i960.cpu
cpu/ip2k.cpu
../cpu/iq2000.cpu
../cpu/lm32.cpu
../cpu/m32c.cpu
../cpu/m32r.cpu
cpu/m68k.cpu
cpu/mep.cpu
../cpu/mt.cpu
cpu/openrisc.cpu
cpu/powerpc.cpu
cpu/sh.cpu
cpu/sparc.cpu
../cpu/xc16x.cpu
cpu/xstormy16.cpu
"
if [ ! -f opcodes.scm ]
then
echo "Not in the src/cgen directory." >& 2
exit 1
fi
export builddir=tmp-desc
rm -rf $builddir
mkdir $builddir
export cgendir=`pwd`
(
set -e
set -x
cd $builddir
$cgendir/configure --prefix /tmp/junk --target m32r-elf
for a in $archs
do
archfile=../$a
arch=$(basename $archfile .cpu)
# FIXME: Seems like this shouldn't be needed. Could be wrong though.
ISAS="all"
MACHS="all"
case $arch in
arm) ISAS="arm" ;;
sh) ISAS="media" ;;
sparc) MACHS="sparc-v9" ;; # FIXME: ugh, would rather select on isa
esac
if make desc ARCH=$arch ARCHFILE=$archfile ISAS="$ISAS" MACHS="$MACHS" \
CGENFLAGS='-b -v'
then
echo "File generation for $arch succeeded."
else
echo "ERROR: File generation for $arch failed."
fi
done
)