Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / Makefile.defines
# ========== Copyright Header Begin ==========================================
#
# OpenSPARC T2 Processor File: Makefile.defines
# Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
#
# The above named program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License version 2 as published by the Free Software Foundation.
#
# The above named program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this work; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ========== Copyright Header End ============================================
include ../../Makefile.defines
.KEEP_STATE:
# Solaris 10 introduces new suffix rules and that
# causes all sorts of issues with the build. So we
# bluntly nuke all the implicit rules here.
.SUFFIXES:
# All toplevel install related directories
OBJ_DIR=$(BUILD_ROOT)/$(ARCH)/obj
SRC_DIR=$(BUILD_ROOT)/$(ARCH)/src
INC_DIR=$(BUILD_ROOT)/$(ARCH)/inc
BUILD_DIRS = $(INSTALL_DIRS)\
$(INC_DIR)\
$(SRC_DIR)\
$(OBJ_DIR)
#============================================================================
# Library names are named:
# lib$(LIBNAME)$(PRODUCT)$(LIBCPU) - the naked cpu library
# lib$(LIBNAME)$(PRODUCT)$(LIBSAM) - library for vcpu extension
# lib$(LIBNAME)$(PRODUCT)$(LIBPFE) - library for pfe interface
#============================================================================
LIBNAME = riesling_
LIBPRE = lib$(LIBNAME)
LIBSAM = _vcpu
LIBPFE = _pfe
LIBCPU =
LIBRTL = _rtl
#============================================================================
# Your average set of basic commands
#============================================================================
RM = /bin/rm
CP = /bin/cp
MV = /bin/mv
LN = /usr/bin/ln
PWD = /bin/pwd
SED = /bin/sed
DATE = /bin/date
DIFF = /bin/diff
CHMOD = /bin/chmod
MKDIR = /bin/mkdir
DIRNAME = /bin/dirname
#============================================================================
# Some places where we pick up tools
#============================================================================
SPARCWORKS_BIN = $(COMPILER_PATH)
SUNTOOLS_BIN =
#============================================================================
# CPP_ cpp defines
#============================================================================
CPP_BIN = $(SUNTOOLS_BIN)/cpp
CPP_ARCH.v8plus = ARCH_V8
CPP_ARCH.v9 = ARCH_V9
CPP_ARCH.amd64 = ARCH_X64
CPP_ARCH = $(CPP_ARCH.$(ARCH))
CPP_TARGET. = COMPILE_FOR_PFE
CPP_TARGET.sim = COMPILE_FOR_PFE
CPP_TARGET.cosim = COMPILE_FOR_COSIM
CPP_TARGET.sam = COMPILE_FOR_SAM
CPP_TARGET = $(CPP_TARGET.$(TARGET))
CPP_MEMORY. = MEMORY_SPARSE
CPP_MEMORY.sparse = MEMORY_SPARSE
CPP_MEMORY.memsync = MEMORY_MSYNC
CPP_MEMORY.external = MEMORY_EXTERNAL
CPP_MEMORY = $(CPP_MEMORY.$(MEMORY))
CPP_PROC. =
CPP_PROC.n2 = -DPROC_N2
CPP_PROC = $(CPP_PROC.$(PROC))
# Use $if PURE==1 in the code to add things to make purify more happy,
# e.g. complain less about reads from uninitialised memory.
CPP_PURE.pure = 1
CPP_PURE. = 0
CPP_FLAGS = -I$(INC_DIR) -I$(PY_INC) -DPURE=$(CPP_PURE.$(PURE))\
-D$(CPP_ARCH) -D$(CPP_TARGET) -D$(CPP_MEMORY) $(CPP_PROC)
#============================================================================
# CC_ c++ defines
#============================================================================
CC_BIN = LD_LIBRARY_PATH= $(SPARCWORKS_BIN)/CC
XARCH.v8plus = -xarch=v8plusb
XARCH.v9 = -xarch=v9b
XARCH.amd64 = -xarch=amd64
XCHIP.v8plus = -xchip=ultra3
XCHIP.v9 = -xchip=ultra3
XCHIP.amd64 =
CC_FLAGS.base = -G -KPIC $(CPP_FLAGS)
CC_FLAGS.g = -mt $(XARCH.$(ARCH)) -g +d
CC_FLAGS.opt = -mt $(XARCH.$(ARCH)) $(XCHIP.$(ARCH)) -O5 -DNDEBUG -DSS_PRAY_MODE
CC_FLAGS = $(CC_FLAGS.base) $(CC_FLAGS.$(MODE))
#============================================================================
# C_ c defines
#============================================================================
C_BIN = $(SPARCWORKS_BIN)/cc
C_FLAGS = $(CC_FLAGS)
#============================================================================
# AS_ assembler defines
#============================================================================
AS_BIN = $(AS)
AS_FLAGS.base = -K PIC -P $(XARCH.$(ARCH)) $(CPP_FLAGS) -Iss/lib/cpu/src
AS_FLAGS.g =
AS_FLAGS.opt =
AS_FLAGS = $(AS_FLAGS.base) $(AS_FLAGS.$(MODE))
#============================================================================
# LD_ loader defines
#============================================================================
LD_BIN = LD_LIBRARY_PATH= $(SPARCWORKS_BIN)/CC
LD_FLAGS.base = -Qoption ld -z,allextract -lthread -lz $(XARCH.$(ARCH))
LD_FLAGS.g = -G -KPIC
LD_FLAGS.opt = -G -KPIC -Qoption ipo -archive
# $ORIGIN is a 7 character identifier that is recognized by the
# runtime linker. In SAM the rc file has a sysconf directive that
# provides a path from where .so files (modules) are loaded. However,
# some modules can depend on other .so. The latter .so files can not be
# found unless we set LD_LIBRARY_PATH. A "better" solution is provided
# by SUN in the form of the $ORIGIN string ... note it's not a shell
# variable, not a makefile variable ... the $ is just there to confuse you.
LD_FLAGS = '-R$$ORIGIN' $(LD_FLAGS.base) $(LD_FLAGS.$(MODE)) -L$(LIB_DIR)
# LD_FLAGS.exe are the common flags used for linking executable binaries
# the executables are stored in the bin directory. From bin the ../lib is
# where the libraries will be
LD_FLAGS.exe = $(SPIX_LIB)/libspix_sparc.a\
'-R$$ORIGIN/../lib' -R$(DEVTOOLS_HOME)/lib -L$(DEVTOOLS_HOME)/lib \
-l$(PY_LIB) -lexpat -lreadline -ltcl8.4 -ltk8.4 -lX11 \
-ldl -lcurses -lsocket -lnsl -lz
#============================================================================
# Lex & Yacc defines
#============================================================================
LEX_BIN = /usr/ccs/bin/lex
YACC_BIN = /usr/ccs/bin/yacc
#============================================================================
# PY_ python defines
#============================================================================
PY_BIN = $(DEVTOOLS_HOME)/bin/python
PY_INC = $(DEVTOOLS_HOME)/include/python2.4
PY_LIB = python2.4
PYTHONPATH = .:$(DEVTOOLS_HOME)/lib
#============================================================================
# SWIG_ defines
#============================================================================
SWIG_BIN = $(DEVTOOLS_HOME)/bin/swig
SWIG_INC = $(DEVTOOLS_HOME)/share/swig/1.3.26
SWIG_TARGET = python
SWIG_FLAGS = -$(SWIG_TARGET) -c++ -nodefault -Wall -I$(INC_DIR) -D$(CPP_ARCH) -I$(SWIG_INC) -I$(SWIG_INC)/python
#============================================================================
# PERL_ defines
#============================================================================
PERL_BIN = $(DEVTOOLS_HOME)/bin/perl
#============================================================================
# Purify tool
#============================================================================
PURIFY.pure =
PURIFY. =
PURIFY = $(PURIFY.$(PURE))