forked from omniosorg/g11n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.master
435 lines (365 loc) · 12.1 KB
/
Makefile.master
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
# Copyright 2011 Every City Ltd. All rights reserved.
#
# ident "@(#)Makefile.master 1.0 06/03/07 SMI"
#
MACH :sh= echo ${MACH-`uname -p`}
MACH64:sh = isainfo -k
#
# Global path variables - change these to suit your own build environment
#
# Base directory where compilers are located.
SPRO_VROOT= /opt/sunstudio12.1
# List of all our locales - if you need to add/remove any, do it here
ALL_LOCALES = ar_EG ar_SA bg_BG ca cs_CZ da_DK da_DK de_DE de_AT de_CH de_LU el_GR el_CY \
en_AU en_CA en_GB en_IE en_MT en_NZ en_US es_ES es_AR es_BO es_CL es_CO es_CR es_EC es_GT \
es_MX es_NI es_PA es_PE es_PY es_SV es_UY es_VE et_EE fi_FI fr_FR fr_BE fr_CA fr_CH fr_LU \
he_IL hi_IN hr_HR hu_HU is_IS it_IT ja_JP ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL nl_BE nn_NO \
no_NO no_NY pl_PL pt_PT pt_BR ro_RO ru_RU sh_BA sk_SK sl_SI sq_AL sr_CS sr_SP sr_YU sv_SE \
ta_IN th_TH tr_TR zh_CN zh_HK zh_TW iconv
# Method version - the suffix for all shared objects
METHOD_VERSION = 3
#
# End global variables - you shouldn't need to change anything from here down
#
# the location of the built pkgs
DEST = $(SRC)/dist/$(MACH)
# the location of the built binary-only tarballs
TB_DEST = $(SRC)/dist/closed_tarballs
# the location of the pkg building files
ROOT = $(SRC)/proto/$(MACH)
PKGROOT = $(ROOT)/pkgroot
FILEROOT = $(ROOT)/fileroot
# BUILD_TOOLS is the root of all tools including compilers.
# ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
BUILD_TOOLS= /ws/onnv-tools
ONBLD_TOOLS= $(BUILD_TOOLS)/onbld
JAVA_ROOT= /usr/java
SFW_ROOT= /usr/sfw
SFWINCDIR= $(SFW_ROOT)/include
SFWLIBDIR= $(SFW_ROOT)/lib
SFWLIBDIR64= $(SFW_ROOT)/lib/$(MACH64)
RPCGEN= /usr/bin/rpcgen
STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
ECHO= echo
INS= /usr/sbin/install -f
INSDIR= /usr/sbin/install -d
TRUE= true
TR = /usr/bin/tr
SYMLINK= /usr/bin/ln -s
LN= /usr/bin/ln
CHMOD= /usr/bin/chmod
CHOWN= $(TRUE)
CHGRP= $(TRUE)
COMPRESS= /usr/bin/compress
MV= /usr/bin/mv -f
RM= /usr/bin/rm -f
GREP= /usr/bin/grep
SED= /usr/bin/sed
NAWK= /usr/bin/nawk
CP= /usr/bin/cp -f
MCS= /usr/ccs/bin/mcs
CAT= /usr/bin/cat
M4= /usr/ccs/bin/m4
STRIP= /usr/ccs/bin/strip
LEX= /usr/ccs/bin/lex
YACC= /usr/ccs/bin/yacc
CPP= /usr/lib/cpp
JAVAC= $(JAVA_ROOT)/bin/javac
JAVAH= $(JAVA_ROOT)/bin/javah
JAVADOC= $(JAVA_ROOT)/bin/javadoc
RMIC= $(JAVA_ROOT)/bin/rmic
JAR= $(JAVA_ROOT)/bin/jar
GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
CTFCVTPTBL= $(ONBLD_TOOLS)/bin/ctfcvtptbl
CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod
XREF= $(ONBLD_TOOLS)/bin/xref
FIND= /usr/bin/find
PERL= /usr/bin/perl
SORT= /usr/bin/sort
TOUCH= /usr/bin/touch
WC= /usr/bin/wc
XARGS= /usr/bin/xargs
ELFSIGN= /usr/bin/elfsign
PKGMK= pkgmk
TAR= /usr/bin/tar
LD= /usr/ccs/bin/ld
BDFTOPCF = /usr/openwin/bin/bdftopcf
BZIP2= /usr/bin/bzip2 -9
RSYNC= /usr/bin/rsync
UNPACKARCHIVE= $(SRC)/tools/unpack-archive
# SUNWwgetu
WGET= /usr/bin/wget
# SUNWxorg-server
XKBCOMP= /usr/bin/xkbcomp
# locale_cldr
GNU_PATCH= /usr/bin/gpatch
# MACH must be set in the shell environment per uname -p on the build host
# More specific architecture variables should be set in lower makefiles.
#
# MACH64 is derived from MACH, and BUILD64 is set to `#' for
# architectures on which we do not build 64-bit versions.
# (There are no such architectures at the moment.)
#
# Set BUILD64=# in the environment to disable 64-bit amd64
# builds on i386 machines.
MACH64_1= $(MACH:sparc=sparcv9)
MACH64= $(MACH64_1:i386=amd64)
MACH32_1= $(MACH:sparc=sparcv7)
MACH32= $(MACH32_1:i386=i86)
sparc_BUILD64=
i386_BUILD64=
BUILD64= $($(MACH)_BUILD64)
#
# C compiler mode. Future compilers may change the default on us,
# so force extended ANSI mode globally. Lower level makefiles can
# override this by setting CCMODE.
#
CCMODE= -Xa
CCMODE64= -Xa
#
# C compiler verbose mode. This is so we can enable it globally,
# but turn it off in the lower level makefiles of things we cannot
# (or aren't going to) fix.
#
CCVERBOSE= -v
# set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings
# from the compiler about places the -xarch=v9 may differ from -xarch=v9c.
V9ABIWARN=
# set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register
# symbols (used to detect conflicts between objects that use global registers)
# we disable this now for safety, and because genunix doesn't link with
# this feature (the v9 default) enabled.
#
# REGSYM is separate since the C++ driver syntax is different.
CCREGSYM= -Wc,-Qiselect-regsym=0
CCCREGSYM= -Qoption cg -Qiselect-regsym=0
#
# generate 32-bit addresses in the v9 kernel. Saves memory.
CCABS32= -Wc,-xcode=abs32
# One optimization the compiler might perform is to turn this:
# #pragma weak foo
# extern int foo;
# if (&foo)
# foo = 5;
# into
# foo = 5;
# Since we do some of this (foo might be referenced in common kernel code
# but provided only for some cpu modules or platforms), we disable this
# optimization.
#
sparc_CCUNBOUND = -Wd,-xsafe=unboundsym
i386_CCUNBOUND =
CCUNBOUND = $($(MACH)_CCUNBOUND)
#
# compiler '-xarch' flag. This is here to centralize it and make it
# overridable for testing.
#sparc_XARCH= -xarch=v8
#sparcv9_XARCH= -xarch=v9
#i386_XARCH=
#amd64_XARCH= -xarch=amd64 -Ui386 -U__i386
#replace with ss12 specific flags
sparc_XARCH= -xarch=sparc -m32
sparcv9_XARCH= -xarch=sparc -m64
i386_XARCH=
amd64_XARCH= -xarch=sse2 -m64 -Ui386 -U__i386
# assembler '-xarch' flag. Different from compiler '-xarch' flag.
#sparc_AS_XARCH= -xarch=v8
#sparcv9_AS_XARCH= -xarch=v9
#i386_AS_XARCH=
#amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386
#replace with ss12 specific flags
sparc_AS_XARCH= -xarch=sparc -m32
sparcv9_AS_XARCH= -xarch=sparc -64
i386_AS_XARCH=
amd64_AS_XARCH= -xarch=sse2 -m64 -P -Ui386 -U__i386
#
# These flags define what we need to be 'standalone' i.e. -not- part
# of the rather more cosy userland environment. This basically means
# the kernel.
#
# XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
#
sparc_STAND_FLAGS= -_gcc=-ffreestanding
sparcv9_STAND_FLAGS= -_gcc=-ffreestanding
i386_STAND_FLAGS= -_gcc=-ffreestanding
amd64_STAND_FLAGS= -xmodel=kernel
SAVEARGS= -Wu,-save_args
amd64_STAND_FLAGS += $(SAVEARGS)
STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
#
# disable the incremental linker
ILDOFF= -xildoff
#
XDEPEND= -xdepend
XFFLAG= -xF
XESS= -xs
XSTRCONST= -xstrconst
#
# turn warnings into errors (C)
CERRWARN = -errtags=yes -errwarn=%all
CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
#
# turn warnings into errors (C++)
CCERRWARN= -xwe
# C99 mode
C99_ENABLE= -xc99=%all
C99_DISABLE= -xc99=%none
C99MODE= $(C99_ENABLE)
C99LMODE= $(C99MODE:-xc99%=-Xc99%)
# In most places, assignments to these macros should be appended with +=
# (CPPFLAGS.master allows values to be prepended to CPPFLAGS).
sparc_CFLAGS= $(sparc_XARCH)
sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM)
i386_CFLAGS= $(i386_XARCH)
amd64_CFLAGS= $(amd64_XARCH)
sparc_ASFLAGS= $(sparc_AS_XARCH)
sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
i386_ASFLAGS= $(i386_AS_XARCH)
amd64_ASFLAGS= $(amd64_AS_XARCH)
#
sparc_COPTFLAG= -xO3
sparcv9_COPTFLAG= -xO3
i386_COPTFLAG= -O
amd64_COPTFLAG= -xO3
COPTFLAG= $($(MACH)_COPTFLAG)
COPTFLAG64= $($(MACH64)_COPTFLAG)
#
# tradeoff time for space (smaller is better)
#
sparc_SPACEFLAG = -xspace -W0,-Lt -W2,-Rcond_elim
sparcv9_SPACEFLAG = -xspace -W0,-Lt -W2,-Rcond_elim
i386_SPACEFLAG = -xspace
amd64_SPACEFLAG =
SPACEFLAG = $($(MACH)_SPACEFLAG)
SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
sparc_XREGSFLAG = -xregs=no%appl
sparcv9_XREGSFLAG = -xregs=no%appl
i386_XREGSFLAG =
amd64_XREGSFLAG =
XREGSFLAG = $($(MACH)_XREGSFLAG)
XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
$(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND)
CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
$(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND)
NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
$(ILDOFF) $(CERRWARN) $(C99MODE) $($(NATIVE_MACH)_CCUNBOUND)
DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
DTS_ERRNO=-D_TS_ERRNO
CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \
$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
CPPFLAGS= $(CPPFLAGS.master)
AS_CPPFLAGS= $(CPPFLAGS.master)
JAVAFLAGS= -deprecation
#
# This is overwritten by local Makefile when PROG is a list.
#
POFILE= $(PROG).po
sparc_CCFLAGS= -cg92 -compat=4 \
-Qoption ccfe -messages=no%anachronism \
$(CCERRWARN)
sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \
-Qoption ccfe -messages=no%anachronism \
-Qoption ccfe -features=no%conststrings \
$(CCCREGSYM) \
$(CCERRWARN)
i386_CCFLAGS= -compat=4 \
-Qoption ccfe -messages=no%anachronism \
-Qoption ccfe -features=no%conststrings \
$(CCERRWARN)
amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \
-Qoption ccfe -messages=no%anachronism \
-Qoption ccfe -features=no%conststrings \
$(CCERRWARN)
sparc_CCOPTFLAG= -O
sparcv9_CCOPTFLAG= -O
i386_CCOPTFLAG= -O
amd64_CCOPTFLAG= -O
CCOPTFLAG= $($(MACH)_CCOPTFLAG)
CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS)
CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS)
# For some future builds, NATIVE_MACH and MACH might be different.
# Therefore, NATIVE_MACH needs to be redefined in the
# environment as `uname -p` to override this macro.
#
# For now at least, we cross-compile amd64 on i386 machines.
NATIVE_MACH= $(MACH:amd64=i386)
# Define native compilation macros
#
# Specify platform compiler versions for languages
# that we use (currently only c and c++).
#
sparc_CC= $(SPRO_VROOT)/bin/cc
sparc_CCC= $(SPRO_VROOT)/bin/CC
sparc_CPP= /usr/ccs/lib/cpp
sparc_LD= /usr/ccs/bin/ld
sparc_LINT= $(SPRO_VROOT)/bin/lint
sparcv9_CC= $(SPRO_VROOT)/bin/cc
sparcv9_CCC= $(SPRO_VROOT)/bin/CC
sparcv9_CPP= /usr/ccs/lib/cpp
sparcv9_LD= /usr/ccs/bin/ld
sparcv9_LINT= $(SPRO_VROOT)/bin/lint
# We compile 32-bit objects with cc by default
i386_CC= $(SPRO_VROOT)/bin/cc
i386_CCC= $(SPRO_VROOT)/bin/CC
i386_CPP= /usr/ccs/lib/cpp
i386_LD= /usr/ccs/bin/ld
i386_LINT= $(SPRO_VROOT)/bin/lint
# We compile 64-bit objects with cc by default
amd64_CC= $(SPRO_VROOT)/bin/cc
amd64_CCC= $(SPRO_VROOT)/bin/CC
amd64_CPP= /usr/ccs/lib/cpp
amd64_LD= /usr/ccs/bin/ld
amd64_LINT= $(SPRO_VROOT)/bin/lint
NATIVECC= $($(NATIVE_MACH)_CC)
NATIVECCC= $($(NATIVE_MACH)_CCC)
NATIVECPP= $($(NATIVE_MACH)_CPP)
NATIVELD= $($(NATIVE_MACH)_LD)
NATIVELINT= $($(NATIVE_MACH)_LINT)
#
# Makefile.master.64 overrides these settings
#
CC= $(NATIVECC)
CCC= $(NATIVECCC)
CPP= $(NATIVECPP)
LD= $(NATIVELD)
LINT= $(NATIVELINT)
#
# Optimization CFLAG
#
CFLAG_OPT = -D_REENTRANT
CFLAG_OPT += $(SPACEFLAG) $(C99MODE) $(ILDOFF) $(CCUNBOUND)
CFLAG_OPT_64:sh=if [ "`isainfo -k`" = "sparcv9" ]; then \
echo "-m64 -dalign -D`/usr/bin/uname -p`" ;\
elif [ "`isainfo -k`" = "amd64" ]; then \
echo "-m64" ;\
else \
echo ""; \
fi
CFLAG_OPT_64 += $(CFLAG_OPT)