annotate gcc/config/arc/genoptions.awk @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1 # Copyright (C) 2016-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
2 #
kono
parents:
diff changeset
3 # This file is part of GCC.
kono
parents:
diff changeset
4 #
kono
parents:
diff changeset
5 # GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
6 # the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
7 # Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
8 # version.
kono
parents:
diff changeset
9 #
kono
parents:
diff changeset
10 # GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
13 # for more details.
kono
parents:
diff changeset
14 #
kono
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
16 # along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
17 # <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 ##################################################################
kono
parents:
diff changeset
20 #
kono
parents:
diff changeset
21 # This file is using AVR's genmultilib.awk idea.
kono
parents:
diff changeset
22 #
kono
parents:
diff changeset
23 ##################################################################
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 BEGIN {
kono
parents:
diff changeset
26 FS ="[(, \t)]+"
kono
parents:
diff changeset
27 comment = 1
kono
parents:
diff changeset
28 n_cores = 0
kono
parents:
diff changeset
29 }
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 ##################################################################
kono
parents:
diff changeset
32 # Add some Comments to the generated Files and copy-paste
kono
parents:
diff changeset
33 # Copyright Notice from above.
kono
parents:
diff changeset
34 ##################################################################
kono
parents:
diff changeset
35 /^#/ {
kono
parents:
diff changeset
36 if (!comment)
kono
parents:
diff changeset
37 next
kono
parents:
diff changeset
38 else if (comment == 1)
kono
parents:
diff changeset
39 {
kono
parents:
diff changeset
40 if (FORMAT == "Makefile")
kono
parents:
diff changeset
41 {
kono
parents:
diff changeset
42 print "; Auto-generated Makefile Snip"
kono
parents:
diff changeset
43 print "; Generated by : ./gcc/config/arc/genoptions.awk"
kono
parents:
diff changeset
44 print "; Generated from : ./gcc/config/arc/arc-cpu.def"
kono
parents:
diff changeset
45 print ";"
kono
parents:
diff changeset
46 }
kono
parents:
diff changeset
47 }
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 comment = 2;
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 gsub ("^#", ";", $0)
kono
parents:
diff changeset
52 print
kono
parents:
diff changeset
53 }
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 /^$/ {
kono
parents:
diff changeset
56 # The first empty line stops copy-pasting the GPL comments
kono
parents:
diff changeset
57 # from this file to the generated file.
kono
parents:
diff changeset
58 comment = 0
kono
parents:
diff changeset
59 }
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 /^ARC_CPU/ {
kono
parents:
diff changeset
62 name = $2
kono
parents:
diff changeset
63 cores[n_cores] = name;
kono
parents:
diff changeset
64 n_cores++
kono
parents:
diff changeset
65 }
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 END {
kono
parents:
diff changeset
68 m_option = ""
kono
parents:
diff changeset
69 for (c = 0; c < n_cores; c++)
kono
parents:
diff changeset
70 {
kono
parents:
diff changeset
71 m_options = m_options "EnumValue\nEnum(processor_type) String(" \
kono
parents:
diff changeset
72 cores[c] ") Value(PROCESSOR_" cores[c] ")\n\n"
kono
parents:
diff changeset
73 }
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 ############################################################
kono
parents:
diff changeset
76 # Output that Stuff
kono
parents:
diff changeset
77 ############################################################
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 if (FORMAT == "Makefile")
kono
parents:
diff changeset
80 {
kono
parents:
diff changeset
81 print "\nEnum"
kono
parents:
diff changeset
82 print "Name(processor_type) Type(enum processor_type)"
kono
parents:
diff changeset
83 print "Known ARC CPUs (for use with the -mcpu= option):\n"
kono
parents:
diff changeset
84 print m_options
kono
parents:
diff changeset
85 }
kono
parents:
diff changeset
86 }