Print this page
14129 Add NATIVE_CFLAGS64, NATIVE_CCFLAGS64, and rebind NATIVE*64
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/Makefile.master
+++ new/usr/src/Makefile.master
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
|
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
21 21
22 22 #
23 23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 25 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
26 26 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
27 27 # Copyright 2015 Gary Mills
28 28 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
29 29 # Copyright 2016 Toomas Soome <tsoome@me.com>
30 30 # Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
31 -# Copyright 2020 Joyent, Inc.
31 +# Copyright 2021 Joyent, Inc.
32 32 # Copyright 2019 RackTop Systems.
33 33 # Copyright 2020 Oxide Computer Company
34 34 # Copyright 2020 Peter Tribble
35 35 #
36 36
37 37 #
38 38 # Makefile.master, global definitions for system source
39 39 #
40 40 ROOT= /proto
41 41
42 42 #
43 43 # Adjunct root, containing an additional proto area to be used for headers
44 44 # and libraries.
45 45 #
46 46 ADJUNCT_PROTO=
47 47 # HAVE_ADJUNCT_PROTO - ADJUNCT_PROTO is set to a non-default value
48 48 # NO_ADJUNCT_PROTO - ADJUNCT_PROTO is unset
49 49 #
50 50 # This works by replacing any value in ADJUNCT_PROTO with POUND_SIGN, which
51 51 # only happens if it has some value, and then setting HAVE_ADJUNCT_PROTO
52 52 # oppositely.
53 53 NO_ADJUNCT_PROTO=$(ADJUNCT_PROTO:%=$(POUND_SIGN))
54 54 $(NO_ADJUNCT_PROTO)HAVE_ADJUNCT_PROTO=$(POUND_SIGN)
55 55
56 56 #
57 57 # Adjunct for building things that run on the build machine.
58 58 #
59 59 NATIVE_ADJUNCT= /usr
60 60
61 61 #
62 62 # Compatibility code for FreeBSD etc.
63 63 #
64 64 COMPAT= $(SRC)/compat
65 65 CONTRIB= $(SRC)/contrib
66 66
67 67 #
68 68 # RELEASE_BUILD should be cleared for final release builds.
69 69 # NOT_RELEASE_BUILD is exactly what the name implies.
70 70 #
71 71 # __GNUC toggles the building of ON components using gcc and related tools.
72 72 # Normally set to `#', set it to `' to do gcc build.
73 73 #
74 74 # The declaration POUND_SIGN is always '#'. This is needed to get around the
75 75 # make feature that '#' is always a comment delimiter, even when escaped or
76 76 # quoted. We use this macro expansion method to get POUND_SIGN rather than
77 77 # always breaking out a shell because the general case can cause a noticable
78 78 # slowdown in build times when so many Makefiles include Makefile.master.
79 79 #
80 80 # While the majority of users are expected to override the setting below
81 81 # with an env file (via nightly or bldenv), if you aren't building that way
82 82 # (ie, you're using "ws" or some other bootstrapping method) then you need
83 83 # this definition in order to avoid the subshell invocation mentioned above.
84 84 #
85 85
86 86 PRE_POUND= pre\#
87 87 POUND_SIGN= $(PRE_POUND:pre\%=%)
88 88
89 89 NOT_RELEASE_BUILD=
90 90 RELEASE_BUILD= $(POUND_SIGN)
91 91 $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN)
92 92 PATCH_BUILD= $(POUND_SIGN)
93 93
94 94 # SPARC_BLD is '#' for an Intel build.
95 95 # INTEL_BLD is '#' for a Sparc build.
96 96 SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN))
97 97 SPARC_BLD= $(SPARC_BLD_1:sparc=)
98 98 INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN))
99 99 INTEL_BLD= $(INTEL_BLD_1:i386=)
100 100
101 101 # The variables below control the compilers used during the build.
102 102 # There are a number of permutations.
103 103 #
104 104 # __GNUC and __SUNC control (and indicate) the primary compiler. Whichever
105 105 # one is not POUND_SIGN is the primary, with the other as the shadow. They
106 106 # may also be used to control entirely compiler-specific Makefile assignments.
107 107 # __GNUC and GCC are the default.
108 108 #
109 109 # __GNUC64 indicates that the 64bit build should use the GNU C compiler.
110 110 # There is no Sun C analogue.
111 111 #
112 112 # The following version-specific options are operative regardless of which
113 113 # compiler is primary, and control the versions of the given compilers to be
114 114 # used. They also allow compiler-version specific Makefile fragments.
115 115 #
116 116
117 117 __SUNC= $(POUND_SIGN)
118 118 $(__SUNC)__GNUC= $(POUND_SIGN)
119 119 __GNUC64= $(__GNUC)
120 120
121 121 # Allow build-time "configuration" to enable or disable some things.
122 122 # The default is POUND_SIGN, meaning "not enabled". If the environment
123 123 # passes in an override like ENABLE_SMB_PRINTING= (empty) that will
124 124 # uncomment things in the lower Makefiles to enable the feature.
125 125 ENABLE_SMB_PRINTING= $(POUND_SIGN)
126 126
127 127 # BUILD_TOOLS is the root of all tools including compilers.
128 128 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
129 129
130 130 BUILD_TOOLS= /ws/onnv-tools
131 131 ONBLD_TOOLS= $(BUILD_TOOLS)/onbld
132 132
133 133 # define runtime JAVA_HOME, primarily for cmd/pools/poold
134 134 JAVA_HOME= /usr/java
135 135 # define buildtime JAVA_ROOT
136 136 JAVA_ROOT= /usr/java
137 137 # Build uses java8 by default. Pass the variable below set to empty
138 138 # string in the environment to override.
139 139 BLD_JAVA_11= $(POUND_SIGN)
140 140
141 141 GNUC_ROOT= /usr/gcc/7
142 142 GCCLIBDIR= $(GNUC_ROOT)/lib
143 143 GCCLIBDIR64= $(GNUC_ROOT)/lib/$(MACH64)
144 144
145 145 DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
146 146
147 147 RPCGEN= $(ONBLD_TOOLS)/bin/$(MACH)/rpcgen
148 148 STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
149 149 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
150 150 MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch
151 151 BTXLD= $(ONBLD_TOOLS)/bin/$(MACH)/btxld
152 152 VTFONTCVT= $(ONBLD_TOOLS)/bin/$(MACH)/vtfontcvt
153 153 # echo(1) and true(1) are specified without absolute paths, so that the shell
154 154 # spawned by make(1) may use the built-in versions. This is minimally
155 155 # problematic, as the shell spawned by make(1) is known and under control, the
156 156 # only risk being if the shell falls back to $PATH.
157 157 #
158 158 # We specifically want an echo(1) that does interpolation of escape sequences,
159 159 # which ksh93, /bin/sh, and bash will all provide.
160 160 ECHO= echo
161 161 TRUE= true
162 162 INS= $(ONBLD_TOOLS)/bin/$(MACH)/install
163 163 SYMLINK= /usr/bin/ln -s
164 164 LN= /usr/bin/ln
165 165 MKDIR= /usr/bin/mkdir
166 166 CHMOD= /usr/bin/chmod
167 167 MV= /usr/bin/mv -f
168 168 RM= /usr/bin/rm -f
169 169 CUT= /usr/bin/cut
170 170 NM= /usr/ccs/bin/nm
171 171 DIFF= /usr/bin/diff
172 172 GREP= /usr/bin/grep
173 173 EGREP= /usr/bin/egrep
174 174 ELFWRAP= /usr/bin/elfwrap
175 175 KSH93= /usr/bin/ksh93
176 176 SED= /usr/bin/sed
177 177 AWK= /usr/bin/nawk
178 178 CP= /usr/bin/cp -f
179 179 MCS= /usr/ccs/bin/mcs
180 180 CAT= /usr/bin/cat
181 181 ELFDUMP= /usr/ccs/bin/elfdump
182 182 M4= /usr/bin/m4
183 183 GM4= /usr/bin/gm4
184 184 STRIP= /usr/ccs/bin/strip
185 185 LEX= /usr/ccs/bin/lex
186 186 FLEX= /usr/bin/flex
187 187 YACC= /usr/ccs/bin/yacc
188 188 BISON= /usr/bin/bison
189 189 CPP= /usr/lib/cpp
190 190 ANSI_CPP= $(GNUC_ROOT)/bin/cpp
191 191 JAVAC= $(JAVA_ROOT)/bin/javac
192 192 JAVADOC= $(JAVA_ROOT)/bin/javadoc
193 193 JAR= $(JAVA_ROOT)/bin/jar
194 194 CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert
195 195 CTFDIFF= $(ONBLD_TOOLS)/bin/$(MACH)/ctfdiff
196 196 CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge
197 197 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
198 198 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip
199 199 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
200 200 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
201 201 XREF= $(ONBLD_TOOLS)/bin/xref
202 202 FIND= /usr/bin/find
203 203 PERL= /usr/bin/perl
204 204 PERL_VERSION= 5.10.0
205 205 PERL_PKGVERS= -510
206 206 PERL_MACH= i86pc
207 207 $(SPARC_BLD)PERL_MACH= sun4
208 208 PERL_VARIANT=
209 209 PERL_ARCH= $(PERL_MACH)-solaris$(PERL_VARIANT)-64int
210 210 PERL_ARCH64= $(PERL_MACH)-solaris$(PERL_VARIANT)-64
211 211 PYTHON_VERSION= 2.7
212 212 PYTHON_PKGVERS= -27
213 213 PYTHON_SUFFIX=
214 214 PYTHON= /usr/bin/python$(PYTHON_VERSION)
215 215 PYTHON3_VERSION= 3.5
216 216 PYTHON3_PKGVERS= -35
217 217 PYTHON3_SUFFIX= m
218 218 PYTHON3= /usr/bin/python$(PYTHON3_VERSION)
219 219 $(BUILDPY3TOOLS)TOOLS_PYTHON= $(PYTHON3)
220 220 $(BUILDPY2TOOLS)TOOLS_PYTHON= $(PYTHON)
221 221 SORT= /usr/bin/sort
222 222 TR= /usr/bin/tr
223 223 TOUCH= /usr/bin/touch
224 224 WC= /usr/bin/wc
225 225 XARGS= /usr/bin/xargs
226 226 ELFEDIT= /usr/bin/elfedit
227 227 DTRACE= /usr/sbin/dtrace -xnolibs
228 228 UNIQ= /usr/bin/uniq
229 229 TAR= /usr/bin/tar
230 230 ASTBINDIR= /usr/ast/bin
231 231 MSGCC= $(ASTBINDIR)/msgcc
232 232 MSGFMT= /usr/bin/msgfmt -s
233 233 LCDEF= $(ONBLD_TOOLS)/bin/$(MACH)/localedef
234 234 TIC= $(ONBLD_TOOLS)/bin/$(MACH)/tic
235 235 ZIC= $(ONBLD_TOOLS)/bin/$(MACH)/zic
236 236 OPENSSL= /usr/bin/openssl
237 237 CPCGEN= $(ONBLD_TOOLS)/bin/$(MACH)/cpcgen
238 238 GENICONVTBL= $(ONBLD_TOOLS)/bin/$(MACH)/geniconvtbl
239 239
240 240 DEFAULT_CONSOLE_COLOR= \
241 241 -DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_WHITE \
242 242 -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_BLACK
243 243
244 244 FILEMODE= 644
245 245 DIRMODE= 755
246 246
247 247 # Declare that nothing should be built in parallel.
248 248 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
249 249 .NO_PARALLEL:
250 250
251 251 # For stylistic checks
252 252 #
253 253 # Note that the X and C checks are not used at this time and may need
254 254 # modification when they are actually used.
255 255 #
256 256 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
257 257 CSTYLE_TAIL=
258 258 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
259 259 HDRCHK_TAIL=
260 260 JSTYLE= $(ONBLD_TOOLS)/bin/jstyle
261 261
262 262 DOT_H_CHECK= \
263 263 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
264 264 $(HDRCHK) $< $(HDRCHK_TAIL)
265 265
266 266 DOT_X_CHECK= \
267 267 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
268 268 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
269 269
270 270 DOT_C_CHECK= \
271 271 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
272 272
273 273 MANIFEST_CHECK= \
274 274 @$(ECHO) "checking $<"; \
275 275 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
276 276 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
277 277 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
278 278 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
279 279
280 280 INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $<
281 281 INS.dir= $(INS) -s -d -m $(DIRMODE) $@
282 282 # installs and renames at once
283 283 #
284 284 INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@
285 285
286 286 # install a link
287 287 INSLINKTARGET= $<
288 288 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
289 289 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
290 290
291 291 # The path to python that will be used for the shebang line when installing
292 292 # python scripts to the proto area. This is overridden by makefiles to
293 293 # select to the correct version.
294 294 PYSHEBANG= $(PYTHON)
295 295 $(BUILDPY3)PYSHEBANG= $(PYTHON3)
296 296 $(BUILDPY2)PYSHEBANG= $(PYTHON)
297 297
298 298 #
299 299 # Python bakes the mtime of the .py file into the compiled .pyc and
300 300 # rebuilds if the baked-in mtime != the mtime of the source file
301 301 # (rather than only if it's less than), thus when installing python
302 302 # files we must make certain to not adjust the mtime of the source
303 303 # (.py) file.
304 304 #
305 305 INS.pyfile= $(RM) $@; $(SED) \
306 306 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \
307 307 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \
308 308 < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@
309 309
310 310 # MACH must be set in the shell environment per uname -p on the build host
311 311 # More specific architecture variables should be set in lower makefiles.
312 312 #
313 313 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
314 314 # architectures on which we do not build 64-bit versions.
315 315 # (There are no such architectures at the moment.)
316 316 #
317 317 # Set BUILD64=# in the environment to disable 64-bit amd64
318 318 # builds on i386 machines.
319 319
320 320 MACH64_1= $(MACH:sparc=sparcv9)
321 321 MACH64= $(MACH64_1:i386=amd64)
322 322
323 323 MACH32_1= $(MACH:sparc=sparcv7)
324 324 MACH32= $(MACH32_1:i386=i86)
325 325
326 326 sparc_BUILD64=
327 327 i386_BUILD64=
328 328 BUILD64= $($(MACH)_BUILD64)
329 329
330 330 #
331 331 # C compiler mode. Future compilers may change the default on us,
332 332 # so force extended ANSI mode globally. Lower level makefiles can
333 333 # override this by setting CCMODE.
334 334 #
335 335 CCMODE= -Xa
336 336 CCMODE64= -Xa
337 337
338 338 #
339 339 # C compiler verbose mode. This is so we can enable it globally,
340 340 # but turn it off in the lower level makefiles of things we cannot
341 341 # (or aren't going to) fix.
342 342 #
343 343 CCVERBOSE= -v
344 344
345 345 # set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings
346 346 # from the compiler about places the -xarch=v9 may differ from -xarch=v9c.
347 347 V9ABIWARN=
348 348
349 349 # set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register
350 350 # symbols (used to detect conflicts between objects that use global registers)
351 351 # we disable this now for safety, and because genunix doesn't link with
352 352 # this feature (the v9 default) enabled.
353 353 #
354 354 # REGSYM is separate since the C++ driver syntax is different.
355 355 CCREGSYM= -Wc,-Qiselect-regsym=0
356 356 CCCREGSYM= -Qoption cg -Qiselect-regsym=0
357 357
358 358 # Prevent the removal of static symbols by the SPARC code generator (cg).
359 359 # The x86 code generator (ube) does not remove such symbols and as such
360 360 # using this workaround is not applicable for x86.
361 361 #
362 362 CCSTATICSYM= -Wc,-Qassembler-ounrefsym=0
363 363 #
364 364 # generate 32-bit addresses in the v9 kernel. Saves memory.
365 365 CCABS32= -Wc,-xcode=abs32
366 366 #
367 367 # generate v9 code which tolerates callers using the v7 ABI, for the sake of
368 368 # system calls.
369 369 CC32BITCALLERS= -_gcc=-massume-32bit-callers
370 370
371 371 # GCC, especially, is increasingly beginning to auto-inline functions and
372 372 # sadly does so separately not under the general -fno-inline-functions
373 373 # Additionally, we wish to prevent optimisations which cause GCC to clone
374 374 # functions -- in particular, these may cause unhelpful symbols to be
375 375 # emitted instead of function names
376 376 CCNOAUTOINLINE= \
377 377 -_gcc=-fno-inline-small-functions \
378 378 -_gcc=-fno-inline-functions-called-once \
379 379 -_gcc=-fno-ipa-cp \
380 380 -_gcc7=-fno-ipa-icf \
381 381 -_gcc8=-fno-ipa-icf \
382 382 -_gcc9=-fno-ipa-icf \
383 383 -_gcc10=-fno-ipa-icf \
384 384 -_gcc7=-fno-clone-functions \
385 385 -_gcc8=-fno-clone-functions \
386 386 -_gcc9=-fno-clone-functions \
387 387 -_gcc10=-fno-clone-functions
388 388
389 389 # GCC may put functions in different named sub-sections of .text based on
390 390 # their presumed calling frequency. At least in the kernel, where we actually
391 391 # deliver relocatable objects, we don't want this to happen.
392 392 #
393 393 # Since at present we don't benefit from this even in userland, we disable it globally,
394 394 # but the application of this may move into usr/src/uts/ in future.
395 395 CCNOREORDER= \
396 396 -_gcc7=-fno-reorder-functions \
397 397 -_gcc8=-fno-reorder-functions \
398 398 -_gcc9=-fno-reorder-functions \
399 399 -_gcc10=-fno-reorder-functions
400 400
401 401 #
402 402 # gcc has a rather aggressive optimization on by default that infers loop
403 403 # bounds based on undefined behavior (!!). This can lead to some VERY
404 404 # surprising optimizations -- ones that may be technically correct in the
405 405 # strictest sense but also result in incorrect program behavior. We turn
406 406 # this optimization off, with extreme prejudice.
407 407 #
408 408 CCNOAGGRESSIVELOOPS= \
409 409 -_gcc7=-fno-aggressive-loop-optimizations \
410 410 -_gcc8=-fno-aggressive-loop-optimizations \
411 411 -_gcc9=-fno-aggressive-loop-optimizations \
412 412 -_gcc10=-fno-aggressive-loop-optimizations
413 413
414 414 #
415 415 # Options to control which version of stack-protector we enable. This
416 416 # gives us a bit of flexibility and is unfortunately necessary as some
417 417 # modules do not function correctly with our defaults (qede).
418 418 #
419 419 # o STACKPROTECT_ Sets the appropriate version for the compiler
420 420 # o STACKPROTECT_strong Sets us to use strong on all of the
421 421 # compilers it supports. This is the same
422 422 # as the default.
423 423 #
424 424 # o STACKPROTECT_none Disables the stack protector.
425 425 #
426 426 # o STACKPROTECT_all Enables it for everything.
427 427 #
428 428 # o STACKPROTECT_basic Enables the basic stack protector.
429 429 #
430 430 # -fstack-protector-strong is not available in gcc4 which is why we
431 431 # have per-compiler versions below. These are not added to the default
432 432 # global CFLAGS at this time as it's being incrementally enabled
433 433 # throughout the build.
434 434 #
435 435 STACKPROTECT_ = -_gcc4=-fstack-protector
436 436 STACKPROTECT_ += -_gcc7=-fstack-protector-strong
437 437 STACKPROTECT_ += -_gcc8=-fstack-protector-strong
438 438 STACKPROTECT_ += -_gcc9=-fstack-protector-strong
439 439 STACKPROTECT_ += -_gcc10=-fstack-protector-strong
440 440
441 441 STACKPROTECT_strong = $(STACKPROTECT_)
442 442 STACKPROTECT_none =
443 443 STACKPROTECT_all = -_gcc=-fstack-protector-all
444 444 STACKPROTECT_basic = -_gcc=-fstack-protector
445 445
446 446 STACKPROTECT_LD_ = -lssp_ns
447 447 STACKPROTECT_LD_none =
448 448 STACKPROTECT_LD_all = $(STACKPROTECT_LD_)
449 449 STACKPROTECT_LD_basic = $(STACKPROTECT_LD_)
450 450
451 451 CCSTACKPROTECT= $(STACKPROTECT_$(STACKPROTECT))
452 452 LDSTACKPROTECT= $(STACKPROTECT_LD_$(STACKPROTECT))
453 453
454 454 # One optimization the compiler might perform is to turn this:
455 455 # #pragma weak foo
456 456 # extern int foo;
457 457 # if (&foo)
458 458 # foo = 5;
459 459 # into
460 460 # foo = 5;
461 461 # Since we do some of this (foo might be referenced in common kernel code
462 462 # but provided only for some cpu modules or platforms), we disable this
463 463 # optimization.
464 464 #
465 465 sparc_CCUNBOUND = -Wd,-xsafe=unboundsym
466 466 i386_CCUNBOUND =
467 467 CCUNBOUND = $($(MACH)_CCUNBOUND)
468 468
469 469 #
470 470 # compiler '-xarch' flag. This is here to centralize it and make it
471 471 # overridable for testing.
472 472 sparc_XARCH= -m32
473 473 sparcv9_XARCH= -m64
474 474 i386_XARCH= -m32
475 475 amd64_XARCH= -m64 -Ui386 -U__i386
476 476
477 477 # assembler '-xarch' flag. Different from compiler '-xarch' flag.
478 478 sparc_AS_XARCH= -xarch=v8plus
479 479 sparcv9_AS_XARCH= -xarch=v9
480 480 i386_AS_XARCH=
481 481 amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386
482 482
483 483 #
484 484 # These flags define what we need to be 'standalone' i.e. -not- part
485 485 # of the rather more cosy userland environment. This basically means
486 486 # the kernel.
487 487 #
488 488 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
489 489 #
490 490 sparc_STAND_FLAGS= -_gcc=-ffreestanding
491 491 sparcv9_STAND_FLAGS= -_gcc=-ffreestanding
492 492 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
493 493 # additions to SSE (SSE2, AVX ,etc.)
494 494 NO_SIMD= -_gcc=-mno-mmx -_gcc=-mno-sse
495 495 i386_STAND_FLAGS= -_gcc=-ffreestanding $(NO_SIMD)
496 496 amd64_STAND_FLAGS= -xmodel=kernel $(NO_SIMD)
497 497
498 498 SAVEARGS= -Wu,-save_args
499 499 amd64_STAND_FLAGS += $(SAVEARGS)
500 500
501 501 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
502 502 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
503 503
504 504 #
505 505 # disable the incremental linker
506 506 ILDOFF= -xildoff
507 507 #
508 508 XFFLAG= -xF=%all
509 509 XESS= -xs
510 510 XSTRCONST= -xstrconst
511 511
512 512 #
513 513 # turn warnings into errors (C)
514 514 CERRWARN = -errtags=yes -errwarn=%all
515 515 CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
516 516 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
517 517
518 518 CERRWARN += -_gcc=-Wno-missing-braces
519 519 CERRWARN += -_gcc=-Wno-sign-compare
520 520 CERRWARN += -_gcc=-Wno-unknown-pragmas
521 521 CERRWARN += -_gcc=-Wno-unused-parameter
522 522 CERRWARN += -_gcc=-Wno-missing-field-initializers
523 523
524 524 # Unfortunately, this option can misfire very easily and unfixably.
525 525 CERRWARN += -_gcc=-Wno-array-bounds
526 526
527 527 # gcc4 lacks -Wno-maybe-uninitialized
528 528 CNOWARN_UNINIT = -_gcc4=-Wno-uninitialized \
529 529 -_gcc7=-Wno-maybe-uninitialized \
530 530 -_gcc8=-Wno-maybe-uninitialized \
531 531 -_gcc9=-Wno-maybe-uninitialized \
532 532 -_gcc10=-Wno-maybe-uninitialized
533 533
534 534 CERRWARN += -_smatch=-p=illumos_user
535 535 include $(SRC)/Makefile.smatch
536 536
537 537 #
538 538 # turn warnings into errors (C++)
539 539 CCERRWARN = -errtags=yes -errwarn=%all
540 540 CCERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
541 541 CCERRWARN += -erroff=E_STATEMENT_NOT_REACHED
542 542
543 543 CCERRWARN += -_gcc=-Wno-missing-braces
544 544 CCERRWARN += -_gcc=-Wno-sign-compare
545 545 CCERRWARN += -_gcc=-Wno-unknown-pragmas
546 546 CCERRWARN += -_gcc=-Wno-unused-parameter
547 547 CCERRWARN += -_gcc=-Wno-missing-field-initializers
548 548
549 549 # C standard. Keep Studio flags until we get rid of lint.
550 550 CSTD_GNU89= -xc99=%none
551 551 CSTD_GNU99= -xc99=%all
552 552 CSTD= $(CSTD_GNU89)
553 553 C99LMODE= $(CSTD:-xc99%=-Xc99%)
554 554
555 555 # In most places, assignments to these macros should be appended with +=
556 556 # (CPPFLAGS.first allows values to be prepended to CPPFLAGS).
557 557 sparc_CFLAGS= $(sparc_XARCH) $(CCSTATICSYM)
558 558 sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
559 559 $(CCSTATICSYM)
560 560 i386_CFLAGS= $(i386_XARCH)
561 561 amd64_CFLAGS= $(amd64_XARCH)
562 562
563 563 sparc_ASFLAGS= $(sparc_AS_XARCH)
564 564 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
565 565 i386_ASFLAGS= $(i386_AS_XARCH)
566 566 amd64_ASFLAGS= $(amd64_AS_XARCH)
567 567
568 568 #
569 569 sparc_COPTFLAG= -xO3
570 570 sparcv9_COPTFLAG= -xO3
571 571 i386_COPTFLAG= -O
572 572 amd64_COPTFLAG= -xO3
573 573
574 574 COPTFLAG= $($(MACH)_COPTFLAG)
575 575 COPTFLAG64= $($(MACH64)_COPTFLAG)
576 576
577 577 # When -g is used, the compiler globalizes static objects
578 578 # (gives them a unique prefix). Disable that.
579 579 CNOGLOBAL= -W0,-noglobal
580 580
581 581 # Direct the Sun Studio compiler to use a static globalization prefix based on the
582 582 # name of the module rather than something unique. Otherwise, objects
583 583 # will not build deterministically, as subsequent compilations of identical
584 584 # source will yeild objects that always look different.
585 585 #
586 586 # In the same spirit, this will also remove the date from the N_OPT stab.
587 587 CGLOBALSTATIC= -W0,-xglobalstatic
588 588
589 589 # Sometimes we want all symbols and types in debugging information even
590 590 # if they aren't used.
591 591 CALLSYMS= -W0,-xdbggen=no%usedonly
592 592
593 593 #
594 594 # We force the compilers to generate the debugging information best understood
595 595 # by the CTF tools. With Sun Studio this is stabs due to bugs in the Studio
596 596 # compilers. With GCC this is DWARF v2.
597 597 #
598 598 DEBUGFORMAT= -_cc=-xdebugformat=stabs -_gcc=-gdwarf-2 -_gcc10=-gstrict-dwarf
599 599
600 600 #
601 601 # Ask the compiler to include debugging information
602 602 #
603 603 CCGDEBUG= -g $(DEBUGFORMAT)
604 604
605 605 #
606 606 # Flags used to build in debug mode for ctf generation.
607 607 #
608 608 CTF_FLAGS_sparc = $(CCGDEBUG) -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL)
609 609 CTF_FLAGS_i386 = $(CCGDEBUG) $(CSTD) $(CNOGLOBAL)
610 610
611 611 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
612 612 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
613 613
614 614 # Sun Studio produces broken userland code when saving arguments.
615 615 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
616 616
617 617 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH))
618 618 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64))
619 619 CTF_FLAGS = $(CTF_FLAGS_32)
620 620
621 621 #
622 622 # Flags used with genoffsets
623 623 #
624 624 GENOFFSETS_FLAGS = $(CALLSYMS)
625 625
626 626 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
627 627 $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \
628 628 $(CFLAGS) $(CPPFLAGS)
629 629
630 630 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
631 631 $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \
632 632 $(CFLAGS64) $(CPPFLAGS)
633 633
634 634 #
635 635 # tradeoff time for space (smaller is better)
636 636 #
637 637 sparc_SPACEFLAG = -xspace -W0,-Lt
638 638 sparcv9_SPACEFLAG = -xspace -W0,-Lt
639 639 i386_SPACEFLAG = -xspace
640 640 amd64_SPACEFLAG =
641 641
642 642 SPACEFLAG = $($(MACH)_SPACEFLAG)
643 643 SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
644 644
645 645 #
646 646 # The Sun Studio 11 compiler has changed the behaviour of integer
647 647 # wrap arounds and so a flag is needed to use the legacy behaviour
648 648 # (without this flag panics/hangs could be exposed within the source).
649 649 #
650 650 sparc_IROPTFLAG = -W2,-xwrap_int
651 651 sparcv9_IROPTFLAG = -W2,-xwrap_int
652 652 i386_IROPTFLAG =
653 653 amd64_IROPTFLAG =
654 654
655 655 IROPTFLAG = $($(MACH)_IROPTFLAG)
656 656 IROPTFLAG64 = $($(MACH64)_IROPTFLAG)
657 657
658 658 sparc_XREGSFLAG = -xregs=no%appl
659 659 sparcv9_XREGSFLAG = -xregs=no%appl
660 660 i386_XREGSFLAG =
661 661 amd64_XREGSFLAG =
662 662
663 663 XREGSFLAG = $($(MACH)_XREGSFLAG)
664 664 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
665 665
666 666 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and
667 667 # avoids stripping it.
668 668 SOURCEDEBUG = $(POUND_SIGN)
669 669 SRCDBGBLD = $(SOURCEDEBUG:yes=)
670 670
671 671 #
672 672 # These variables are intended ONLY for use by developers to safely pass extra
673 673 # flags to the compilers without unintentionally overriding Makefile-set
674 674 # flags. They should NEVER be set to any value in a Makefile.
675 675 #
676 676 # They come last in the associated FLAGS variable such that they can
677 677 # explicitly override things if necessary, there are gaps in this, but it's
678 678 # the best we can manage.
679 679 #
680 680 CUSERFLAGS =
681 681 CUSERFLAGS64 = $(CUSERFLAGS)
682 682 CCUSERFLAGS =
683 683 CCUSERFLAGS64 = $(CCUSERFLAGS)
684 684
685 685 CSOURCEDEBUGFLAGS =
686 686 CCSOURCEDEBUGFLAGS =
687 687 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = $(CCGDEBUG) -xs
688 688 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = $(CCGDEBUG) -xs
689 689
690 690 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
691 691 $(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG) \
692 692 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CCNOREORDER) \
693 693 $(CCNOAGGRESSIVELOOPS) \
694 694 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
695 695 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
696 696 $(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG64) \
697 697 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CCNOREORDER) \
698 698 $(CCNOAGGRESSIVELOOPS) \
699 699 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS64)
700 700 #
701 701 # Flags that are used to build parts of the code that are subsequently
|
↓ open down ↓ |
660 lines elided |
↑ open up ↑ |
702 702 # run on the build machine (also known as the NATIVE_BUILD).
703 703 #
704 704 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
705 705 $(ILDOFF) $(CERRWARN) $(CSTD) $($(NATIVE_MACH)_CCUNBOUND) \
706 706 $(IROPTFLAG) $(CGLOBALSTATIC) $(CCNOAUTOINLINE) \
707 707 $(CCNOREORDER) $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
708 708
709 709 NATIVE_CCFLAGS= $(CCOPTFLAG) $($(NATIVE_MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
710 710 $(CCUSERFLAGS)
711 711
712 +NATIVE_CFLAGS64= $(COPTFLAG64) $($(NATIVE_MACH64)_CFLAGS) $(CCMODE64) \
713 + $(ILDOFF) $(CERRWARN) $(CSTD) $($(NATIVE_MACH64)_CCUNBOUND) \
714 + $(IROPTFLAG64) $(CGLOBALSTATIC) $(CCNOAUTOINLINE) \
715 + $(CCNOREORDER) $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS64)
716 +
717 +NATIVE_CCFLAGS64= $(CCOPTFLAG64) $($(NATIVE_MACH64)_CCFLAGS) \
718 + $(CCSOURCEDEBUGFLAGS) $(CCUSERFLAGS64)
719 +
712 720 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
713 721 DTS_ERRNO=-D_TS_ERRNO
714 722 CPPFLAGS.first= # Please keep empty. Only lower makefiles should set this.
715 723 CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \
716 724 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \
717 725 $(ADJUNCT_PROTO:%=-I%/usr/include)
718 726 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \
719 727 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include
720 728 CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
721 729 AS_CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
722 730 JAVAFLAGS= -source 7 -target 7 -Xlint:deprecation,-options
723 731 $(BLD_JAVA_11)JAVAFLAGS= -source 7 -target 7 -Xlint:-options
724 732
725 733 #
726 734 # For source message catalogue
727 735 #
728 736 .SUFFIXES: $(SUFFIXES) .i .po
729 737 MSGROOT= $(ROOT)/catalog
730 738 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
731 739 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
732 740 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
733 741 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
734 742
735 743 CLOBBERFILES += $(POFILE) $(POFILES)
736 744 COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS)
737 745 XGETTEXT= /usr/bin/xgettext
738 746 XGETFLAGS= -c TRANSLATION_NOTE
739 747 GNUXGETTEXT= /usr/gnu/bin/xgettext
740 748 GNUXGETFLAGS= --add-comments=TRANSLATION_NOTE --keyword=_ \
741 749 --strict --no-location --omit-header
742 750 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
743 751 $(RM) $@ ;\
744 752 $(SED) "/^domain/d" < $(<F).po > $@ ;\
745 753 $(RM) $(<F).po $<.i
746 754
747 755 #
748 756 # This is overwritten by local Makefile when PROG is a list.
749 757 #
750 758 POFILE= $(PROG).po
751 759
752 760 sparc_CCFLAGS= $(sparc_XARCH) -cg92 -compat=4 \
753 761 -Qoption ccfe -messages=no%anachronism \
754 762 $(CCERRWARN)
755 763 sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \
756 764 -Qoption ccfe -messages=no%anachronism \
757 765 -Qoption ccfe -features=no%conststrings \
758 766 $(CCCREGSYM) \
759 767 $(CCERRWARN)
760 768 i386_CCFLAGS= $(i386_XARCH) -compat=4 \
761 769 -Qoption ccfe -messages=no%anachronism \
762 770 -Qoption ccfe -features=no%conststrings \
763 771 $(CCERRWARN)
764 772 amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \
765 773 -Qoption ccfe -messages=no%anachronism \
766 774 -Qoption ccfe -features=no%conststrings \
767 775 $(CCERRWARN)
768 776
769 777 sparc_CCOPTFLAG= -O
770 778 sparcv9_CCOPTFLAG= -O
771 779 i386_CCOPTFLAG= -O
772 780 amd64_CCOPTFLAG= -O
773 781
774 782 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
775 783 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
776 784 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
777 785 $(CCUSERFLAGS)
778 786 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
779 787 $(CCUSERFLAGS64)
780 788
781 789 #
782 790 #
783 791 #
784 792 ELFWRAP_FLAGS =
785 793 ELFWRAP_FLAGS64 = -64
786 794
787 795 #
788 796 # Various mapfiles that are used throughout the build, and delivered to
789 797 # /usr/lib/ld.
790 798 #
791 799 MAPFILE.NED_i386 = $(SRC)/common/mapfiles/common/map.noexdata
792 800 MAPFILE.NED_sparc =
793 801 MAPFILE.NED = $(MAPFILE.NED_$(MACH))
794 802 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
795 803 MAPFILE.NES = $(SRC)/common/mapfiles/common/map.noexstk
796 804 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
797 805 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
798 806
799 807 #
800 808 # Generated mapfiles that are compiler specific, and used throughout the
801 809 # build. These mapfiles are not delivered in /usr/lib/ld.
802 810 #
803 811 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_cc_map.noexeglobs
804 812 $(__GNUC64)MAPFILE.NGB_sparc= \
805 813 $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
806 814 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_cc_map.noexeglobs
807 815 $(__GNUC64)MAPFILE.NGB_sparcv9= \
808 816 $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
809 817 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_cc_map.noexeglobs
810 818 $(__GNUC64)MAPFILE.NGB_i386= \
811 819 $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
812 820 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_cc_map.noexeglobs
813 821 $(__GNUC64)MAPFILE.NGB_amd64= \
814 822 $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
815 823 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
816 824
817 825 #
818 826 # A generic interface mapfile name, used by various dynamic objects to define
819 827 # the interfaces and interposers the object must export.
820 828 #
821 829 MAPFILE.INT = mapfile-intf
822 830
823 831 #
824 832 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
825 833 # assignments.
826 834 #
827 835 # These environment settings make sure that no libraries are searched outside
828 836 # of the local workspace proto area:
829 837 # LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
830 838 # LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
831 839 #
832 840 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
833 841 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
834 842 LDLIBS.cmd = $(LDLIBS32)
835 843 LDLIBS.lib = $(LDLIBS32)
836 844
837 845 LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \
838 846 $(ENVLDLIBS2:%=%/$(MACH64)) \
839 847 $(ENVLDLIBS3:%=%/$(MACH64))
840 848 LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
841 849
842 850 #
843 851 # Define compilation macros.
844 852 #
845 853 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
846 854 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
847 855 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
848 856 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
849 857 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
850 858 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
851 859 COMPILE.d= $(DTRACE) -G -32
852 860 COMPILE64.d= $(DTRACE) -G -64
853 861 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
854 862 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
855 863
856 864 CLASSPATH= .
857 865 COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH)
858 866
859 867 #
860 868 # Link time macros
861 869 #
862 870 CCNEEDED = -lC
863 871 CCEXTNEEDED = -lCrun -lCstd
864 872 NATIVECCNEEDED = -lC
865 873 $(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
866 874 $(__GNUC)CCEXTNEEDED = $(CCNEEDED)
867 875 $(__GNUC)NATIVECCNEEDED = -R$(GCCLIBDIR) -L$(GCCLIBDIR) -lstdc++ -lgcc_s
868 876
869 877 CCNEEDED64 = -lCrun
870 878 CCEXTNEEDED64 = -lCrun -lCstd
871 879 NATIVECCNEEDED64 = -lCrun
872 880 $(__GNUC64)CCNEEDED64 = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
873 881 $(__GNUC64)NATIVECCNEEDED64 = -R$(GCCLIBDIR) -L$(GCCLIBDIR) -lstdc++ -lgcc_s
874 882 $(__GNUC64)CCEXTNEEDED = $(CCNEEDED64)
875 883
876 884 # Libraries we expect to use natively on the build machine
877 885 NATIVE_LIBS=
878 886
879 887 LDCHECKS = $(ZASSERTDEFLIB) $(ZGUIDANCE) $(ZFATALWARNINGS)
880 888 LDCHECKS += $(NATIVE_LIBS:%=$(ZASSERTDEFLIB)=%)
881 889
882 890 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDCHECKS)
883 891 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS) $(LDCHECKS)
884 892 NORUNPATH= -norunpath -nolib
885 893 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
886 894 $(LDFLAGS) $(CCNEEDED) $(LDCHECKS)
887 895 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
888 896 $(LDFLAGS) $(CCNEEDED64) $(LDCHECKS)
889 897
890 898 #
891 899 # lint macros
892 900 #
893 901 # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once
894 902 # ON is built with a version of lint that has the fix for 4484186.
895 903 #
896 904 ALWAYS_LINT_DEFS = -errtags=yes -s
897 905 ALWAYS_LINT_DEFS += -erroff=E_PTRDIFF_OVERFLOW
898 906 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_NARROW_CONV
899 907 ALWAYS_LINT_DEFS += -U__PRAGMA_REDEFINE_EXTNAME
900 908 ALWAYS_LINT_DEFS += $(C99LMODE)
901 909 ALWAYS_LINT_DEFS += -errsecurity=$(SECLEVEL)
902 910 ALWAYS_LINT_DEFS += -erroff=E_SEC_CREAT_WITHOUT_EXCL
903 911 ALWAYS_LINT_DEFS += -erroff=E_SEC_FORBIDDEN_WARN_CREAT
904 912 # XX64 -- really only needed for amd64 lint
905 913 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_INT_TO_SMALL_INT
906 914 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
907 915 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_TO_SMALL_INT
908 916 ALWAYS_LINT_DEFS += -erroff=E_CAST_TO_PTR_FROM_INT
909 917 ALWAYS_LINT_DEFS += -erroff=E_COMP_INT_WITH_LARGE_INT
910 918 ALWAYS_LINT_DEFS += -erroff=E_INTEGRAL_CONST_EXP_EXPECTED
911 919 ALWAYS_LINT_DEFS += -erroff=E_PASS_INT_TO_SMALL_INT
912 920 ALWAYS_LINT_DEFS += -erroff=E_PTR_CONV_LOSES_BITS
913 921
914 922 # This forces lint to pick up note.h and sys/note.h from Devpro rather than
915 923 # from the proto area. The note.h that ON delivers would disable NOTE().
916 924 ONLY_LINT_DEFS = -I$(SPRO_VROOT)/prod/include/lint
917 925
918 926 SECLEVEL= core
919 927 LINT.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS) $(CPPFLAGS) \
920 928 $(ALWAYS_LINT_DEFS)
921 929 LINT64.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS64) $(CPPFLAGS) \
922 930 $(ALWAYS_LINT_DEFS)
923 931 LINT.s= $(LINT.c)
924 932
925 933 # For some future builds, NATIVE_MACH and MACH might be different.
926 934 # Therefore, NATIVE_MACH needs to be redefined in the
927 935 # environment as `uname -p` to override this macro.
928 936 #
929 937 # For now at least, we cross-compile amd64 on i386 machines.
930 938 NATIVE_MACH= $(MACH:amd64=i386)
931 939 NATIVE_MACH64= $(MACH64)
932 940
933 941 # Define native compilation macros
934 942 #
935 943
936 944 # Base directory where compilers are loaded.
937 945 # Defined here so it can be overridden by developer.
938 946 #
939 947 SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro
940 948 SPRO_VROOT= $(SPRO_ROOT)/SS12
941 949 GNU_ROOT= /usr
942 950
943 951 $(__GNUC)PRIMARY_CC= gcc7,$(GNUC_ROOT)/bin/gcc,gnu
944 952 $(__SUNC)PRIMARY_CC= studio12,$(SPRO_VROOT)/bin/cc,sun
945 953 $(__GNUC)PRIMARY_CCC= gcc7,$(GNUC_ROOT)/bin/g++,gnu
946 954 $(__SUNC)PRIMARY_CCC= studio12,$(SPRO_VROOT)/bin/CC,sun
947 955
948 956 CW_CC_COMPILERS= $(PRIMARY_CC:%=--primary %) $(SHADOW_CCS:%=--shadow %)
949 957 CW_CCC_COMPILERS= $(PRIMARY_CCC:%=--primary %) $(SHADOW_CCCS:%=--shadow %)
950 958
951 959 CW_LINKER= --linker $(LD)
952 960
953 961 # Till SS12u1 formally becomes the NV CBE, LINT is hard
954 962 # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/
955 963 # location. Impacted variables are sparc_LINT, sparcv9_LINT,
956 964 # i386_LINT, amd64_LINT.
957 965 # Reset them when SS12u1 is rolled out.
958 966 #
959 967
960 968 # Specify platform compiler versions for languages
961 969 # that we use (currently only c and c++).
962 970 #
963 971 CW= $(ONBLD_TOOLS)/bin/$(MACH)/cw
964 972
965 973 BUILD_CC= $(CW) $(CW_LINKER) $(CW_CC_COMPILERS) --
966 974 BUILD_CCC= $(CW) -C $(CW_LINKER) $(CW_CCC_COMPILERS) --
967 975 BUILD_CPP= /usr/ccs/lib/cpp
968 976 BUILD_LD= $(ONBLD_TOOLS)/bin/$(MACH)/ld
969 977 BUILD_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
970 978
971 979 $(MACH)_CC= $(BUILD_CC)
972 980 $(MACH)_CCC= $(BUILD_CCC)
973 981 $(MACH)_CPP= $(BUILD_CPP)
974 982 $(MACH)_LD= $(BUILD_LD)
975 983 $(MACH)_LINT= $(BUILD_LINT)
976 984 $(MACH64)_CC= $(BUILD_CC)
977 985 $(MACH64)_CCC= $(BUILD_CCC)
978 986 $(MACH64)_CPP= $(BUILD_CPP)
979 987 $(MACH64)_LD= $(BUILD_LD)
980 988 $(MACH64)_LINT= $(BUILD_LINT)
981 989
982 990 sparc_AS= /usr/ccs/bin/as -xregsym=no
983 991 sparcv9_AS= $($(MACH)_AS)
984 992
985 993 i386_AS= /usr/ccs/bin/as
986 994 $(__GNUC)i386_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
987 995 amd64_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
988 996
989 997 NATIVECC= $($(NATIVE_MACH)_CC)
990 998 NATIVECCC= $($(NATIVE_MACH)_CCC)
991 999 NATIVECPP= $($(NATIVE_MACH)_CPP)
992 1000 NATIVEAS= $($(NATIVE_MACH)_AS)
993 1001 NATIVELD= $($(NATIVE_MACH)_LD)
994 1002 NATIVELINT= $($(NATIVE_MACH)_LINT)
995 1003
996 1004 NATIVECC64= $($(NATIVE_MACH64)_CC)
997 1005 NATIVECCC64= $($(NATIVE_MACH64)_CCC)
998 1006 NATIVECPP64= $($(NATIVE_MACH64)_CPP)
999 1007 NATIVEAS64= $($(NATIVE_MACH64)_AS)
1000 1008 NATIVELD64= $($(NATIVE_MACH64)_LD)
1001 1009 NATIVELINT64= $($(NATIVE_MACH64)_LINT)
1002 1010
1003 1011 #
1004 1012 # Makefile.master.64 overrides these settings
1005 1013 #
1006 1014 CC= $(NATIVECC)
1007 1015 CCC= $(NATIVECCC)
1008 1016 CPP= $(NATIVECPP)
1009 1017 AS= $(NATIVEAS)
1010 1018 LD= $(NATIVELD)
1011 1019 LINT= $(NATIVELINT)
1012 1020
1013 1021 CC64= $(NATIVECC64)
1014 1022 CCC64= $(NATIVECCC64)
1015 1023 CPP64= $(NATIVECPP64)
1016 1024 AS64= $(NATIVEAS64)
1017 1025 LD64= $(NATIVELD64)
1018 1026 LINT64= $(NATIVELINT64)
1019 1027
1020 1028 # Pass -Y flag to cpp (method of which is release-dependent)
1021 1029 CCYFLAG= -Y I,
1022 1030
1023 1031 BDIRECT= -Wl,-Bdirect
1024 1032 BDYNAMIC= -Wl,-Bdynamic
1025 1033 BLOCAL= -Wl,-Blocal
1026 1034 BNODIRECT= -Wl,-Bnodirect
1027 1035 BREDUCE= -Wl,-Breduce
1028 1036 BSTATIC= -Wl,-Bstatic
1029 1037 BSYMBOLIC= -Wl,-Bsymbolic
1030 1038
1031 1039 ZDEFS= -Wl,-zdefs
1032 1040 ZDIRECT= -Wl,-zdirect
1033 1041 ZIGNORE= -Wl,-zignore
1034 1042 ZINITFIRST= -Wl,-zinitfirst
1035 1043 ZINTERPOSE= -Wl,-zinterpose
1036 1044 ZLAZYLOAD= -Wl,-zlazyload
1037 1045 ZLOADFLTR= -Wl,-zloadfltr
1038 1046 ZMULDEFS= -Wl,-zmuldefs
1039 1047 ZNODEFAULTLIB= -Wl,-znodefaultlib
1040 1048 ZNODEFS= -Wl,-znodefs
1041 1049 ZNODELETE= -Wl,-znodelete
1042 1050 ZNODLOPEN= -Wl,-znodlopen
1043 1051 ZNODUMP= -Wl,-znodump
1044 1052 ZNOLAZYLOAD= -Wl,-znolazyload
1045 1053 ZNOLDYNSYM= -Wl,-znoldynsym
1046 1054 ZNORELOC= -Wl,-znoreloc
1047 1055 ZNOVERSION= -Wl,-znoversion
1048 1056 ZRECORD= -Wl,-zrecord
1049 1057 ZREDLOCSYM= -Wl,-zredlocsym
1050 1058 ZTEXT= -Wl,-ztext
1051 1059 ZVERBOSE= -Wl,-zverbose
1052 1060 ZASSERTDEFLIB= -Wl,-zassert-deflib
1053 1061 ZGUIDANCE= -Wl,-zguidance
1054 1062 ZFATALWARNINGS= -Wl,-zfatal-warnings
1055 1063 ZASLR= -Wl,-zaslr
1056 1064
1057 1065 GSHARED= -shared
1058 1066 CCMT= -mt
1059 1067
1060 1068 # Handle different PIC models on different ISAs
1061 1069 # (May be overridden by lower-level Makefiles)
1062 1070
1063 1071 sparc_C_PICFLAGS = -fpic
1064 1072 sparcv9_C_PICFLAGS = -fpic
1065 1073 i386_C_PICFLAGS = -fpic
1066 1074 amd64_C_PICFLAGS = -fpic
1067 1075 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
1068 1076 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
1069 1077
1070 1078 sparc_C_BIGPICFLAGS = -fPIC
1071 1079 sparcv9_C_BIGPICFLAGS = -fPIC
1072 1080 i386_C_BIGPICFLAGS = -fPIC
1073 1081 amd64_C_BIGPICFLAGS = -fPIC
1074 1082 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
1075 1083 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
1076 1084
1077 1085 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
1078 1086 # and does not support -f
1079 1087 sparc_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
1080 1088 sparcv9_CC_PICFLAGS = -_cc=-KPIC -_gcc=-fPIC
1081 1089 i386_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
1082 1090 amd64_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
1083 1091 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
1084 1092 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
1085 1093
1086 1094 AS_PICFLAGS= -K pic
1087 1095 AS_BIGPICFLAGS= -K PIC
1088 1096
1089 1097 #
1090 1098 # Default label for CTF sections
1091 1099 #
1092 1100 CTFCVTFLAGS= -L VERSION
1093 1101
1094 1102 #
1095 1103 # Override to pass module-specific flags to ctfmerge. Currently used only by
1096 1104 # krtld to turn on fuzzy matching, and source-level debugging to inhibit
1097 1105 # stripping.
1098 1106 #
1099 1107 CTFMRGFLAGS=
1100 1108
1101 1109 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
1102 1110
1103 1111 # Rules (normally from make.rules) and macros which are used for post
1104 1112 # processing files. Normally, these do stripping of the comment section
1105 1113 # automatically.
1106 1114 # RELEASE_CM: Should be edited to reflect the release.
1107 1115 # POST_PROCESS_O: Post-processing for `.o' files (typically C source)
1108 1116 # POST_PROCESS_S_O: Post-processing for `.o' files built from asssembly
1109 1117 # POST_PROCESS_CC_O: Post-processing for `.o' files built from C++
1110 1118 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
1111 1119 # POST_PROCESS_SO: Post-processing for `.so' files.
1112 1120 # POST_PROCESS: Post-processing for executable files (no suffix).
1113 1121 #
1114 1122 # Note that these macros are not completely generalized as they are to be
1115 1123 # used with the file name to be processed following.
1116 1124 #
1117 1125 # It is left as an exercise to Release Engineering to embellish the generation
1118 1126 # of the release comment string.
1119 1127 #
1120 1128 # If this is a standard development build:
1121 1129 # compress the comment section (mcs -c)
1122 1130 # add the standard comment (mcs -a $(RELEASE_CM))
1123 1131 # add the development specific comment (mcs -a $(DEV_CM))
1124 1132 #
1125 1133 # If this is an installation build:
1126 1134 # delete the comment section (mcs -d)
1127 1135 # add the standard comment (mcs -a $(RELEASE_CM))
1128 1136 # add the development specific comment (mcs -a $(DEV_CM))
1129 1137 #
1130 1138 # If this is an release build:
1131 1139 # delete the comment section (mcs -d)
1132 1140 # add the standard comment (mcs -a $(RELEASE_CM))
1133 1141 #
1134 1142 # The following list of macros are used in the definition of RELEASE_CM
1135 1143 # which is used to label all binaries in the build:
1136 1144 #
1137 1145 # RELEASE Specific release of the build, eg: 5.2
1138 1146 # RELEASE_MAJOR Major version number part of $(RELEASE)
1139 1147 # RELEASE_MINOR Minor version number part of $(RELEASE)
1140 1148 # VERSION Version of the build (alpha, beta, Generic)
1141 1149 # PATCHID If this is a patch this value should contain
1142 1150 # the patchid value (eg: "Generic 100832-01"), otherwise
1143 1151 # it will be set to $(VERSION)
1144 1152 # RELEASE_DATE Date of the Release Build
1145 1153 # PATCH_DATE Date the patch was created, if this is blank it
1146 1154 # will default to the RELEASE_DATE
1147 1155 #
1148 1156 RELEASE_MAJOR= 5
1149 1157 RELEASE_MINOR= 11
1150 1158 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
1151 1159 VERSION= SunOS Development
1152 1160 PATCHID= $(VERSION)
1153 1161 RELEASE_DATE= release date not set
1154 1162 PATCH_DATE= $(RELEASE_DATE)
1155 1163 RELEASE_CM= "@($(POUND_SIGN))illumos $(PATCHID) $(PATCH_DATE)"
1156 1164 DEV_CM_TAIL= development build: $(LOGNAME)
1157 1165 DEV_CM= "@($(POUND_SIGN))illumos $(DEV_CM_TAIL)"
1158 1166 UTS_LABEL= $(RELEASE)
1159 1167
1160 1168 #
1161 1169 # The boot banner may be overridden by distributions. Up to five lines can be
1162 1170 # specified by overriding the BOOTBANNER macros, and any line that expands to
1163 1171 # an empty string will not be printed. See comments in
1164 1172 # bootbanner_expand_template() for more details about the template string
1165 1173 # format.
1166 1174 #
1167 1175 BOOTBANNER1= ^o Version ^v ^w-bit
1168 1176 BOOTBANNER2=
1169 1177 BOOTBANNER3=
1170 1178 BOOTBANNER4=
1171 1179 BOOTBANNER5=
1172 1180
1173 1181 PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
1174 1182 $(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
1175 1183
1176 1184 STRIP_STABS= $(STRIP) -x $@
1177 1185 $(SRCDBGBLD)STRIP_STABS= :
1178 1186
1179 1187 POST_PROCESS_O=
1180 1188 POST_PROCESS_S_O=
1181 1189 POST_PROCESS_CC_O=
1182 1190 POST_PROCESS_A=
1183 1191 POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
1184 1192 $(ELFSIGN_OBJECT)
1185 1193 POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
1186 1194 $(ELFSIGN_OBJECT)
1187 1195
1188 1196 #
1189 1197 # chk4ubin is a tool that inspects a module for a symbol table
1190 1198 # ELF section size which can trigger an OBP bug on older platforms.
1191 1199 # This problem affects only specific sun4u bootable modules.
1192 1200 #
1193 1201 CHK4UBIN= $(ONBLD_TOOLS)/bin/$(MACH)/chk4ubin
1194 1202 CHK4UBINFLAGS=
1195 1203 CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@
1196 1204
1197 1205 #
1198 1206 # PKGARCHIVE specifies the default location where packages should be
1199 1207 # placed if built.
1200 1208 #
1201 1209 $(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd
1202 1210 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
1203 1211
1204 1212 #
1205 1213 # The repositories will be created with these publisher settings. To
1206 1214 # update an image to the resulting repositories, this must match the
1207 1215 # publisher name provided to "pkg set-publisher."
1208 1216 #
1209 1217 PKGPUBLISHER_REDIST= on-nightly
1210 1218 PKGPUBLISHER_NONREDIST= on-extra
1211 1219
1212 1220 # Default build rules which perform comment section post-processing.
1213 1221 #
1214 1222 .c:
1215 1223 $(LINK.c) -o $@ $< $(LDLIBS)
1216 1224 $(POST_PROCESS)
1217 1225 .c.o:
1218 1226 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
1219 1227 $(POST_PROCESS_O)
1220 1228 .c.a:
1221 1229 $(COMPILE.c) -o $% $<
1222 1230 $(PROCESS_COMMENT) $%
1223 1231 $(AR) $(ARFLAGS) $@ $%
1224 1232 $(RM) $%
1225 1233 .s.o:
1226 1234 $(COMPILE.s) -o $@ $<
1227 1235 $(POST_PROCESS_S_O)
1228 1236 .s.a:
1229 1237 $(COMPILE.s) -o $% $<
1230 1238 $(PROCESS_COMMENT) $%
1231 1239 $(AR) $(ARFLAGS) $@ $%
1232 1240 $(RM) $%
1233 1241 .cc:
1234 1242 $(LINK.cc) -o $@ $< $(LDLIBS)
1235 1243 $(POST_PROCESS)
1236 1244 .cc.o:
1237 1245 $(COMPILE.cc) $(OUTPUT_OPTION) $<
1238 1246 $(POST_PROCESS_CC_O)
1239 1247 .cc.a:
1240 1248 $(COMPILE.cc) -o $% $<
1241 1249 $(AR) $(ARFLAGS) $@ $%
1242 1250 $(PROCESS_COMMENT) $%
1243 1251 $(RM) $%
1244 1252 .y:
1245 1253 $(YACC.y) $<
1246 1254 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
1247 1255 $(POST_PROCESS)
1248 1256 $(RM) y.tab.c
1249 1257 .y.o:
1250 1258 $(YACC.y) $<
1251 1259 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
1252 1260 $(POST_PROCESS_O)
1253 1261 $(RM) y.tab.c
1254 1262 .l:
1255 1263 $(RM) $*.c
1256 1264 $(LEX.l) $< > $*.c
1257 1265 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
1258 1266 $(POST_PROCESS)
1259 1267 $(RM) $*.c
1260 1268 .l.o:
1261 1269 $(RM) $*.c
1262 1270 $(LEX.l) $< > $*.c
1263 1271 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
1264 1272 $(POST_PROCESS_O)
1265 1273 $(RM) $*.c
1266 1274
1267 1275 .bin.o:
1268 1276 $(COMPILE.b) -o $@ $<
1269 1277 $(POST_PROCESS_O)
1270 1278
1271 1279 .java.class:
1272 1280 $(COMPILE.java) $<
1273 1281
1274 1282 # Bourne and Korn shell script message catalog build rules.
1275 1283 # We extract all gettext strings with sed(1) (being careful to permit
1276 1284 # multiple gettext strings on the same line), weed out the dups, and
1277 1285 # build the catalogue with awk(1).
1278 1286
1279 1287 .sh.po .ksh.po:
1280 1288 $(SED) -n -e ":a" \
1281 1289 -e "h" \
1282 1290 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
1283 1291 -e "x" \
1284 1292 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
1285 1293 -e "t a" \
1286 1294 $< | sort -u | $(AWK) '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
1287 1295
1288 1296 #
1289 1297 # Python and Perl executable and message catalog build rules.
1290 1298 #
1291 1299 .SUFFIXES: .pl .pm .py .pyc
1292 1300
1293 1301 .pl:
1294 1302 $(RM) $@;
1295 1303 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
1296 1304 $(CHMOD) +x $@
1297 1305
1298 1306 .py:
1299 1307 $(RM) $@; $(SED) \
1300 1308 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \
1301 1309 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \
1302 1310 < $< > $@; $(CHMOD) +x $@
1303 1311
1304 1312 .py.pyc:
1305 1313 $(RM) $@
1306 1314 $(PYTHON) -mpy_compile $<
1307 1315 @[ $(<)c = $@ ] || $(MV) $(<)c $@
1308 1316
1309 1317 .py.po:
1310 1318 $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $(<F:%.py=%) $< ;
1311 1319
1312 1320 .pl.po .pm.po:
1313 1321 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
1314 1322 $(RM) $@ ;
1315 1323 $(SED) "/^domain/d" < $(<F).po > $@ ;
1316 1324 $(RM) $(<F).po
1317 1325
1318 1326 #
1319 1327 # When using xgettext, we want messages to go to the default domain,
1320 1328 # rather than the specified one. This special version of the
1321 1329 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
1322 1330 # causing xgettext to put all messages into the default domain.
1323 1331 #
1324 1332 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
1325 1333
1326 1334 .c.i:
1327 1335 $(CPPFORPO) $< > $@
1328 1336
1329 1337 .h.i:
1330 1338 $(CPPFORPO) $< > $@
1331 1339
1332 1340 .y.i:
1333 1341 $(YACC) -d $<
1334 1342 $(CPPFORPO) y.tab.c > $@
1335 1343 $(RM) y.tab.c
1336 1344
1337 1345 .l.i:
1338 1346 $(LEX) $<
1339 1347 $(CPPFORPO) lex.yy.c > $@
1340 1348 $(RM) lex.yy.c
1341 1349
1342 1350 .c.po:
1343 1351 $(CPPFORPO) $< > $<.i
1344 1352 $(BUILD.po)
1345 1353
1346 1354 .cc.po:
1347 1355 $(CPPFORPO) $< > $<.i
1348 1356 $(BUILD.po)
1349 1357
1350 1358 .y.po:
1351 1359 $(YACC) -d $<
1352 1360 $(CPPFORPO) y.tab.c > $<.i
1353 1361 $(BUILD.po)
1354 1362 $(RM) y.tab.c
1355 1363
1356 1364 .l.po:
1357 1365 $(LEX) $<
1358 1366 $(CPPFORPO) lex.yy.c > $<.i
1359 1367 $(BUILD.po)
1360 1368 $(RM) lex.yy.c
1361 1369
1362 1370 #
1363 1371 # Rules to perform stylistic checks
1364 1372 #
1365 1373 .SUFFIXES: .x .xml .check .xmlchk
1366 1374
1367 1375 .h.check:
1368 1376 $(DOT_H_CHECK)
1369 1377
1370 1378 .x.check:
1371 1379 $(DOT_X_CHECK)
1372 1380
1373 1381 .xml.xmlchk:
1374 1382 $(MANIFEST_CHECK)
|
↓ open down ↓ |
653 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX