OSDN Git Service

contrib:
[pf3gnuchains/gcc-fork.git] / gcc / config / arm / genopt.sh
1 #!/bin/sh
2 # Generate arm-tables.opt from the lists in *.def.
3 # Copyright (C) 2011 Free Software Foundation, Inc.
4 #
5 # This file is part of GCC.
6 #
7 # GCC is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
10 # any later version.
11 #
12 # GCC is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with GCC; see the file COPYING3.  If not see
19 # <http://www.gnu.org/licenses/>.
20
21 cat <<EOF
22 ; -*- buffer-read-only: t -*-
23 ; Generated automatically by genopt.sh from arm-cores.def and arm-arches.def.
24
25 ; Copyright (C) 2011 Free Software Foundation, Inc.
26 ;
27 ; This file is part of GCC.
28 ;
29 ; GCC is free software; you can redistribute it and/or modify it under
30 ; the terms of the GNU General Public License as published by the Free
31 ; Software Foundation; either version 3, or (at your option) any later
32 ; version.
33 ;
34 ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
35 ; WARRANTY; without even the implied warranty of MERCHANTABILITY or
36 ; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
37 ; for more details.
38 ;
39 ; You should have received a copy of the GNU General Public License
40 ; along with GCC; see the file COPYING3.  If not see
41 ; <http://www.gnu.org/licenses/>.
42
43 Enum
44 Name(processor_type) Type(enum processor_type)
45 Known ARM CPUs (for use with the -mcpu= and -mtune= options):
46
47 EOF
48
49 awk -F'[(,      ]+' '/^ARM_CORE/ {
50     name = $2
51     enum = $3
52     gsub("\"", "", name)
53     print "EnumValue"
54     print "Enum(processor_type) String(" name ") Value(" enum ")"
55     print ""
56 }' $1/arm-cores.def
57
58 cat <<EOF
59 Enum
60 Name(arm_arch) Type(int)
61 Known ARM architectures (for use with the -march= option):
62
63 EOF
64
65 awk -F'[(,      ]+' 'BEGIN {
66     value = 0
67 }
68 /^ARM_ARCH/ {
69     name = $2
70     gsub("\"", "", name)
71     print "EnumValue"
72     print "Enum(arm_arch) String(" name ") Value(" value ")"
73     print ""
74     value++
75 }' $1/arm-arches.def