OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / config / nios2 / t-nios2
1 # Target Makefile Fragment for Altera Nios II.
2 # Copyright (C) 2012 Free Software Foundation, Inc.
3 # Contributed by Altera and Mentor Graphics, Inc.
4 #
5 # This file is part of GCC.
6 #
7 # GCC is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published
9 # by the Free Software Foundation; either version 3, or (at your
10 # option) any later version.
11 #
12 # GCC is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15 # 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
22 ## MULTILIB_OPTIONS
23 ## For some targets, invoking GCC in different ways produces objects that
24 ## can not be linked together.  For example, for some targets GCC produces
25 ## both big and little endian code.  For these targets, you must arrange
26 ## for multiple versions of libgcc.a to be compiled, one for each set of
27 ## incompatible options.  When GCC invokes the linker, it arranges to link
28 ## in the right version of libgcc.a, based on the command line options
29 ## used.
30 ## The MULTILIB_OPTIONS macro lists the set of options for which special
31 ## versions of libgcc.a must be built.  Write options that are mutually
32 ## incompatible side by side, separated by a slash.  Write options that may
33 ## be used together separated by a space.  The build procedure will build
34 ## all combinations of compatible options.
35 ##
36 ## For example, if you set MULTILIB_OPTIONS to m68000/m68020 msoft-float,
37 ## Makefile will build special versions of libgcc.a using the following
38 ## sets of options: -m68000, -m68020, -msoft-float, -m68000 -msoft-float,
39 ## and -m68020 -msoft-float.
40
41
42 ## The BUILD_BE_MULTILIB and BUILD_PG_MULTILIB variables allow the
43 ## makefile user to enable/disable the generation of the precompiled
44 ## big endian and profiling libraries. By default, the big endian 
45 ## libraries are not created on a windows build and the profiling
46 ## libraries are not created on a Solaris build. All other library 
47 ## combinations are created by default.
48
49 # Uncomment to temporarily avoid building big endian and profiling libraries during a Windows build.
50 #ifeq ($(DEV_HOST_OS), win32)
51 #BUILD_BE_MULTILIB ?= 0
52 #BUILD_PG_MULTILIB ?= 0
53 #endif
54
55 #By default, avoid building the profiling libraries during a Solaris build.
56 ifeq ($(DEV_HOST_OS), solaris)
57 BUILD_PG_MULTILIB ?= 0
58 endif
59
60 BUILD_BE_MULTILIB ?= 0
61 BUILD_PG_MULTILIB ?= 1
62 BUILD_MULTILIB ?= 0
63
64 ifeq ($(BUILD_MULTILIB), 1)
65
66 MULTILIB_OPTIONS = mno-hw-mul mhw-mulx mstack-check mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-2
67
68 #Add the profiling flag to the multilib variable if required
69 ifeq ($(BUILD_PG_MULTILIB), 1)
70 MULTILIB_OPTIONS += pg
71 endif
72
73 #Add the big endian flag to the multilib variable if required
74 ifeq ($(BUILD_BE_MULTILIB), 1)
75 MULTILIB_OPTIONS += EB/EL
76 endif
77
78 endif
79
80 ## MULTILIB_DIRNAMES
81 ## If MULTILIB_OPTIONS is used, this variable specifies the directory names
82 ## that should be used to hold the various libraries.  Write one element in
83 ## MULTILIB_DIRNAMES for each element in MULTILIB_OPTIONS. If
84 ## MULTILIB_DIRNAMES is not used, the default value will be
85 ## MULTILIB_OPTIONS, with all slashes treated as spaces.
86 ## For example, if MULTILIB_OPTIONS is set to m68000/m68020 msoft-float,
87 ## then the default value of MULTILIB_DIRNAMES is m68000 m68020
88 ## msoft-float.  You may specify a different value if you desire a
89 ## different set of directory names.
90
91 # MULTILIB_DIRNAMES =
92
93 ## MULTILIB_MATCHES
94 ## Sometimes the same option may be written in two different ways.  If an
95 ## option is listed in MULTILIB_OPTIONS, GCC needs to know about any
96 ## synonyms.  In that case, set MULTILIB_MATCHES to a list of items of the
97 ## form option=option to describe all relevant synonyms.  For example,
98 ## m68000=mc68000 m68020=mc68020.
99
100 ifeq ($(BUILD_MULTILIB), 1)
101 ifeq ($(BUILD_BE_MULTILIB), 1)
102 MULTILIB_MATCHES = EL=mel EB=meb
103 endif
104 endif
105
106 ##
107 ## MULTILIB_EXCEPTIONS
108 ## Sometimes when there are multiple sets of MULTILIB_OPTIONS being
109 ## specified, there are combinations that should not be built.  In that
110 ## case, set MULTILIB_EXCEPTIONS to be all of the switch exceptions in
111 ## shell case syntax that should not be built.
112 ## For example, in the PowerPC embedded ABI support, it is not desirable to
113 ## build libraries compiled with the -mcall-aix option and either of the
114 ## -fleading-underscore or -mlittle options at the same time.  Therefore
115 ## MULTILIB_EXCEPTIONS is set to
116 ##
117 ## *mcall-aix/*fleading-underscore* *mlittle/*mcall-aix*
118 ##
119
120 ifeq ($(BUILD_MULTILIB), 1)
121 MULTILIB_EXCEPTIONS = *mno-hw-mul/*mhw-mulx* *mcustom-fpu-cfg=60-1/*mcustom-fpu-cfg=60-2*
122 endif
123
124 ##
125 ## MULTILIB_EXTRA_OPTS Sometimes it is desirable that when building
126 ## multiple versions of libgcc.a certain options should always be passed on
127 ## to the compiler.  In that case, set MULTILIB_EXTRA_OPTS to be the list
128 ## of options to be used for all builds.
129 ##
130
131