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 | # "@(#)1.2 05/12/15 Makefile.defines" | |
23 | # | |
24 | ||
25 | include $(SIM_ROOT)/sam-t2/sam/Makefile.sitedefs | |
26 | ||
27 | # ---------------------------- mode flags ----------------------------- | |
28 | # MODE=g compile for debug | |
29 | # MODE=opt compile for optimisation | |
30 | # | |
31 | # CHECK_MODE is non empty string when MODE is correctly specified | |
32 | ||
33 | MODE = opt | |
34 | ||
35 | CHECK_MODE.g = g | |
36 | CHECK_MODE.opt = opt | |
37 | CHECK_MODE = $(CHECK_MODE.$(MODE)) | |
38 | ||
39 | # ---------------------------- arch flags ----------------------------- | |
40 | # | |
41 | # The ARCH variable specifies which -xarch based flag for example is used | |
42 | # on the build tools. Currently v9, v8plus, and amd64 are supported. The default is | |
43 | # v9. The v8plus target is only used for the cosim targets. Some people | |
44 | # refer to this flag as the platform you are compiling for. When you change | |
45 | # this, look at the BITS, CFLAGS, and ASFLAGS below to see if change is | |
46 | # needed there too.# Note for the sparc v8 and v8plus we leave out the last | |
47 | # letter a b or c which tells which subset of the instructiuon set is | |
48 | # available (vis 1, vis2, ...). That part we assume to be fixed. | |
49 | # | |
50 | # CHECK_ARCH is non empty string when ARCH is correctly specified | |
51 | ||
52 | ARCH = v9 | |
53 | ||
54 | CHECK_ARCH.v9 = v9 | |
55 | CHECK_ARCH.v8plus = v8plus | |
56 | CHECK_ARCH.amd64 = amd64 | |
57 | CHECK_ARCH = $(CHECK_ARCH.$(ARCH)) | |
58 | ||
59 | # Old blaze used bits to specify v8plus or v9 ... we should change this. | |
60 | # as for amd64 this should say ... 64 | |
61 | ||
62 | BITS.v8plus = 32 | |
63 | BITS.v9 = 64 | |
64 | BITS.amd64 = 64 | |
65 | BITS = $(BITS.$(ARCH)) | |
66 | ||
67 | # ---------------------------- passdown ----------------------------- | |
68 | ||
69 | PWD:sh=/bin/pwd | |
70 | ||
71 | PASSDOWN = BITS=$(BITS) \ | |
72 | DEFINES="$(DEFINES)" \ | |
73 | TARG="$(TARG)" \ | |
74 | INSTALL_DIR=$(INSTALL_DIR) \ | |
75 | TOP_DIR=$(PWD) \ | |
76 | BUILD_ROOT=$(BUILD_ROOT) \ | |
77 | BUILD_DIR=$(BUILD_DIR) \ | |
78 | MODE=$(MODE) \ | |
79 | ARCH=$(ARCH) \ | |
80 | EXPORT_OK=$(EXPORT_OK) | |
81 | ||
82 | SOL10 = OK | |
83 | EXPORT_OK = | |
84 | ||
85 | #----------------- external references ----------------- | |
86 | # | |
87 | # not for every compile, to be -I'ed on an as needed basis only. | |
88 | ||
89 | DEVTOOLS_HOME = $(SIM_ROOT)/sam-t2/devtools/$(ARCH) | |
90 | ||
91 | SPIX_HOME = $(DEVTOOLS_HOME) | |
92 | SPIX_LIB = $(SPIX_HOME)/lib | |
93 | SPIX_INC = $(SPIX_HOME)/include | |
94 | ||
95 | RST_HOME = $(SIM_ROOT)/sam-t2/devtools/rst | |
96 | ||
97 | # ----------------------- tools ------------------------- | |
98 | ||
99 | COMPILER_PATH.v8plus = $(SUNSTUDIO)/bin | |
100 | COMPILER_PATH.v9 = $(SUNSTUDIO)/bin | |
101 | COMPILER_PATH.amd64 = $(SUNSTUDIO)/bin | |
102 | COMPILER_PATH = $(COMPILER_PATH.$(ARCH)) | |
103 | ||
104 | # Note that we use prefer to use the Sun Make predefined macros: | |
105 | # COMPILE.cc, COMPILE.s | |
106 | # LINK.cc | |
107 | ||
108 | CC = $(COMPILER_PATH)/CC | |
109 | CCC = $(COMPILER_PATH)/CC | |
110 | AS = /usr/ccs/bin/as | |
111 | LD = /usr/ccs/bin/ld | |
112 | MCS = /usr/ccs/bin/mcs | |
113 | ||
114 | MKDIR = /usr/bin/mkdir -p | |
115 | RM = /usr/bin/rm -rf | |
116 | TEST = /usr/bin/test | |
117 | TESTDIR = $(TEST) -d $(@D) || $(MKDIR) $(@D) | |
118 | ECHO = /bin/echo | |
119 | CP = /usr/bin/cp -p | |
120 | LN = /usr/bin/ln -s | |
121 | XARGS = /bin/xargs | |
122 | ||
123 | ||
124 | # ---------------------------- tool flags ----------------------------- | |
125 | # v9b - vonk required the b extension to use native assembler | |
126 | # for the Vis 2 instructions | |
127 | ||
128 | ||
129 | CFLAGS = -w -mt | |
130 | ||
131 | CFLAGS_opt = -xO3 # for release | |
132 | CFLAGS_g = -g # for developement | |
133 | CFLAGS += $(CFLAGS_$(MODE)) | |
134 | ||
135 | CFLAGS.v8plus = -xarch=v8plusa | |
136 | CFLAGS.v9 = -xarch=v9b | |
137 | CFLAGS.amd64 = -xarch=amd64 -DARCH_X64 | |
138 | CFLAGS += $(CFLAGS.$(ARCH)) | |
139 | ||
140 | CCFLAGS = $(CFLAGS) | |
141 | CCFLAGS += -DIO_THREAD=1 -DV4_NUM_DEVICE_COMPAT | |
142 | CCCFLAGS = $(CCFLAGS) | |
143 | ||
144 | ||
145 | ASFLAGS.v8plus = -xarch=v8plusa | |
146 | ASFLAGS.v9 = -xarch=v9b | |
147 | ASFLAGS.amd64 = -xarch=amd64 | |
148 | ASFLAGS = $(ASFLAGS.$(ARCH)) | |
149 | ||
150 | ||
151 | POUND_SIGN:sh=echo \\043 | |
152 | ||
153 | ||
154 | #------------------------build and install ---------------------- | |
155 | ||
156 | # To build repeatedly for g and for opt in the same child workspace do | |
157 | # | |
158 | # make MODE=g BUILD_ROOT=`pwd`/build_g INSTALL_DIR=`pwd`/install_g <target> | |
159 | # make MODE=opt BUILD_ROOT=`pwd`/build_opt INSTALL_DIR=`pwd`/install_opt <target> | |
160 | ||
161 | # BUILD_DIR uses BUILD_TARGET and therefore causes these ""mksh: Warning: | |
162 | # Conditional macro `BUILD_TARGET' referenced in file `Makefile.rules', line 14 | |
163 | ||
164 | BUILD_ROOT = $(PWD)/build | |
165 | BUILD_DIR = $(BUILD_ROOT)/$(BUILD_TARGET) | |
166 | INSTALL_DIR = $(PWD)/$(DEFAULT_INSTALL_DIR) | |
167 | ||
168 | OBJ_DIR = $(BUILD_DIR)/$(TREEPATH) | |
169 | ||
170 | # These are the top level directories in an install | |
171 | # | |
172 | # bin - executables like sam, sam-n2, ... | |
173 | # lib - libraries of cpu, devices, ... | |
174 | # etc - configuration files ... | |
175 | # pfe - all the python front end files and samfe | |
176 | # inc - exported api definitions like mmi etc | |
177 | # rtl - rtl support files | |
178 | # doc - support documents | |
179 | # man - man pages | |
180 | ||
181 | BIN_DIR = $(INSTALL_DIR)/bin | |
182 | LIB_DIR = $(INSTALL_DIR)/lib | |
183 | ETC_DIR = $(INSTALL_DIR)/etc | |
184 | PFE_DIR = $(INSTALL_DIR)/pfe | |
185 | MAN_DIR = $(INSTALL_DIR)/man | |
186 | DOC_DIR = $(INSTALL_DIR)/doc | |
187 | RTL_DIR = $(INSTALL_DIR)/rtl | |
188 | ||
189 | MAN1_DIR = $(MAN_DIR)/man1 | |
190 | SAMFE_DIR = $(PFE_DIR)/samfe | |
191 | ||
192 | # All directories in a release | |
193 | INSTALL_DIRS = $(BIN_DIR)\ | |
194 | $(LIB_DIR)\ | |
195 | $(ETC_DIR)\ | |
196 | $(PFE_DIR)\ | |
197 | $(MAN_DIR)\ | |
198 | $(DOC_DIR)\ | |
199 | $(RTL_DIR)\ | |
200 | $(MAN1_DIR)\ | |
201 | $(SAMFE_DIR) | |
202 | ||
203 | # Build the directory path of the make target. We @ prefix the | |
204 | # rules as it is used for every build target in cpus/vonk | |
205 | ||
206 | TARGET_MKDIR = @if [ ! -d $(@D) ] ; then $(MKDIR) -p $(@D) ; fi | |
207 | ||
208 | ||
209 | COM_DIR = ../common | |
210 | ||
211 | ||
212 | # ----------------------- recursive make ------------------------ | |
213 | ||
214 | MAKE_ENV = $(MAKEFLAGS) # <--- this really seems dubious... | |
215 | MAKE_ENV += "MAKE=$(MAKE)" | |
216 | ||
217 | ||
218 | # ------------------------- -=oOo=- ------------------------ |