author | kupfer |
Wed, 21 Dec 2005 19:47:57 -0800 | |
changeset 1167 | 9608ad751c4d |
parent 580 | 70dfd36fd02c |
child 1717 | ef845d4a1074 |
permissions | -rw-r--r-- |
0 | 1 |
# |
2 |
# CDDL HEADER START |
|
3 |
# |
|
4 |
# The contents of this file are subject to the terms of the |
|
580 | 5 |
# Common Development and Distribution License (the "License"). |
6 |
# You may not use this file except in compliance with the License. |
|
0 | 7 |
# |
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
# or http://www.opensolaris.org/os/licensing. |
|
10 |
# See the License for the specific language governing permissions |
|
11 |
# and limitations under the License. |
|
12 |
# |
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
# If applicable, add the following below this CDDL HEADER, with the |
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
# |
|
19 |
# CDDL HEADER END |
|
20 |
# |
|
580 | 21 |
|
0 | 22 |
# |
23 |
# Copyright 2005 Sun Microsystems, Inc. All rights reserved. |
|
24 |
# Use is subject to license terms. |
|
25 |
# |
|
26 |
# ident "%Z%%M% %I% %E% SMI" |
|
27 |
# |
|
580 | 28 |
|
29 |
# |
|
0 | 30 |
# Makefile.master, global definitions for system source |
31 |
# |
|
32 |
ROOT= /proto |
|
33 |
||
34 |
# Historically, ON builds were always done with root permissions, and the |
|
35 |
# owner/group information was duplicated in the Makefiles and the packaging |
|
36 |
# data and kept in sync by manual intervention. This is no longer true. |
|
37 |
# The only source of this information is packaging. The proto area ($ROOT) |
|
38 |
# does not have definitive onwer/group information, and no Makefile should |
|
39 |
# attempt to set this. CH once toggled operations restricted to root. It |
|
40 |
# is now just set to `#'. |
|
41 |
# |
|
42 |
# At some point in the future, CH, CHOWN, CHGRP, OWNER, and GROUP should all |
|
43 |
# be stripped completely from the source base. They are kept for now until |
|
44 |
# on10-based projects can merge and transition away from them. |
|
45 |
# |
|
46 |
# RELEASE_BUILD should be cleared for final release builds. This is completely |
|
47 |
# independent of CH. NOT_RELEASE_BUILD is exactly what the name implies. |
|
48 |
# |
|
49 |
# INTERNAL_RELEASE_BUILD is a subset of RELEASE_BUILD. It mostly controls |
|
50 |
# identification strings. Enabling RELEASE_BUILD automatically enables |
|
51 |
# INTERNAL_RELEASE_BUILD. |
|
52 |
# |
|
53 |
# EXPORT_RELEASE_BUILD controls whether binaries are built in a form that |
|
54 |
# can be released for export under a binary license. It is orthogonal to |
|
1167 | 55 |
# the other *RELEASE_BUILD settings. ("#" means do an export release |
56 |
# build, "" means do a normal build.) |
|
57 |
# |
|
58 |
# CLOSED_BUILD controls whether we try to build files under |
|
59 |
# usr/closed. ("" means to build closed code, "#" means don't try to |
|
60 |
# build it.) Skipping the closed code implies doing an export release |
|
61 |
# build. |
|
0 | 62 |
# |
63 |
# STRIP_COMMENTS toggles comment section striping. Generally the same setting |
|
64 |
# as INTERNAL_RELEASE_BUILD. |
|
65 |
# |
|
66 |
# __GNUC toggles the building of ON components using gcc and related tools. |
|
67 |
# Normally set to `#', set it to `' to do gcc build. |
|
68 |
# |
|
69 |
# The declaration POUND_SIGN is always '#'. This is needed to get around the |
|
70 |
# make feature that '#' is always a comment delimiter, even when escaped or |
|
71 |
# quoted. The only way of generating this is the :sh macro mechanism. Note |
|
72 |
# however that in general :sh macros should be avoided in makefiles that are |
|
73 |
# widely included into other makefiles, as the resulting shell executions can |
|
74 |
# cause a noticable slowdown in build times. |
|
75 |
# |
|
76 |
POUND_SIGN:sh= echo \\043 |
|
77 |
CH= $(POUND_SIGN) |
|
78 |
||
79 |
NOT_RELEASE_BUILD= |
|
80 |
INTERNAL_RELEASE_BUILD= $(POUND_SIGN) |
|
81 |
RELEASE_BUILD= $(POUND_SIGN) |
|
82 |
$(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN) |
|
83 |
$(RELEASE_BUILD)INTERNAL_RELEASE_BUILD= |
|
84 |
PATCH_BUILD= $(POUND_SIGN) |
|
85 |
||
1167 | 86 |
# If CLOSED_IS_PRESENT is not set, assume the closed tree is present. |
87 |
CLOSED_BUILD_1= $(CLOSED_IS_PRESENT:yes=) |
|
88 |
CLOSED_BUILD= $(CLOSED_BUILD_1:no=$(POUND_SIGN)) |
|
89 |
||
90 |
EXPORT_RELEASE_BUILD= $(POUND_SIGN) |
|
91 |
$(CLOSED_BUILD)EXPORT_RELEASE_BUILD= |
|
92 |
||
0 | 93 |
# SPARC_BLD is '#' for an Intel build. |
94 |
# INTEL_BLD is '#' for a Sparc build. |
|
95 |
SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN)) |
|
96 |
SPARC_BLD= $(SPARC_BLD_1:sparc=) |
|
97 |
INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN)) |
|
98 |
INTEL_BLD= $(INTEL_BLD_1:i386=) |
|
99 |
||
100 |
STRIP_COMMENTS= $(INTERNAL_RELEASE_BUILD) |
|
101 |
||
102 |
# set __GNUC= in the environment to build 32-bit with the gcc compiler. |
|
499
3fe4d3ff5864
6316914 changes in ON needed for Vulcan (SunStudio 10) compiler switch
petede
parents:
411
diff
changeset
|
103 |
# The default is to use the Sun Studio 10 compiler for all processor types. |
0 | 104 |
__GNUC= $(POUND_SIGN) |
105 |
||
499
3fe4d3ff5864
6316914 changes in ON needed for Vulcan (SunStudio 10) compiler switch
petede
parents:
411
diff
changeset
|
106 |
# set __GNUC64= in the environment to build 64-bit with the gcc compiler. |
3fe4d3ff5864
6316914 changes in ON needed for Vulcan (SunStudio 10) compiler switch
petede
parents:
411
diff
changeset
|
107 |
# The default is to use the Sun Studio 10 compiler by using the __GNUC |
3fe4d3ff5864
6316914 changes in ON needed for Vulcan (SunStudio 10) compiler switch
petede
parents:
411
diff
changeset
|
108 |
# setting. |
3fe4d3ff5864
6316914 changes in ON needed for Vulcan (SunStudio 10) compiler switch
petede
parents:
411
diff
changeset
|
109 |
__GNUC64= $(__GNUC) |
0 | 110 |
|
1167 | 111 |
# CLOSED is the root of the tree that contains source which isn't released |
112 |
# as open source |
|
113 |
CLOSED= $(SRC)/../closed |
|
114 |
||
0 | 115 |
# BUILD_TOOLS is the root of all tools including compilers. |
116 |
# ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld. |
|
117 |
||
118 |
BUILD_TOOLS= /ws/onnv-tools |
|
119 |
ONBLD_TOOLS= $(BUILD_TOOLS)/onbld |
|
120 |
||
121 |
JAVA_ROOT= /usr/java |
|
122 |
||
123 |
SFW_ROOT= /usr/sfw |
|
39
dc9b7493e881
6287497 openssl cpp flags needs to be adjusted for export builds
dinak
parents:
0
diff
changeset
|
124 |
SFWINCDIR= $(SFW_ROOT)/include |
0 | 125 |
SFWLIBDIR= $(SFW_ROOT)/lib |
126 |
SFWLIBDIR64= $(SFW_ROOT)/lib/$(MACH64) |
|
127 |
||
128 |
RPCGEN= /usr/bin/rpcgen |
|
129 |
STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs |
|
130 |
ECHO= echo |
|
131 |
INS= install |
|
132 |
TRUE= true |
|
133 |
SYMLINK= /usr/bin/ln -s |
|
134 |
LN= /usr/bin/ln |
|
135 |
CHMOD= /usr/bin/chmod |
|
136 |
CHOWN= $(TRUE) |
|
137 |
CHGRP= $(TRUE) |
|
138 |
MV= /usr/bin/mv -f |
|
139 |
RM= /usr/bin/rm -f |
|
140 |
GREP= /usr/bin/grep |
|
141 |
SED= /usr/bin/sed |
|
142 |
NAWK= /usr/bin/nawk |
|
143 |
CP= /usr/bin/cp -f |
|
144 |
MCS= /usr/ccs/bin/mcs |
|
145 |
CAT= /usr/bin/cat |
|
146 |
M4= /usr/ccs/bin/m4 |
|
147 |
STRIP= /usr/ccs/bin/strip |
|
148 |
LEX= /usr/ccs/bin/lex |
|
149 |
YACC= /usr/ccs/bin/yacc |
|
150 |
CPP= /usr/lib/cpp |
|
151 |
JAVAC= $(JAVA_ROOT)/bin/javac |
|
152 |
JAVAH= $(JAVA_ROOT)/bin/javah |
|
153 |
JAVADOC= $(JAVA_ROOT)/bin/javadoc |
|
154 |
RMIC= $(JAVA_ROOT)/bin/rmic |
|
155 |
JAR= $(JAVA_ROOT)/bin/jar |
|
156 |
CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert |
|
157 |
CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge |
|
158 |
CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs |
|
159 |
GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets |
|
160 |
CTFCVTPTBL= $(ONBLD_TOOLS)/bin/ctfcvtptbl |
|
161 |
CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod |
|
162 |
XREF= $(ONBLD_TOOLS)/bin/xref |
|
163 |
FIND= /usr/bin/find |
|
164 |
PERL= /usr/bin/perl |
|
165 |
SORT= /usr/bin/sort |
|
166 |
TOUCH= /usr/bin/touch |
|
167 |
WC= /usr/bin/wc |
|
168 |
XARGS= /usr/bin/xargs |
|
169 |
ELFSIGN= /usr/bin/elfsign |
|
170 |
DTRACE= /usr/sbin/dtrace |
|
171 |
||
172 |
FILEMODE= 644 |
|
173 |
DIRMODE= 755 |
|
174 |
||
175 |
# Note: owner and group for proto area objects is no longer set by |
|
176 |
# Makefiles at all. These have no real effect and are kept here for |
|
177 |
# transition purposes. They (along with CH, CHOWN, and CHGRP) should be |
|
178 |
# removed early in the s11 development cycle. |
|
179 |
OWNER= root |
|
180 |
GROUP= bin |
|
181 |
||
182 |
# |
|
183 |
# The version of the patch makeup table optimized for build-time use. Used |
|
184 |
# during patch builds only. |
|
185 |
$(PATCH_BUILD)PMTMO_FILE=$(SRC)/patch_makeup_table.mo |
|
186 |
||
187 |
# Declare that nothing should be built in parallel. |
|
188 |
# Individual Makefiles can use the .PARALLEL target to declare otherwise. |
|
189 |
.NO_PARALLEL: |
|
190 |
||
191 |
# For stylistic checks |
|
192 |
# |
|
193 |
# Note that the X and C checks are not used at this time and may need |
|
194 |
# modification when they are actually used. |
|
195 |
# |
|
196 |
CSTYLE= cstyle |
|
197 |
CSTYLE_TAIL= |
|
198 |
HDRCHK= hdrchk |
|
199 |
HDRCHK_TAIL= |
|
200 |
JSTYLE= jstyle |
|
201 |
||
202 |
DOT_H_CHECK= \ |
|
203 |
@$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \ |
|
204 |
$(HDRCHK) $< $(HDRCHK_TAIL) |
|
205 |
||
206 |
DOT_X_CHECK= \ |
|
207 |
@$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \ |
|
208 |
$(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL) |
|
209 |
||
210 |
DOT_C_CHECK= \ |
|
211 |
@$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL) |
|
212 |
||
213 |
MANIFEST_CHECK= \ |
|
214 |
@$(ECHO) "checking $<"; \ |
|
215 |
SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \ |
|
216 |
$(SRC)/cmd/svc/svccfg/svccfg-native validate $< |
|
217 |
||
218 |
INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $< |
|
219 |
INS.dir= $(INS) -s -d -m $(DIRMODE) $@ |
|
220 |
# installs and renames at once |
|
221 |
# |
|
222 |
INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@ |
|
223 |
||
224 |
# install a link |
|
225 |
INSLINKTARGET= $< |
|
226 |
INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@ |
|
227 |
||
228 |
# MACH must be set in the shell environment per uname -p on the build host |
|
229 |
# More specific architecture variables should be set in lower makefiles. |
|
230 |
# |
|
231 |
# MACH64 is derived from MACH, and BUILD64 is set to `#' for |
|
232 |
# architectures on which we do not build 64-bit versions. |
|
233 |
# (There are no such architectures at the moment.) |
|
234 |
# |
|
235 |
# Set BUILD64=# in the environment to disable 64-bit amd64 |
|
236 |
# builds on i386 machines. |
|
237 |
||
238 |
MACH64_1= $(MACH:sparc=sparcv9) |
|
239 |
MACH64= $(MACH64_1:i386=amd64) |
|
240 |
||
241 |
MACH32_1= $(MACH:sparc=sparcv7) |
|
242 |
MACH32= $(MACH32_1:i386=i86) |
|
243 |
||
244 |
sparc_BUILD64= |
|
245 |
i386_BUILD64= |
|
246 |
BUILD64= $($(MACH)_BUILD64) |
|
247 |
||
248 |
# |
|
249 |
# C compiler mode. Future compilers may change the default on us, |
|
250 |
# so force extended ANSI mode globally. Lower level makefiles can |
|
251 |
# override this by setting CCMODE. |
|
252 |
# |
|
253 |
CCMODE= -Xa |
|
254 |
CCMODE64= -Xa |
|
255 |
||
256 |
# |
|
257 |
# C compiler verbose mode. This is so we can enable it globally, |
|
258 |
# but turn it off in the lower level makefiles of things we cannot |
|
259 |
# (or aren't going to) fix. |
|
260 |
# |
|
261 |
CCVERBOSE= -v |
|
262 |
||
263 |
# set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings |
|
264 |
# from the compiler about places the -xarch=v9 may differ from -xarch=v9c. |
|
265 |
V9ABIWARN= |
|
266 |
||
267 |
# set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register |
|
268 |
# symbols (used to detect conflicts between objects that use global registers) |
|
269 |
# we disable this now for safety, and because genunix doesn't link with |
|
270 |
# this feature (the v9 default) enabled. |
|
271 |
# |
|
272 |
# REGSYM is separate since the C++ driver syntax is different. |
|
273 |
CCREGSYM= -Wc,-Qiselect-regsym=0 |
|
274 |
CCCREGSYM= -Qoption cg -Qiselect-regsym=0 |
|
275 |
||
276 |
# |
|
277 |
# generate 32-bit addresses in the v9 kernel. Saves memory. |
|
278 |
CCABS32= -Wc,-xcode=abs32 |
|
279 |
||
280 |
# One optimization the compiler might perform is to turn this: |
|
281 |
# #pragma weak foo |
|
282 |
# extern int foo; |
|
283 |
# if (&foo) |
|
284 |
# foo = 5; |
|
285 |
# into |
|
286 |
# foo = 5; |
|
287 |
# Since we do some of this (foo might be referenced in common kernel code |
|
288 |
# but provided only for some cpu modules or platforms), we disable this |
|
289 |
# optimization. |
|
290 |
# |
|
291 |
sparc_CCUNBOUND = -Wd,-xsafe=unboundsym |
|
292 |
i386_CCUNBOUND = |
|
293 |
CCUNBOUND = $($(MACH)_CCUNBOUND) |
|
294 |
||
295 |
# |
|
296 |
# compiler '-xarch' flag. This is here to centralize it and make it |
|
297 |
# overridable for testing. |
|
298 |
sparc_XARCH= -xarch=v8 |
|
299 |
sparcv9_XARCH= -xarch=v9 |
|
300 |
i386_XARCH= |
|
301 |
amd64_XARCH= -xarch=amd64 -Ui386 -U__i386 |
|
302 |
||
303 |
# assembler '-xarch' flag. Different from compiler '-xarch' flag. |
|
304 |
sparc_AS_XARCH= -xarch=v8 |
|
305 |
sparcv9_AS_XARCH= -xarch=v9 |
|
306 |
i386_AS_XARCH= |
|
307 |
amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386 |
|
308 |
||
309 |
# |
|
310 |
# These flags define what we need to be 'standalone' i.e. -not- part |
|
311 |
# of the rather more cosy userland environment. This basically means |
|
312 |
# the kernel. |
|
313 |
# |
|
314 |
# XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone |
|
315 |
# |
|
580 | 316 |
sparc_STAND_FLAGS= -_gcc=-ffreestanding |
317 |
sparcv9_STAND_FLAGS= -_gcc=-ffreestanding |
|
0 | 318 |
i386_STAND_FLAGS= -_gcc=-ffreestanding |
319 |
amd64_STAND_FLAGS= -Wu,-xmodel=kernel |
|
320 |
||
321 |
SAVEARGS= -Wu,-save_args |
|
322 |
amd64_STAND_FLAGS += $(SAVEARGS) |
|
323 |
||
324 |
STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS) |
|
325 |
STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS) |
|
326 |
||
327 |
# |
|
328 |
# disable the incremental linker |
|
329 |
ILDOFF= -xildoff |
|
330 |
# |
|
331 |
XDEPEND= -xdepend |
|
332 |
XFFLAG= -xF |
|
333 |
XESS= -xs |
|
334 |
XSTRCONST= -xstrconst |
|
335 |
||
336 |
# |
|
337 |
# turn warnings into errors (C) |
|
338 |
CERRWARN = -errtags=yes -errwarn=%all |
|
339 |
CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT |
|
340 |
CERRWARN += -erroff=E_STATEMENT_NOT_REACHED |
|
341 |
||
342 |
# |
|
343 |
# turn warnings into errors (C++) |
|
344 |
CCERRWARN= -xwe |
|
345 |
||
346 |
# C99 mode |
|
347 |
C99_ENABLE= -xc99=%all |
|
348 |
C99_DISABLE= -xc99=%none |
|
349 |
C99MODE= $(C99_DISABLE) |
|
65
590fbd3d0588
6289474 C99LMODE should derive automatically from C99MODE
mike_s
parents:
39
diff
changeset
|
350 |
C99LMODE= $(C99MODE:-xc99%=-Xc99%) |
0 | 351 |
|
352 |
# In most places, assignments to these macros should be appended with += |
|
353 |
# (CPPFLAGS.master allows values to be prepended to CPPFLAGS). |
|
354 |
sparc_CFLAGS= $(sparc_XARCH) |
|
355 |
sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) |
|
356 |
i386_CFLAGS= $(i386_XARCH) |
|
357 |
amd64_CFLAGS= $(amd64_XARCH) |
|
358 |
||
359 |
sparc_ASFLAGS= $(sparc_AS_XARCH) |
|
360 |
sparcv9_ASFLAGS=$(sparcv9_AS_XARCH) |
|
361 |
i386_ASFLAGS= $(i386_AS_XARCH) |
|
362 |
amd64_ASFLAGS= $(amd64_AS_XARCH) |
|
363 |
||
364 |
# |
|
365 |
sparc_COPTFLAG= -xO3 |
|
366 |
sparcv9_COPTFLAG= -xO3 |
|
367 |
i386_COPTFLAG= -O |
|
282
1ba7cc96bbc5
6305107 Reduction in optimisation level hurts performance
sherrym
parents:
224
diff
changeset
|
368 |
amd64_COPTFLAG= -xO3 |
0 | 369 |
|
370 |
COPTFLAG= $($(MACH)_COPTFLAG) |
|
371 |
COPTFLAG64= $($(MACH64)_COPTFLAG) |
|
372 |
||
373 |
# When -g is used, the compiler globalizes static objects |
|
374 |
# (gives them a unique prefix). Disable that. |
|
375 |
CNOGLOBAL= -W0,-noglobal |
|
376 |
||
580 | 377 |
# Normally, gcc uses indirect DWARF strings to save space. However, |
378 |
# this causes relocations that ctfconvert cannot handle. Disable this. |
|
379 |
CDWARFSTR= -_gcc=-fno-dwarf2-indirect-strings |
|
380 |
||
381 |
# Sometimes we want all symbols and types in debugging information even |
|
382 |
# if they aren't used. |
|
383 |
CALLSYMS= -W0,-xdbggen=no%usedonly |
|
384 |
||
0 | 385 |
# |
386 |
# Flags used to build in debug mode for ctf generation. Bugs in the Devpro |
|
387 |
# compilers currently prevent us from building with cc-emitted DWARF. |
|
388 |
# |
|
580 | 389 |
CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR) |
390 |
CTF_FLAGS_i386 = -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR) |
|
0 | 391 |
CTF_FLAGS = $(CTF_FLAGS_$(MACH)) |
392 |
||
393 |
# |
|
394 |
# Flags used with genoffsets |
|
395 |
# |
|
224 | 396 |
GOFLAGS = -_noecho \ |
580 | 397 |
$(CALLSYMS) \ |
398 |
$(CDWARFSTR) |
|
0 | 399 |
|
400 |
OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \ |
|
401 |
$(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS) |
|
402 |
||
403 |
OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \ |
|
404 |
$(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS) |
|
405 |
||
406 |
# |
|
407 |
# tradeoff time for space (smaller is better) |
|
408 |
# |
|
409 |
sparc_SPACEFLAG = -xspace -W0,-Lt -W2,-Rcond_elim |
|
410 |
sparcv9_SPACEFLAG = -xspace -W0,-Lt -W2,-Rcond_elim |
|
411 |
i386_SPACEFLAG = -xspace |
|
412 |
amd64_SPACEFLAG = |
|
413 |
||
414 |
SPACEFLAG = $($(MACH)_SPACEFLAG) |
|
415 |
SPACEFLAG64 = $($(MACH64)_SPACEFLAG) |
|
416 |
||
417 |
sparc_XREGSFLAG = -xregs=no%appl |
|
418 |
sparcv9_XREGSFLAG = -xregs=no%appl |
|
419 |
i386_XREGSFLAG = |
|
420 |
amd64_XREGSFLAG = |
|
421 |
||
422 |
XREGSFLAG = $($(MACH)_XREGSFLAG) |
|
423 |
XREGSFLAG64 = $($(MACH64)_XREGSFLAG) |
|
424 |
||
425 |
CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \ |
|
426 |
$(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) |
|
427 |
CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \ |
|
428 |
$(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) |
|
429 |
NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \ |
|
430 |
$(ILDOFF) $(CERRWARN) $(C99MODE) $($(NATIVE_MACH)_CCUNBOUND) |
|
431 |
||
432 |
DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging. |
|
433 |
DTS_ERRNO=-D_TS_ERRNO |
|
434 |
CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \ |
|
435 |
$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) |
|
436 |
CPPFLAGS= $(CPPFLAGS.master) |
|
437 |
AS_CPPFLAGS= $(CPPFLAGS.master) |
|
438 |
JAVAFLAGS= -deprecation |
|
439 |
||
440 |
# |
|
441 |
# For source message catalogue |
|
442 |
# |
|
443 |
.SUFFIXES: $(SUFFIXES) .i .po |
|
444 |
MSGROOT= $(ROOT)/catalog |
|
445 |
MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN) |
|
446 |
MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE) |
|
447 |
DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN) |
|
448 |
DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po) |
|
449 |
||
450 |
CLOBBERFILES += $(POFILE) $(POFILES) |
|
451 |
COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS) |
|
452 |
XGETTEXT= /usr/bin/xgettext |
|
453 |
XGETFLAGS= -c TRANSLATION_NOTE |
|
454 |
BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\ |
|
455 |
$(RM) $@ ;\ |
|
456 |
sed "/^domain/d" < $(<F).po > $@ ;\ |
|
457 |
$(RM) $(<F).po $<.i |
|
458 |
# |
|
459 |
# This is overwritten by local Makefile when PROG is a list. |
|
460 |
# |
|
461 |
POFILE= $(PROG).po |
|
462 |
||
463 |
sparc_CCFLAGS= -cg92 -compat=4 \ |
|
464 |
-Qoption ccfe -messages=no%anachronism \ |
|
465 |
$(CCERRWARN) |
|
466 |
sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \ |
|
467 |
-Qoption ccfe -messages=no%anachronism \ |
|
468 |
-Qoption ccfe -features=no%conststrings \ |
|
469 |
$(CCCREGSYM) \ |
|
470 |
$(CCERRWARN) |
|
471 |
i386_CCFLAGS= -compat=4 \ |
|
472 |
-Qoption ccfe -messages=no%anachronism \ |
|
473 |
-Qoption ccfe -features=no%conststrings \ |
|
474 |
$(CCERRWARN) |
|
475 |
amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \ |
|
476 |
-Qoption ccfe -messages=no%anachronism \ |
|
477 |
-Qoption ccfe -features=no%conststrings \ |
|
478 |
$(CCERRWARN) |
|
479 |
||
480 |
sparc_CCOPTFLAG= -O |
|
481 |
sparcv9_CCOPTFLAG= -O |
|
482 |
i386_CCOPTFLAG= -O |
|
483 |
amd64_CCOPTFLAG= -O |
|
484 |
||
485 |
CCOPTFLAG= $($(MACH)_CCOPTFLAG) |
|
486 |
CCOPTFLAG64= $($(MACH64)_CCOPTFLAG) |
|
487 |
CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) |
|
488 |
CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) |
|
489 |
# |
|
490 |
# Used by Makefile.cmd, Makefile.lib and Makefile.ucbcmd |
|
491 |
# |
|
492 |
PGA_MAPFILE = $(SRC)/cmd/sgs/mapfiles/$(MACH)/map.pagealign |
|
493 |
# |
|
494 |
# |
|
495 |
# LDLIBS32 can be set in the environment to override the following assignment. |
|
496 |
# LDLIBS64 can be set to override the assignment made in Makefile.master.64. |
|
497 |
# These environment settings make sure that no libraries are searched outside |
|
498 |
# of the local workspace proto area: |
|
499 |
# LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib |
|
500 |
# LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64 |
|
501 |
# |
|
502 |
LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3) |
|
503 |
LDLIBS.cmd = $(LDLIBS32) |
|
504 |
LDLIBS.lib = $(LDLIBS32) |
|
505 |
# |
|
506 |
# Define compilation macros. |
|
507 |
# |
|
508 |
COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c |
|
509 |
COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c |
|
510 |
COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c |
|
511 |
COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c |
|
512 |
COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS) |
|
513 |
COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS) |
|
514 |
COMPILE.d= $(DTRACE) -G -32 |
|
515 |
COMPILE64.d= $(DTRACE) -G -64 |
|
516 |
||
517 |
CLASSPATH= . |
|
518 |
COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH) |
|
519 |
||
520 |
# |
|
521 |
# Link time macros |
|
522 |
# |
|
523 |
CCNEEDED = -lC |
|
411
ae71859f7fc8
6302154 fix for 6297567 introduces some undesirable output changes
wesolows
parents:
376
diff
changeset
|
524 |
$(__GNUC)CCNEEDED = -L$(SFWLIBDIR) -R$(SFWLIBDIR) -lstdc++ -lgcc_s |
0 | 525 |
|
526 |
LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) |
|
527 |
LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS) |
|
528 |
NORUNPATH= -norunpath -nolib |
|
529 |
LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \ |
|
530 |
$(LDFLAGS) $(CCNEEDED) |
|
531 |
LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \ |
|
532 |
$(LDFLAGS) $(CCNEEDED) |
|
533 |
||
534 |
# |
|
535 |
# lint macros |
|
536 |
# |
|
537 |
# Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once |
|
538 |
# ON is built with a version of lint that has the fix for 4484186. |
|
539 |
# |
|
540 |
ALWAYS_LINT_DEFS = -errtags=yes -s |
|
541 |
ALWAYS_LINT_DEFS += -erroff=E_PTRDIFF_OVERFLOW |
|
542 |
ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_NARROW_CONV |
|
543 |
ALWAYS_LINT_DEFS += -U__PRAGMA_REDEFINE_EXTNAME |
|
544 |
ALWAYS_LINT_DEFS += $(C99LMODE) |
|
545 |
ALWAYS_LINT_DEFS += -errsecurity=$(SECLEVEL) |
|
546 |
ALWAYS_LINT_DEFS += -erroff=E_SEC_CREAT_WITHOUT_EXCL |
|
547 |
ALWAYS_LINT_DEFS += -erroff=E_SEC_FORBIDDEN_WARN_CREAT |
|
548 |
# XX64 -- really only needed for amd64 lint |
|
549 |
ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_INT_TO_SMALL_INT |
|
550 |
ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT |
|
551 |
ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_TO_SMALL_INT |
|
552 |
ALWAYS_LINT_DEFS += -erroff=E_CAST_TO_PTR_FROM_INT |
|
553 |
ALWAYS_LINT_DEFS += -erroff=E_COMP_INT_WITH_LARGE_INT |
|
554 |
ALWAYS_LINT_DEFS += -erroff=E_INTEGRAL_CONST_EXP_EXPECTED |
|
555 |
ALWAYS_LINT_DEFS += -erroff=E_PASS_INT_TO_SMALL_INT |
|
556 |
ALWAYS_LINT_DEFS += -erroff=E_PTR_CONV_LOSES_BITS |
|
557 |
||
558 |
SECLEVEL= core |
|
559 |
LINT.c= $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(ALWAYS_LINT_DEFS) |
|
560 |
LINT64.c= $(LINT) $(LINTFLAGS64) $(CPPFLAGS) $(ALWAYS_LINT_DEFS) |
|
561 |
LINT.s= $(LINT.c) |
|
562 |
||
563 |
# For some future builds, NATIVE_MACH and MACH might be different. |
|
564 |
# Therefore, NATIVE_MACH needs to be redefined in the |
|
565 |
# environment as `uname -p` to override this macro. |
|
566 |
# |
|
567 |
# For now at least, we cross-compile amd64 on i386 machines. |
|
568 |
NATIVE_MACH= $(MACH:amd64=i386) |
|
569 |
||
570 |
# Define native compilation macros |
|
571 |
# |
|
572 |
||
573 |
# Base directory where compilers are loaded. |
|
574 |
# Defined here so it can be overridden by developer. |
|
575 |
# |
|
576 |
SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro |
|
499
3fe4d3ff5864
6316914 changes in ON needed for Vulcan (SunStudio 10) compiler switch
petede
parents:
411
diff
changeset
|
577 |
SPRO_VROOT= $(SPRO_ROOT)/SOS10 |
0 | 578 |
GNU_ROOT= $(SFW_ROOT) |
579 |
||
580 |
# Specify platform compiler versions for languages |
|
581 |
# that we use (currently only c and c++). |
|
582 |
# |
|
224 | 583 |
sparc_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc |
584 |
$(__GNUC)sparc_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc |
|
585 |
sparc_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC |
|
586 |
$(__GNUC)sparc_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++ |
|
0 | 587 |
sparc_CPP= /usr/ccs/lib/cpp |
588 |
sparc_AS= /usr/ccs/bin/as -xregsym=no |
|
589 |
sparc_LD= /usr/ccs/bin/ld |
|
590 |
sparc_LINT= $(SPRO_VROOT)/bin/lint |
|
591 |
||
224 | 592 |
sparcv9_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc |
593 |
$(__GNUC64)sparcv9_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc |
|
594 |
sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC |
|
595 |
$(__GNUC64)sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++ |
|
0 | 596 |
sparcv9_CPP= /usr/ccs/lib/cpp |
597 |
sparcv9_AS= /usr/ccs/bin/as -xregsym=no |
|
598 |
sparcv9_LD= /usr/ccs/bin/ld |
|
599 |
sparcv9_LINT= $(SPRO_VROOT)/bin/lint |
|
600 |
||
601 |
# We compile 32-bit objects with cc by default |
|
602 |
i386_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc |
|
603 |
$(__GNUC)i386_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc |
|
604 |
i386_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC |
|
605 |
$(__GNUC)i386_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++ |
|
606 |
i386_CPP= /usr/ccs/lib/cpp |
|
607 |
i386_AS= /usr/ccs/bin/as |
|
608 |
$(__GNUC)i386_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw |
|
609 |
i386_LD= /usr/ccs/bin/ld |
|
610 |
i386_LINT= $(SPRO_VROOT)/bin/lint |
|
611 |
||
612 |
# We compile 64-bit objects with gcc |
|
613 |
amd64_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc |
|
614 |
$(__GNUC64)amd64_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc |
|
615 |
amd64_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC |
|
616 |
$(__GNUC64)amd64_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++ |
|
617 |
amd64_CPP= /usr/ccs/lib/cpp |
|
618 |
amd64_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw |
|
619 |
amd64_LD= /usr/ccs/bin/ld |
|
499
3fe4d3ff5864
6316914 changes in ON needed for Vulcan (SunStudio 10) compiler switch
petede
parents:
411
diff
changeset
|
620 |
amd64_LINT= $(SPRO_VROOT)/bin/lint |
0 | 621 |
|
622 |
NATIVECC= $($(NATIVE_MACH)_CC) |
|
623 |
NATIVECCC= $($(NATIVE_MACH)_CCC) |
|
624 |
NATIVECPP= $($(NATIVE_MACH)_CPP) |
|
625 |
NATIVEAS= $($(NATIVE_MACH)_AS) |
|
626 |
NATIVELD= $($(NATIVE_MACH)_LD) |
|
627 |
NATIVELINT= $($(NATIVE_MACH)_LINT) |
|
628 |
||
629 |
# |
|
630 |
# Makefile.master.64 overrides these settings |
|
631 |
# |
|
632 |
CC= $(NATIVECC) |
|
633 |
CCC= $(NATIVECCC) |
|
634 |
CPP= $(NATIVECPP) |
|
635 |
AS= $(NATIVEAS) |
|
636 |
LD= $(NATIVELD) |
|
637 |
LINT= $(NATIVELINT) |
|
638 |
||
580 | 639 |
# The real compilers used for this build |
640 |
CW_CC_CMD= $(CC) -_compiler |
|
641 |
CW_CCC_CMD= $(CCC) -_compiler |
|
642 |
REAL_CC= $(CW_CC_CMD:sh) |
|
643 |
REAL_CCC= $(CW_CCC_CMD:sh) |
|
644 |
||
0 | 645 |
# Pass -Y flag to cpp (method of which is release-dependent) |
646 |
CCYFLAG= -Y I, |
|
647 |
||
648 |
BDIRECT= -Bdirect |
|
649 |
BDYNAMIC= -Bdynamic |
|
650 |
BLOCAL= -Blocal |
|
651 |
BREDUCE= -Breduce |
|
652 |
BSTATIC= -Bstatic |
|
653 |
BSYMBOLIC= -Bsymbolic |
|
654 |
||
655 |
ZCOMBRELOC= -zcombreloc |
|
656 |
ZDEFS= -zdefs |
|
657 |
ZIGNORE= -zignore |
|
658 |
ZINITFIRST= -zinitfirst |
|
659 |
ZINTERPOSE= -zinterpose |
|
660 |
ZLAZYLOAD= -zlazyload |
|
661 |
ZLOADFLTR= -zloadfltr |
|
662 |
ZMULDEFS= -zmuldefs |
|
663 |
ZNODEFAULTLIB= -znodefaultlib |
|
664 |
ZNODEFS= -znodefs |
|
665 |
ZNODELETE= -znodelete |
|
666 |
ZNODLOPEN= -znodlopen |
|
667 |
ZNODUMP= -znodump |
|
668 |
ZNOLAZYLOAD= -znolazyload |
|
580 | 669 |
ZNORELOC= -znoreloc |
0 | 670 |
ZNOVERSION= -znoversion |
671 |
ZREDLOCSYM= -zredlocsym |
|
672 |
ZTEXT= -ztext |
|
673 |
||
674 |
GSHARED= -G |
|
675 |
CCMT= -mt |
|
676 |
||
677 |
# Handle different PIC models on different ISAs |
|
678 |
# (May be overridden by lower-level Makefiles) |
|
679 |
||
680 |
sparc_C_PICFLAGS = -K pic |
|
681 |
sparcv9_C_PICFLAGS = -K pic |
|
682 |
i386_C_PICFLAGS = -K pic |
|
683 |
amd64_C_PICFLAGS = -K pic |
|
684 |
C_PICFLAGS = $($(MACH)_C_PICFLAGS) |
|
685 |
C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS) |
|
686 |
||
687 |
sparc_C_BIGPICFLAGS = -K PIC |
|
688 |
sparcv9_C_BIGPICFLAGS = -K PIC |
|
689 |
i386_C_BIGPICFLAGS = -K PIC |
|
690 |
amd64_C_BIGPICFLAGS = -K PIC |
|
691 |
C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS) |
|
692 |
C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS) |
|
693 |
||
694 |
# CC requires there to be no space between '-K' and 'pic' or 'PIC'. |
|
695 |
sparc_CC_PICFLAGS = -Kpic |
|
696 |
sparcv9_CC_PICFLAGS = -KPIC |
|
697 |
i386_CC_PICFLAGS = -Kpic |
|
698 |
amd64_CC_PICFLAGS = -Kpic |
|
699 |
CC_PICFLAGS = $($(MACH)_CC_PICFLAGS) |
|
700 |
CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS) |
|
701 |
||
702 |
AS_PICFLAGS= $(C_PICFLAGS) |
|
703 |
AS_BIGPICFLAGS= $(C_BIGPICFLAGS) |
|
704 |
||
705 |
# |
|
706 |
# Default label for CTF sections |
|
707 |
# |
|
708 |
CTFCVTFLAGS= -i -L VERSION |
|
709 |
||
710 |
# |
|
711 |
# Override to pass module-specific flags to ctfmerge. Currently used |
|
712 |
# only by krtld to turn on fuzzy matching. |
|
713 |
# |
|
714 |
CTFMRGFLAGS= |
|
715 |
||
716 |
CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@ |
|
717 |
||
718 |
ELFSIGN_O= $(TRUE) |
|
719 |
ELFSIGN_CRYPTO= $(ELFSIGN_O) |
|
720 |
ELFSIGN_OBJECT= $(ELFSIGN_O) |
|
1167 | 721 |
$(EXPORT_RELEASE_BUILD)ELFSIGN_O = $(ELFSIGN) |
722 |
$(EXPORT_RELEASE_BUILD)ELFSIGN_KEY = \ |
|
723 |
$(CLOSED)/cmd/cmd-crypto/etc/keys/SUNWosnet |
|
724 |
$(EXPORT_RELEASE_BUILD)ELFSIGN_CERT= \ |
|
725 |
$(CLOSED)/cmd/cmd-crypto/etc/certs/SUNWosnet |
|
726 |
$(EXPORT_RELEASE_BUILD)ELFSIGN_SEKEY = \ |
|
727 |
$(CLOSED)/cmd/cmd-crypto/etc/keys/SUNWosnetSolaris |
|
728 |
$(EXPORT_RELEASE_BUILD)ELFSIGN_SECERT= \ |
|
729 |
$(CLOSED)/cmd/cmd-crypto/etc/certs/SUNWosnetSolaris |
|
730 |
$(EXPORT_RELEASE_BUILD)ELFSIGN_CRYPTO= $(ELFSIGN_O) sign \ |
|
731 |
$(ELFSIGN_FORMAT_OPTION) \ |
|
0 | 732 |
-k $(ELFSIGN_KEY) -c $(ELFSIGN_CERT) -e $@ |
1167 | 733 |
$(EXPORT_RELEASE_BUILD)ELFSIGN_OBJECT= $(ELFSIGN_O) sign \ |
734 |
$(ELFSIGN_FORMAT_OPTION) \ |
|
0 | 735 |
-k $(ELFSIGN_SEKEY) -c $(ELFSIGN_SECERT) -e $@ |
736 |
||
737 |
# Rules (normally from make.rules) and macros which are used for post |
|
738 |
# processing files. Normally, these do stripping of the comment section |
|
739 |
# automatically. |
|
740 |
# RELEASE_CM: Should be editted to reflect the release. |
|
741 |
# POST_PROCESS_O: Post-processing for `.o' files. |
|
742 |
# POST_PROCESS_A: Post-processing for `.a' files (currently null). |
|
743 |
# POST_PROCESS_SO: Post-processing for `.so' files. |
|
744 |
# POST_PROCESS: Post-processing for executable files (no suffix). |
|
745 |
# Note that these macros are not completely generalized as they are to be |
|
746 |
# used with the file name to be processed following. |
|
747 |
# |
|
748 |
# It is left as an exercise to Release Engineering to embellish the generation |
|
749 |
# of the release comment string. |
|
750 |
# |
|
751 |
# If this is a standard development build: |
|
752 |
# compress the comment section (mcs -c) |
|
753 |
# add the standard comment (mcs -a $(RELEASE_CM)) |
|
754 |
# add the development specific comment (mcs -a $(DEV_CM)) |
|
755 |
# |
|
756 |
# If this is an installation build: |
|
757 |
# delete the comment section (mcs -d) |
|
758 |
# add the standard comment (mcs -a $(RELEASE_CM)) |
|
759 |
# add the development specific comment (mcs -a $(DEV_CM)) |
|
760 |
# |
|
761 |
# If this is an release build: |
|
762 |
# delete the comment section (mcs -d) |
|
763 |
# add the standard comment (mcs -a $(RELEASE_CM)) |
|
764 |
# |
|
765 |
# The ONVERS macro sets the default value for the VERSION string |
|
766 |
# within pkginfo. |
|
767 |
# |
|
768 |
# The following list of macros are used in the definition of RELEASE_CM |
|
769 |
# which is used to label all binaries in the build: |
|
770 |
# |
|
771 |
# RELEASE Specific release of the build, eg: 5.2 |
|
772 |
# VERSION Version of the build (alpha, beta, Generic) |
|
773 |
# PATCHID If this is a patch this value should contain |
|
774 |
# the patchid value (eg: "Generic 100832-01"), otherwise |
|
775 |
# it will be set to $(VERSION) |
|
776 |
# RELEASE_DATE Date of the Release Build |
|
777 |
# PATCH_DATE Date the patch was created, if this is blank it |
|
778 |
# will default to the RELEASE_DATE |
|
779 |
# |
|
780 |
ONVERS= "11.11" |
|
781 |
RELEASE= 5.11 |
|
782 |
VERSION= SunOS Development |
|
783 |
PATCHID= $(VERSION) |
|
784 |
RELEASE_DATE= October 2007 |
|
785 |
PATCH_DATE= $(RELEASE_DATE) |
|
786 |
RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)" |
|
787 |
DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: \ |
|
788 |
`$(ECHO) $$LOGNAME` `date +%Y-%m-%d` `$(ECHO) [\`basename $$CODEMGR_WS\`]`" |
|
789 |
||
790 |
PROCESS_COMMENT= @?${MCS} -c -a $(RELEASE_CM) -a $(DEV_CM) |
|
791 |
$(STRIP_COMMENTS)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM) |
|
792 |
$(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) |
|
793 |
||
794 |
STRIP_STABS= : |
|
795 |
$(RELEASE_BUILD)STRIP_STABS= $(STRIP) -x $@ |
|
796 |
||
797 |
POST_PROCESS_O= $(PROCESS_COMMENT) $@ |
|
798 |
POST_PROCESS_A= |
|
799 |
POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \ |
|
800 |
$(ELFSIGN_OBJECT) |
|
524 | 801 |
POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \ |
802 |
$(ELFSIGN_OBJECT) |
|
0 | 803 |
|
804 |
# |
|
805 |
# The PKGDEFS macro points to the source directory containing the majority |
|
806 |
# of ON's package definitions plus Makefiles with general package creation |
|
807 |
# rules. |
|
808 |
# |
|
809 |
# PKGARCHIVE specifies the default location where packages should be |
|
810 |
# placed if built. |
|
811 |
# |
|
812 |
PKGDEFS=$(SRC)/pkgdefs |
|
813 |
$(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd |
|
814 |
PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX) |
|
815 |
||
816 |
# Default build rules which perform comment section post-processing. |
|
817 |
# |
|
818 |
.c: |
|
819 |
$(LINK.c) -o $@ $< $(LDLIBS) |
|
820 |
$(POST_PROCESS) |
|
821 |
.c.o: |
|
822 |
$(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK) |
|
823 |
$(POST_PROCESS_O) |
|
824 |
.c.a: |
|
825 |
$(COMPILE.c) -o $% $< |
|
826 |
$(PROCESS_COMMENT) $% |
|
827 |
$(AR) $(ARFLAGS) $@ $% |
|
828 |
$(RM) $% |
|
829 |
.s.o: |
|
830 |
$(COMPILE.s) -o $@ $< |
|
831 |
$(POST_PROCESS_O) |
|
832 |
.s.a: |
|
833 |
$(COMPILE.s) -o $% $< |
|
834 |
$(PROCESS_COMMENT) $% |
|
835 |
$(AR) $(ARFLAGS) $@ $% |
|
836 |
$(RM) $% |
|
837 |
.cc: |
|
838 |
$(LINK.cc) -o $@ $< $(LDLIBS) |
|
839 |
$(POST_PROCESS) |
|
840 |
.cc.o: |
|
841 |
$(COMPILE.cc) $(OUTPUT_OPTION) $< |
|
842 |
$(POST_PROCESS_O) |
|
843 |
.cc.a: |
|
844 |
$(COMPILE.cc) -o $% $< |
|
845 |
$(AR) $(ARFLAGS) $@ $% |
|
846 |
$(PROCESS_COMMENT) $% |
|
847 |
$(RM) $% |
|
848 |
.y: |
|
849 |
$(YACC.y) $< |
|
850 |
$(LINK.c) -o $@ y.tab.c $(LDLIBS) |
|
851 |
$(POST_PROCESS) |
|
852 |
$(RM) y.tab.c |
|
853 |
.y.o: |
|
854 |
$(YACC.y) $< |
|
855 |
$(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK) |
|
856 |
$(POST_PROCESS_O) |
|
857 |
$(RM) y.tab.c |
|
858 |
.l: |
|
859 |
$(RM) $*.c |
|
860 |
$(LEX.l) $< > $*.c |
|
861 |
$(LINK.c) -o $@ $*.c -ll $(LDLIBS) |
|
862 |
$(POST_PROCESS) |
|
863 |
$(RM) $*.c |
|
864 |
.l.o: |
|
865 |
$(RM) $*.c |
|
866 |
$(LEX.l) $< > $*.c |
|
867 |
$(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK) |
|
868 |
$(POST_PROCESS_O) |
|
869 |
$(RM) $*.c |
|
870 |
||
871 |
.java.class: |
|
872 |
$(COMPILE.java) $< |
|
873 |
||
874 |
# |
|
875 |
# Rules to create message catalogue files from .sh, .c, .y, and .l files. |
|
876 |
# For .sh files, we extract all gettext strings with sed(1) (being careful |
|
877 |
# to permit multiple gettext strings on the same line), weed out the dups, |
|
878 |
# and build the catalogue with awk(1). |
|
879 |
# |
|
880 |
||
881 |
.sh.po: |
|
882 |
$(SED) -n -e ":a" \ |
|
883 |
-e "h" \ |
|
884 |
-e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \ |
|
885 |
-e "x" \ |
|
886 |
-e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \ |
|
887 |
-e "t a" \ |
|
888 |
$< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@ |
|
889 |
||
890 |
# |
|
891 |
# When using xgettext, we want messages to go to the default domain, |
|
892 |
# rather than the specified one. This special version of the |
|
893 |
# COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN, |
|
894 |
# causing xgettext to put all messages into the default domain. |
|
895 |
# |
|
896 |
CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN) |
|
897 |
||
898 |
.c.i: |
|
899 |
$(CPPFORPO) $< > $@ |
|
900 |
||
901 |
.h.i: |
|
902 |
$(CPPFORPO) $< > $@ |
|
903 |
||
904 |
.y.i: |
|
905 |
$(YACC) -d $< |
|
906 |
$(CPPFORPO) y.tab.c > $@ |
|
907 |
$(RM) y.tab.c |
|
908 |
||
909 |
.l.i: |
|
910 |
$(LEX) $< |
|
911 |
$(CPPFORPO) lex.yy.c > $@ |
|
912 |
$(RM) lex.yy.c |
|
913 |
||
914 |
.c.po: |
|
915 |
$(CPPFORPO) $< > $<.i |
|
916 |
$(BUILD.po) |
|
917 |
||
918 |
.y.po: |
|
919 |
$(YACC) -d $< |
|
920 |
$(CPPFORPO) y.tab.c > $<.i |
|
921 |
$(BUILD.po) |
|
922 |
$(RM) y.tab.c |
|
923 |
||
924 |
.l.po: |
|
925 |
$(LEX) $< |
|
926 |
$(CPPFORPO) lex.yy.c > $<.i |
|
927 |
$(BUILD.po) |
|
928 |
$(RM) lex.yy.c |
|
929 |
||
930 |
# |
|
931 |
# Rules to perform stylistic checks |
|
932 |
# |
|
933 |
.SUFFIXES: $(SUFFIXES) .x .xml .check .xmlchk |
|
934 |
||
935 |
.h.check: |
|
936 |
$(DOT_H_CHECK) |
|
937 |
||
938 |
.x.check: |
|
939 |
$(DOT_X_CHECK) |
|
940 |
||
941 |
.xml.xmlchk: |
|
942 |
$(MANIFEST_CHECK) |
|
943 |
||
944 |
# |
|
945 |
# Rules to process ONC+ Source partial files |
|
946 |
# |
|
947 |
%_onc_plus: % |
|
948 |
@$(ECHO) "extracting code from $< ... " |
|
949 |
sed -n -e '/ONC_PLUS EXTRACT START/,/ONC_PLUS EXTRACT END/p' $< > $@ |