Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | # ========== Copyright Header Begin ========================================== |
2 | # | |
3 | # OpenSPARC T2 Processor File: Makefile.defines | |
4 | # Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
5 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
6 | # | |
7 | # The above named program is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU General Public | |
9 | # License version 2 as published by the Free Software Foundation. | |
10 | # | |
11 | # The above named program is distributed in the hope that it will be | |
12 | # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public | |
17 | # License along with this work; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
19 | # | |
20 | # ========== Copyright Header End ============================================ | |
21 | ||
22 | include ../../Makefile.defines | |
23 | ||
24 | .KEEP_STATE: | |
25 | ||
26 | # Solaris 10 introduces new suffix rules and that | |
27 | # causes all sorts of issues with the build. So we | |
28 | # bluntly nuke all the implicit rules here. | |
29 | ||
30 | .SUFFIXES: | |
31 | ||
32 | # All toplevel install related directories | |
33 | ||
34 | OBJ_DIR=$(BUILD_ROOT)/$(ARCH)/obj | |
35 | SRC_DIR=$(BUILD_ROOT)/$(ARCH)/src | |
36 | INC_DIR=$(BUILD_ROOT)/$(ARCH)/inc | |
37 | ||
38 | BUILD_DIRS = $(INSTALL_DIRS)\ | |
39 | $(INC_DIR)\ | |
40 | $(SRC_DIR)\ | |
41 | $(OBJ_DIR) | |
42 | ||
43 | #============================================================================ | |
44 | # Library names are named: | |
45 | # lib$(LIBNAME)$(PRODUCT)$(LIBCPU) - the naked cpu library | |
46 | # lib$(LIBNAME)$(PRODUCT)$(LIBSAM) - library for vcpu extension | |
47 | # lib$(LIBNAME)$(PRODUCT)$(LIBPFE) - library for pfe interface | |
48 | #============================================================================ | |
49 | ||
50 | LIBNAME = riesling_ | |
51 | LIBPRE = lib$(LIBNAME) | |
52 | ||
53 | LIBSAM = _vcpu | |
54 | LIBPFE = _pfe | |
55 | LIBCPU = | |
56 | LIBRTL = _rtl | |
57 | ||
58 | #============================================================================ | |
59 | # Your average set of basic commands | |
60 | #============================================================================ | |
61 | ||
62 | RM = /bin/rm | |
63 | CP = /bin/cp | |
64 | MV = /bin/mv | |
65 | LN = /usr/bin/ln | |
66 | PWD = /bin/pwd | |
67 | SED = /bin/sed | |
68 | DATE = /bin/date | |
69 | DIFF = /bin/diff | |
70 | CHMOD = /bin/chmod | |
71 | MKDIR = /bin/mkdir | |
72 | DIRNAME = /bin/dirname | |
73 | ||
74 | #============================================================================ | |
75 | # Some places where we pick up tools | |
76 | #============================================================================ | |
77 | ||
78 | SPARCWORKS_BIN = $(COMPILER_PATH) | |
79 | SUNTOOLS_BIN = | |
80 | ||
81 | #============================================================================ | |
82 | # CPP_ cpp defines | |
83 | #============================================================================ | |
84 | ||
85 | CPP_BIN = $(SUNTOOLS_BIN)/cpp | |
86 | ||
87 | CPP_ARCH.v8plus = ARCH_V8 | |
88 | CPP_ARCH.v9 = ARCH_V9 | |
89 | CPP_ARCH.amd64 = ARCH_X64 | |
90 | CPP_ARCH = $(CPP_ARCH.$(ARCH)) | |
91 | ||
92 | CPP_TARGET. = COMPILE_FOR_PFE | |
93 | CPP_TARGET.sim = COMPILE_FOR_PFE | |
94 | CPP_TARGET.cosim = COMPILE_FOR_COSIM | |
95 | CPP_TARGET.sam = COMPILE_FOR_SAM | |
96 | CPP_TARGET = $(CPP_TARGET.$(TARGET)) | |
97 | ||
98 | CPP_MEMORY. = MEMORY_SPARSE | |
99 | CPP_MEMORY.sparse = MEMORY_SPARSE | |
100 | CPP_MEMORY.memsync = MEMORY_MSYNC | |
101 | CPP_MEMORY.external = MEMORY_EXTERNAL | |
102 | CPP_MEMORY = $(CPP_MEMORY.$(MEMORY)) | |
103 | ||
104 | CPP_PROC. = | |
105 | CPP_PROC.n2 = -DPROC_N2 | |
106 | CPP_PROC = $(CPP_PROC.$(PROC)) | |
107 | ||
108 | # Use $if PURE==1 in the code to add things to make purify more happy, | |
109 | # e.g. complain less about reads from uninitialised memory. | |
110 | ||
111 | CPP_PURE.pure = 1 | |
112 | CPP_PURE. = 0 | |
113 | ||
114 | CPP_FLAGS = -I$(INC_DIR) -I$(PY_INC) -DPURE=$(CPP_PURE.$(PURE))\ | |
115 | -D$(CPP_ARCH) -D$(CPP_TARGET) -D$(CPP_MEMORY) $(CPP_PROC) | |
116 | ||
117 | #============================================================================ | |
118 | # CC_ c++ defines | |
119 | #============================================================================ | |
120 | ||
121 | CC_BIN = LD_LIBRARY_PATH= $(SPARCWORKS_BIN)/CC | |
122 | ||
123 | XARCH.v8plus = -xarch=v8plusb | |
124 | XARCH.v9 = -xarch=v9b | |
125 | XARCH.amd64 = -xarch=amd64 | |
126 | ||
127 | XCHIP.v8plus = -xchip=ultra3 | |
128 | XCHIP.v9 = -xchip=ultra3 | |
129 | XCHIP.amd64 = | |
130 | ||
131 | CC_FLAGS.base = -G -KPIC $(CPP_FLAGS) | |
132 | ||
133 | CC_FLAGS.g = -mt $(XARCH.$(ARCH)) -g +d | |
134 | CC_FLAGS.opt = -mt $(XARCH.$(ARCH)) $(XCHIP.$(ARCH)) -O5 -DNDEBUG -DSS_PRAY_MODE | |
135 | ||
136 | CC_FLAGS = $(CC_FLAGS.base) $(CC_FLAGS.$(MODE)) | |
137 | ||
138 | #============================================================================ | |
139 | # C_ c defines | |
140 | #============================================================================ | |
141 | ||
142 | C_BIN = $(SPARCWORKS_BIN)/cc | |
143 | ||
144 | C_FLAGS = $(CC_FLAGS) | |
145 | ||
146 | #============================================================================ | |
147 | # AS_ assembler defines | |
148 | #============================================================================ | |
149 | ||
150 | AS_BIN = $(AS) | |
151 | ||
152 | AS_FLAGS.base = -K PIC -P $(XARCH.$(ARCH)) $(CPP_FLAGS) -Iss/lib/cpu/src | |
153 | ||
154 | AS_FLAGS.g = | |
155 | AS_FLAGS.opt = | |
156 | ||
157 | AS_FLAGS = $(AS_FLAGS.base) $(AS_FLAGS.$(MODE)) | |
158 | ||
159 | #============================================================================ | |
160 | # LD_ loader defines | |
161 | #============================================================================ | |
162 | ||
163 | LD_BIN = LD_LIBRARY_PATH= $(SPARCWORKS_BIN)/CC | |
164 | ||
165 | LD_FLAGS.base = -Qoption ld -z,allextract -lthread -lz $(XARCH.$(ARCH)) | |
166 | ||
167 | LD_FLAGS.g = -G -KPIC | |
168 | LD_FLAGS.opt = -G -KPIC -Qoption ipo -archive | |
169 | ||
170 | # $ORIGIN is a 7 character identifier that is recognized by the | |
171 | # runtime linker. In SAM the rc file has a sysconf directive that | |
172 | # provides a path from where .so files (modules) are loaded. However, | |
173 | # some modules can depend on other .so. The latter .so files can not be | |
174 | # found unless we set LD_LIBRARY_PATH. A "better" solution is provided | |
175 | # by SUN in the form of the $ORIGIN string ... note it's not a shell | |
176 | # variable, not a makefile variable ... the $ is just there to confuse you. | |
177 | ||
178 | LD_FLAGS = '-R$$ORIGIN' $(LD_FLAGS.base) $(LD_FLAGS.$(MODE)) -L$(LIB_DIR) | |
179 | ||
180 | # LD_FLAGS.exe are the common flags used for linking executable binaries | |
181 | # the executables are stored in the bin directory. From bin the ../lib is | |
182 | # where the libraries will be | |
183 | ||
184 | LD_FLAGS.exe = $(SPIX_LIB)/libspix_sparc.a\ | |
185 | '-R$$ORIGIN/../lib' -R$(DEVTOOLS_HOME)/lib -L$(DEVTOOLS_HOME)/lib \ | |
186 | -l$(PY_LIB) -lexpat -lreadline -ltcl8.4 -ltk8.4 -lX11 \ | |
187 | -ldl -lcurses -lsocket -lnsl -lz | |
188 | ||
189 | #============================================================================ | |
190 | # Lex & Yacc defines | |
191 | #============================================================================ | |
192 | ||
193 | LEX_BIN = /usr/ccs/bin/lex | |
194 | YACC_BIN = /usr/ccs/bin/yacc | |
195 | ||
196 | #============================================================================ | |
197 | # PY_ python defines | |
198 | #============================================================================ | |
199 | ||
200 | PY_BIN = $(DEVTOOLS_HOME)/bin/python | |
201 | PY_INC = $(DEVTOOLS_HOME)/include/python2.4 | |
202 | PY_LIB = python2.4 | |
203 | ||
204 | PYTHONPATH = .:$(DEVTOOLS_HOME)/lib | |
205 | ||
206 | #============================================================================ | |
207 | # SWIG_ defines | |
208 | #============================================================================ | |
209 | ||
210 | SWIG_BIN = $(DEVTOOLS_HOME)/bin/swig | |
211 | SWIG_INC = $(DEVTOOLS_HOME)/share/swig/1.3.26 | |
212 | ||
213 | SWIG_TARGET = python | |
214 | SWIG_FLAGS = -$(SWIG_TARGET) -c++ -nodefault -Wall -I$(INC_DIR) -D$(CPP_ARCH) -I$(SWIG_INC) -I$(SWIG_INC)/python | |
215 | ||
216 | #============================================================================ | |
217 | # PERL_ defines | |
218 | #============================================================================ | |
219 | ||
220 | PERL_BIN = $(DEVTOOLS_HOME)/bin/perl | |
221 | ||
222 | #============================================================================ | |
223 | # Purify tool | |
224 | #============================================================================ | |
225 | ||
226 | PURIFY.pure = | |
227 | PURIFY. = | |
228 | PURIFY = $(PURIFY.$(PURE)) |