# ========== 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 ============================================ # # "@(#)1.2 05/12/15 Makefile.defines" # include $(SIM_ROOT)/sam-t2/sam/Makefile.sitedefs # ---------------------------- mode flags ----------------------------- # MODE=g compile for debug # MODE=opt compile for optimisation # # CHECK_MODE is non empty string when MODE is correctly specified MODE = opt CHECK_MODE.g = g CHECK_MODE.opt = opt CHECK_MODE = $(CHECK_MODE.$(MODE)) # ---------------------------- arch flags ----------------------------- # # The ARCH variable specifies which -xarch based flag for example is used # on the build tools. Currently v9, v8plus, and amd64 are supported. The default is # v9. The v8plus target is only used for the cosim targets. Some people # refer to this flag as the platform you are compiling for. When you change # this, look at the BITS, CFLAGS, and ASFLAGS below to see if change is # needed there too.# Note for the sparc v8 and v8plus we leave out the last # letter a b or c which tells which subset of the instructiuon set is # available (vis 1, vis2, ...). That part we assume to be fixed. # # CHECK_ARCH is non empty string when ARCH is correctly specified ARCH = v9 CHECK_ARCH.v9 = v9 CHECK_ARCH.v8plus = v8plus CHECK_ARCH.amd64 = amd64 CHECK_ARCH = $(CHECK_ARCH.$(ARCH)) # Old blaze used bits to specify v8plus or v9 ... we should change this. # as for amd64 this should say ... 64 BITS.v8plus = 32 BITS.v9 = 64 BITS.amd64 = 64 BITS = $(BITS.$(ARCH)) # ---------------------------- passdown ----------------------------- PWD:sh=/bin/pwd PASSDOWN = BITS=$(BITS) \ DEFINES="$(DEFINES)" \ TARG="$(TARG)" \ INSTALL_DIR=$(INSTALL_DIR) \ TOP_DIR=$(PWD) \ BUILD_ROOT=$(BUILD_ROOT) \ BUILD_DIR=$(BUILD_DIR) \ MODE=$(MODE) \ ARCH=$(ARCH) \ EXPORT_OK=$(EXPORT_OK) SOL10 = OK EXPORT_OK = #----------------- external references ----------------- # # not for every compile, to be -I'ed on an as needed basis only. DEVTOOLS_HOME = $(SIM_ROOT)/sam-t2/devtools/$(ARCH) SPIX_HOME = $(DEVTOOLS_HOME) SPIX_LIB = $(SPIX_HOME)/lib SPIX_INC = $(SPIX_HOME)/include RST_HOME = $(SIM_ROOT)/sam-t2/devtools/rst # ----------------------- tools ------------------------- COMPILER_PATH.v8plus = $(SUNSTUDIO)/bin COMPILER_PATH.v9 = $(SUNSTUDIO)/bin COMPILER_PATH.amd64 = $(SUNSTUDIO)/bin COMPILER_PATH = $(COMPILER_PATH.$(ARCH)) # Note that we use prefer to use the Sun Make predefined macros: # COMPILE.cc, COMPILE.s # LINK.cc CC = $(COMPILER_PATH)/CC CCC = $(COMPILER_PATH)/CC AS = /usr/ccs/bin/as LD = /usr/ccs/bin/ld MCS = /usr/ccs/bin/mcs MKDIR = /usr/bin/mkdir -p RM = /usr/bin/rm -rf TEST = /usr/bin/test TESTDIR = $(TEST) -d $(@D) || $(MKDIR) $(@D) ECHO = /bin/echo CP = /usr/bin/cp -p LN = /usr/bin/ln -s XARGS = /bin/xargs # ---------------------------- tool flags ----------------------------- # v9b - vonk required the b extension to use native assembler # for the Vis 2 instructions CFLAGS = -w -mt CFLAGS_opt = -xO3 # for release CFLAGS_g = -g # for developement CFLAGS += $(CFLAGS_$(MODE)) CFLAGS.v8plus = -xarch=v8plusa CFLAGS.v9 = -xarch=v9b CFLAGS.amd64 = -xarch=amd64 -DARCH_X64 CFLAGS += $(CFLAGS.$(ARCH)) CCFLAGS = $(CFLAGS) CCFLAGS += -DIO_THREAD=1 -DV4_NUM_DEVICE_COMPAT CCCFLAGS = $(CCFLAGS) ASFLAGS.v8plus = -xarch=v8plusa ASFLAGS.v9 = -xarch=v9b ASFLAGS.amd64 = -xarch=amd64 ASFLAGS = $(ASFLAGS.$(ARCH)) POUND_SIGN:sh=echo \\043 #------------------------build and install ---------------------- # To build repeatedly for g and for opt in the same child workspace do # # make MODE=g BUILD_ROOT=`pwd`/build_g INSTALL_DIR=`pwd`/install_g # make MODE=opt BUILD_ROOT=`pwd`/build_opt INSTALL_DIR=`pwd`/install_opt # BUILD_DIR uses BUILD_TARGET and therefore causes these ""mksh: Warning: # Conditional macro `BUILD_TARGET' referenced in file `Makefile.rules', line 14 BUILD_ROOT = $(PWD)/build BUILD_DIR = $(BUILD_ROOT)/$(BUILD_TARGET) INSTALL_DIR = $(PWD)/$(DEFAULT_INSTALL_DIR) OBJ_DIR = $(BUILD_DIR)/$(TREEPATH) # These are the top level directories in an install # # bin - executables like sam, sam-n2, ... # lib - libraries of cpu, devices, ... # etc - configuration files ... # pfe - all the python front end files and samfe # inc - exported api definitions like mmi etc # rtl - rtl support files # doc - support documents # man - man pages BIN_DIR = $(INSTALL_DIR)/bin LIB_DIR = $(INSTALL_DIR)/lib ETC_DIR = $(INSTALL_DIR)/etc PFE_DIR = $(INSTALL_DIR)/pfe MAN_DIR = $(INSTALL_DIR)/man DOC_DIR = $(INSTALL_DIR)/doc RTL_DIR = $(INSTALL_DIR)/rtl MAN1_DIR = $(MAN_DIR)/man1 SAMFE_DIR = $(PFE_DIR)/samfe # All directories in a release INSTALL_DIRS = $(BIN_DIR)\ $(LIB_DIR)\ $(ETC_DIR)\ $(PFE_DIR)\ $(MAN_DIR)\ $(DOC_DIR)\ $(RTL_DIR)\ $(MAN1_DIR)\ $(SAMFE_DIR) # Build the directory path of the make target. We @ prefix the # rules as it is used for every build target in cpus/vonk TARGET_MKDIR = @if [ ! -d $(@D) ] ; then $(MKDIR) -p $(@D) ; fi COM_DIR = ../common # ----------------------- recursive make ------------------------ MAKE_ENV = $(MAKEFLAGS) # <--- this really seems dubious... MAKE_ENV += "MAKE=$(MAKE)" # ------------------------- -=oOo=- ------------------------