# ========== 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
# 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.
# 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)\
#============================================================================
# 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
#============================================================================
#============================================================================
# Your average set of basic commands
#============================================================================
#============================================================================
# Some places where we pick up tools
#============================================================================
SPARCWORKS_BIN = $(COMPILER_PATH)
#============================================================================
#============================================================================
CPP_BIN = $(SUNTOOLS_BIN)/cpp
CPP_ARCH.v8plus = ARCH_V8
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.$(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_FLAGS = -I$(INC_DIR) -I$(PY_INC) -DPURE=$(CPP_PURE.$(PURE))\
-D$(CPP_ARCH) -D$(CPP_TARGET) -D$(CPP_MEMORY) $(CPP_PROC)
#============================================================================
#============================================================================
CC_BIN = LD_LIBRARY_PATH= $(SPARCWORKS_BIN)/CC
XARCH.v8plus = -xarch=v8plusb
XARCH.amd64 = -xarch=amd64
XCHIP.v8plus = -xchip=ultra3
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_BIN = $(SPARCWORKS_BIN)/cc
#============================================================================
#============================================================================
AS_FLAGS.base = -K PIC -P $(XARCH.$(ARCH)) $(CPP_FLAGS) -Iss/lib/cpu/src
AS_FLAGS = $(AS_FLAGS.base) $(AS_FLAGS.$(MODE))
#============================================================================
#============================================================================
LD_BIN = LD_LIBRARY_PATH= $(SPARCWORKS_BIN)/CC
LD_FLAGS.base = -Qoption ld -z,allextract -lthread -lz $(XARCH.$(ARCH))
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_BIN = /usr/ccs/bin/lex
YACC_BIN = /usr/ccs/bin/yacc
#============================================================================
#============================================================================
PY_BIN = $(DEVTOOLS_HOME)/bin/python
PY_INC = $(DEVTOOLS_HOME)/include/python2.4
PYTHONPATH = .:$(DEVTOOLS_HOME)/lib
#============================================================================
#============================================================================
SWIG_BIN = $(DEVTOOLS_HOME)/bin/swig
SWIG_INC = $(DEVTOOLS_HOME)/share/swig/1.3.26
SWIG_FLAGS = -$(SWIG_TARGET) -c++ -nodefault -Wall -I$(INC_DIR) -D$(CPP_ARCH) -I$(SWIG_INC) -I$(SWIG_INC)/python
#============================================================================
#============================================================================
PERL_BIN = $(DEVTOOLS_HOME)/bin/perl
#============================================================================
#============================================================================
PURIFY = $(PURIFY.$(PURE))