Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / Makefile.defines
CommitLineData
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
22include ../../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
34OBJ_DIR=$(BUILD_ROOT)/$(ARCH)/obj
35SRC_DIR=$(BUILD_ROOT)/$(ARCH)/src
36INC_DIR=$(BUILD_ROOT)/$(ARCH)/inc
37
38BUILD_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
50LIBNAME = riesling_
51LIBPRE = lib$(LIBNAME)
52
53LIBSAM = _vcpu
54LIBPFE = _pfe
55LIBCPU =
56LIBRTL = _rtl
57
58#============================================================================
59# Your average set of basic commands
60#============================================================================
61
62RM = /bin/rm
63CP = /bin/cp
64MV = /bin/mv
65LN = /usr/bin/ln
66PWD = /bin/pwd
67SED = /bin/sed
68DATE = /bin/date
69DIFF = /bin/diff
70CHMOD = /bin/chmod
71MKDIR = /bin/mkdir
72DIRNAME = /bin/dirname
73
74#============================================================================
75# Some places where we pick up tools
76#============================================================================
77
78SPARCWORKS_BIN = $(COMPILER_PATH)
79SUNTOOLS_BIN =
80
81#============================================================================
82# CPP_ cpp defines
83#============================================================================
84
85CPP_BIN = $(SUNTOOLS_BIN)/cpp
86
87CPP_ARCH.v8plus = ARCH_V8
88CPP_ARCH.v9 = ARCH_V9
89CPP_ARCH.amd64 = ARCH_X64
90CPP_ARCH = $(CPP_ARCH.$(ARCH))
91
92CPP_TARGET. = COMPILE_FOR_PFE
93CPP_TARGET.sim = COMPILE_FOR_PFE
94CPP_TARGET.cosim = COMPILE_FOR_COSIM
95CPP_TARGET.sam = COMPILE_FOR_SAM
96CPP_TARGET = $(CPP_TARGET.$(TARGET))
97
98CPP_MEMORY. = MEMORY_SPARSE
99CPP_MEMORY.sparse = MEMORY_SPARSE
100CPP_MEMORY.memsync = MEMORY_MSYNC
101CPP_MEMORY.external = MEMORY_EXTERNAL
102CPP_MEMORY = $(CPP_MEMORY.$(MEMORY))
103
104CPP_PROC. =
105CPP_PROC.n2 = -DPROC_N2
106CPP_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
111CPP_PURE.pure = 1
112CPP_PURE. = 0
113
114CPP_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
121CC_BIN = LD_LIBRARY_PATH= $(SPARCWORKS_BIN)/CC
122
123XARCH.v8plus = -xarch=v8plusb
124XARCH.v9 = -xarch=v9b
125XARCH.amd64 = -xarch=amd64
126
127XCHIP.v8plus = -xchip=ultra3
128XCHIP.v9 = -xchip=ultra3
129XCHIP.amd64 =
130
131CC_FLAGS.base = -G -KPIC $(CPP_FLAGS)
132
133CC_FLAGS.g = -mt $(XARCH.$(ARCH)) -g +d
134CC_FLAGS.opt = -mt $(XARCH.$(ARCH)) $(XCHIP.$(ARCH)) -O5 -DNDEBUG -DSS_PRAY_MODE
135
136CC_FLAGS = $(CC_FLAGS.base) $(CC_FLAGS.$(MODE))
137
138#============================================================================
139# C_ c defines
140#============================================================================
141
142C_BIN = $(SPARCWORKS_BIN)/cc
143
144C_FLAGS = $(CC_FLAGS)
145
146#============================================================================
147# AS_ assembler defines
148#============================================================================
149
150AS_BIN = $(AS)
151
152AS_FLAGS.base = -K PIC -P $(XARCH.$(ARCH)) $(CPP_FLAGS) -Iss/lib/cpu/src
153
154AS_FLAGS.g =
155AS_FLAGS.opt =
156
157AS_FLAGS = $(AS_FLAGS.base) $(AS_FLAGS.$(MODE))
158
159#============================================================================
160# LD_ loader defines
161#============================================================================
162
163LD_BIN = LD_LIBRARY_PATH= $(SPARCWORKS_BIN)/CC
164
165LD_FLAGS.base = -Qoption ld -z,allextract -lthread -lz $(XARCH.$(ARCH))
166
167LD_FLAGS.g = -G -KPIC
168LD_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
178LD_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
184LD_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
193LEX_BIN = /usr/ccs/bin/lex
194YACC_BIN = /usr/ccs/bin/yacc
195
196#============================================================================
197# PY_ python defines
198#============================================================================
199
200PY_BIN = $(DEVTOOLS_HOME)/bin/python
201PY_INC = $(DEVTOOLS_HOME)/include/python2.4
202PY_LIB = python2.4
203
204PYTHONPATH = .:$(DEVTOOLS_HOME)/lib
205
206#============================================================================
207# SWIG_ defines
208#============================================================================
209
210SWIG_BIN = $(DEVTOOLS_HOME)/bin/swig
211SWIG_INC = $(DEVTOOLS_HOME)/share/swig/1.3.26
212
213SWIG_TARGET = python
214SWIG_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
220PERL_BIN = $(DEVTOOLS_HOME)/bin/perl
221
222#============================================================================
223# Purify tool
224#============================================================================
225
226PURIFY.pure =
227PURIFY. =
228PURIFY = $(PURIFY.$(PURE))