1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
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 #
21
22 #
23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 # Copyright 2013 Nexenta Systems, Inc. All rights reserved.
26 #
27
28 #
29 # Makefile.master, global definitions for system source
30 #
31 ROOT= /proto
32
33 #
34 # Adjunct root, containing an additional proto area to be used for headers
35 # and libraries.
36 #
37 ADJUNCT_PROTO=
38
39 #
40 # Adjunct for building things that run on the build machine.
41 #
42 NATIVE_ADJUNCT= /usr
43
44 #
45 # RELEASE_BUILD should be cleared for final release builds.
46 # NOT_RELEASE_BUILD is exactly what the name implies.
47 #
48 # __GNUC toggles the building of ON components using gcc and related tools.
49 # Normally set to `#', set it to `' to do gcc build.
50 #
51 # The declaration POUND_SIGN is always '#'. This is needed to get around the
52 # make feature that '#' is always a comment delimiter, even when escaped or
53 # quoted. We use this macro expansion method to get POUND_SIGN rather than
54 # always breaking out a shell because the general case can cause a noticable
55 # slowdown in build times when so many Makefiles include Makefile.master.
56 #
57 # While the majority of users are expected to override the setting below
58 # with an env file (via nightly or bldenv), if you aren't building that way
59 # (ie, you're using "ws" or some other bootstrapping method) then you need
60 # this definition in order to avoid the subshell invocation mentioned above.
61 #
62
63 PRE_POUND= pre\#
64 POUND_SIGN= $(PRE_POUND:pre\%=%)
65
66 NOT_RELEASE_BUILD=
67 RELEASE_BUILD= $(POUND_SIGN)
68 $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN)
69 PATCH_BUILD= $(POUND_SIGN)
70
71 # SPARC_BLD is '#' for an Intel build.
72 # INTEL_BLD is '#' for a Sparc build.
73 SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN))
74 SPARC_BLD= $(SPARC_BLD_1:sparc=)
75 INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN))
76 INTEL_BLD= $(INTEL_BLD_1:i386=)
77
78 # The variables below control the compilers used during the build.
79 # There are a number of permutations.
80 #
81 # __GNUC and __SUNC control (and indicate) the primary compiler. Whichever
82 # one is not POUND_SIGN is the primary, with the other as the shadow. They
83 # may also be used to control entirely compiler-specific Makefile assignments.
84 # __SUNC and Sun Studio are the default.
85 #
86 # __GNUC64 indicates that the 64bit build should use the GNU C compiler.
87 # There is no Sun C analogue.
88 #
89 # The following version-specific options are operative regardless of which
90 # compiler is primary, and control the versions of the given compilers to be
91 # used. They also allow compiler-version specific Makefile fragments.
92 #
93
94 __GNUC= $(POUND_SIGN)
95 $(__GNUC)__SUNC= $(POUND_SIGN)
96 __GNUC64= $(__GNUC)
97
98 # CLOSED is the root of the tree that contains source which isn't released
99 # as open source
100 CLOSED= $(SRC)/../closed
101
102 # BUILD_TOOLS is the root of all tools including compilers.
103 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
104
105 BUILD_TOOLS= /ws/onnv-tools
106 ONBLD_TOOLS= $(BUILD_TOOLS)/onbld
107
108 JAVA_ROOT= /usr/java
109
110 SFW_ROOT= /usr/sfw
111 SFWINCDIR= $(SFW_ROOT)/include
112 SFWLIBDIR= $(SFW_ROOT)/lib
113 SFWLIBDIR64= $(SFW_ROOT)/lib/$(MACH64)
114
115 GCC_ROOT= /opt/gcc/4.4.4
116 GCCLIBDIR= $(GCC_ROOT)/lib
117 GCCLIBDIR64= $(GCC_ROOT)/lib/$(MACH64)
118
119 DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
120
121 RPCGEN= /usr/bin/rpcgen
122 STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
123 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
124 MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch
125 ECHO= echo
126 INS= install
127 TRUE= true
128 SYMLINK= /usr/bin/ln -s
129 LN= /usr/bin/ln
130 CHMOD= /usr/bin/chmod
131 MV= /usr/bin/mv -f
132 RM= /usr/bin/rm -f
133 CUT= /usr/bin/cut
134 NM= /usr/ccs/bin/nm
135 DIFF= /usr/bin/diff
136 GREP= /usr/bin/grep
137 EGREP= /usr/bin/egrep
138 ELFWRAP= /usr/bin/elfwrap
139 KSH93= /usr/bin/ksh93
140 SED= /usr/bin/sed
141 NAWK= /usr/bin/nawk
142 CP= /usr/bin/cp -f
143 MCS= /usr/ccs/bin/mcs
144 CAT= /usr/bin/cat
145 ELFDUMP= /usr/ccs/bin/elfdump
146 M4= /usr/ccs/bin/m4
147 STRIP= /usr/ccs/bin/strip
148 LEX= /usr/ccs/bin/lex
149 FLEX= /usr/bin/flex
150 YACC= /usr/ccs/bin/yacc
151 BISON= /usr/bin/bison
152 CPP= /usr/lib/cpp
153 JAVAC= $(JAVA_ROOT)/bin/javac
154 JAVAH= $(JAVA_ROOT)/bin/javah
155 JAVADOC= $(JAVA_ROOT)/bin/javadoc
156 RMIC= $(JAVA_ROOT)/bin/rmic
157 JAR= $(JAVA_ROOT)/bin/jar
158 CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert
159 CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge
160 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
161 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip
162 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
163 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
164 CTFCVTPTBL= $(ONBLD_TOOLS)/bin/ctfcvtptbl
165 CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod
166 XREF= $(ONBLD_TOOLS)/bin/xref
167 FIND= /usr/bin/find
168 PERL= /usr/bin/perl
169 PYTHON_26= /usr/bin/python2.6
170 PYTHON= $(PYTHON_26)
171 SORT= /usr/bin/sort
172 TOUCH= /usr/bin/touch
173 WC= /usr/bin/wc
174 XARGS= /usr/bin/xargs
175 ELFEDIT= /usr/bin/elfedit
176 ELFSIGN= /usr/bin/elfsign
177 DTRACE= /usr/sbin/dtrace -xnolibs
178 UNIQ= /usr/bin/uniq
179 TAR= /usr/bin/tar
180 ASTBINDIR= /usr/ast/bin
181 MSGCC= $(ASTBINDIR)/msgcc
182
183 FILEMODE= 644
184 DIRMODE= 755
185
186 #
187 # The version of the patch makeup table optimized for build-time use. Used
188 # during patch builds only.
189 $(PATCH_BUILD)PMTMO_FILE=$(SRC)/patch_makeup_table.mo
190
191 # Declare that nothing should be built in parallel.
192 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
193 .NO_PARALLEL:
194
195 # For stylistic checks
196 #
197 # Note that the X and C checks are not used at this time and may need
198 # modification when they are actually used.
199 #
200 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
201 CSTYLE_TAIL=
202 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
203 HDRCHK_TAIL=
204 JSTYLE= $(ONBLD_TOOLS)/bin/jstyle
205
206 DOT_H_CHECK= \
207 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
208 $(HDRCHK) $< $(HDRCHK_TAIL)
209
210 DOT_X_CHECK= \
211 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
212 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
213
214 DOT_C_CHECK= \
215 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
216
217 MANIFEST_CHECK= \
218 @$(ECHO) "checking $<"; \
219 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
220 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
221 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
222 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
223
224 INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $<
225 INS.dir= $(INS) -s -d -m $(DIRMODE) $@
226 # installs and renames at once
227 #
228 INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@
229
230 # install a link
231 INSLINKTARGET= $<
232 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
233 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
234
235 #
236 # Python bakes the mtime of the .py file into the compiled .pyc and
237 # rebuilds if the baked-in mtime != the mtime of the source file
238 # (rather than only if it's less than), thus when installing python
239 # files we must make certain to not adjust the mtime of the source
240 # (.py) file.
241 #
242 INS.pyfile= $(INS.file); $(TOUCH) -r $< $@
243
244 # MACH must be set in the shell environment per uname -p on the build host
245 # More specific architecture variables should be set in lower makefiles.
246 #
247 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
248 # architectures on which we do not build 64-bit versions.
249 # (There are no such architectures at the moment.)
250 #
251 # Set BUILD64=# in the environment to disable 64-bit amd64
252 # builds on i386 machines.
253
254 MACH64_1= $(MACH:sparc=sparcv9)
255 MACH64= $(MACH64_1:i386=amd64)
256
257 MACH32_1= $(MACH:sparc=sparcv7)
258 MACH32= $(MACH32_1:i386=i86)
259
260 sparc_BUILD64=
261 i386_BUILD64=
262 BUILD64= $($(MACH)_BUILD64)
263
264 #
265 # C compiler mode. Future compilers may change the default on us,
266 # so force extended ANSI mode globally. Lower level makefiles can
267 # override this by setting CCMODE.
268 #
269 CCMODE= -Xa
270 CCMODE64= -Xa
271
272 #
273 # C compiler verbose mode. This is so we can enable it globally,
274 # but turn it off in the lower level makefiles of things we cannot
275 # (or aren't going to) fix.
276 #
277 CCVERBOSE= -v
278
279 # set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings
280 # from the compiler about places the -xarch=v9 may differ from -xarch=v9c.
281 V9ABIWARN=
282
283 # set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register
284 # symbols (used to detect conflicts between objects that use global registers)
285 # we disable this now for safety, and because genunix doesn't link with
286 # this feature (the v9 default) enabled.
287 #
288 # REGSYM is separate since the C++ driver syntax is different.
289 CCREGSYM= -Wc,-Qiselect-regsym=0
290 CCCREGSYM= -Qoption cg -Qiselect-regsym=0
291
292 # Prevent the removal of static symbols by the SPARC code generator (cg).
293 # The x86 code generator (ube) does not remove such symbols and as such
294 # using this workaround is not applicable for x86.
295 #
296 CCSTATICSYM= -Wc,-Qassembler-ounrefsym=0
297 #
298 # generate 32-bit addresses in the v9 kernel. Saves memory.
299 CCABS32= -Wc,-xcode=abs32
300 #
301 # generate v9 code which tolerates callers using the v7 ABI, for the sake of
302 # system calls.
303 CC32BITCALLERS= -_gcc=-massume-32bit-callers
304
305 # GCC, especially, is increasingly beginning to auto-inline functions and
306 # sadly does so separately not under the general -fno-inline-functions
307 # Additionally, we wish to prevent optimisations which cause GCC to clone
308 # functions -- in particular, these may cause unhelpful symbols to be
309 # emitted instead of function names
310 CCNOAUTOINLINE= -_gcc=-fno-inline-small-functions \
311 -_gcc=-fno-inline-functions-called-once \
312 -_gcc=-fno-ipa-cp
313
314 # One optimization the compiler might perform is to turn this:
315 # #pragma weak foo
316 # extern int foo;
317 # if (&foo)
318 # foo = 5;
319 # into
320 # foo = 5;
321 # Since we do some of this (foo might be referenced in common kernel code
322 # but provided only for some cpu modules or platforms), we disable this
323 # optimization.
324 #
325 sparc_CCUNBOUND = -Wd,-xsafe=unboundsym
326 i386_CCUNBOUND =
327 CCUNBOUND = $($(MACH)_CCUNBOUND)
328
329 #
330 # compiler '-xarch' flag. This is here to centralize it and make it
331 # overridable for testing.
332 sparc_XARCH= -m32
333 sparcv9_XARCH= -m64
334 i386_XARCH=
335 amd64_XARCH= -m64 -Ui386 -U__i386
336
337 # assembler '-xarch' flag. Different from compiler '-xarch' flag.
338 sparc_AS_XARCH= -xarch=v8plus
339 sparcv9_AS_XARCH= -xarch=v9
340 i386_AS_XARCH=
341 amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386
342
343 #
344 # These flags define what we need to be 'standalone' i.e. -not- part
345 # of the rather more cosy userland environment. This basically means
346 # the kernel.
347 #
348 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
349 #
350 sparc_STAND_FLAGS= -_gcc=-ffreestanding
351 sparcv9_STAND_FLAGS= -_gcc=-ffreestanding
352 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
353 # additions to SSE (SSE2, AVX ,etc.)
354 NO_SIMD= -_gcc=-mno-mmx -_gcc=-mno-sse
355 i386_STAND_FLAGS= -_gcc=-ffreestanding $(NO_SIMD)
356 amd64_STAND_FLAGS= -xmodel=kernel $(NO_SIMD)
357
358 SAVEARGS= -Wu,-save_args
359 amd64_STAND_FLAGS += $(SAVEARGS)
360
361 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
362 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
363
364 #
365 # disable the incremental linker
366 ILDOFF= -xildoff
367 #
368 XDEPEND= -xdepend
369 XFFLAG= -xF=%all
370 XESS= -xs
371 XSTRCONST= -xstrconst
372
373 #
374 # turn warnings into errors (C)
375 CERRWARN = -errtags=yes -errwarn=%all
376 CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
377 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
378
379 CERRWARN += -_gcc=-Wno-missing-braces
380 CERRWARN += -_gcc=-Wno-sign-compare
381 CERRWARN += -_gcc=-Wno-unknown-pragmas
382 CERRWARN += -_gcc=-Wno-unused-parameter
383 CERRWARN += -_gcc=-Wno-missing-field-initializers
384
385 # Unfortunately, this option can misfire very easily and unfixably.
386 CERRWARN += -_gcc=-Wno-array-bounds
387
388 # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in
389 # -nd builds
390 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
391 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-empty-body
392
393 #
394 # turn warnings into errors (C++)
395 CCERRWARN= -xwe
396
397 # C99 mode
398 C99_ENABLE= -xc99=%all
399 C99_DISABLE= -xc99=%none
400 C99MODE= $(C99_DISABLE)
401 C99LMODE= $(C99MODE:-xc99%=-Xc99%)
402
403 # In most places, assignments to these macros should be appended with +=
404 # (CPPFLAGS.master allows values to be prepended to CPPFLAGS).
405 sparc_CFLAGS= $(sparc_XARCH) $(CCSTATICSYM)
406 sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
407 $(CCSTATICSYM)
408 i386_CFLAGS= $(i386_XARCH)
409 amd64_CFLAGS= $(amd64_XARCH)
410
411 sparc_ASFLAGS= $(sparc_AS_XARCH)
412 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
413 i386_ASFLAGS= $(i386_AS_XARCH)
414 amd64_ASFLAGS= $(amd64_AS_XARCH)
415
416 #
417 sparc_COPTFLAG= -xO3
418 sparcv9_COPTFLAG= -xO3
419 i386_COPTFLAG= -O
420 amd64_COPTFLAG= -xO3
421
422 COPTFLAG= $($(MACH)_COPTFLAG)
423 COPTFLAG64= $($(MACH64)_COPTFLAG)
424
425 # When -g is used, the compiler globalizes static objects
426 # (gives them a unique prefix). Disable that.
427 CNOGLOBAL= -W0,-noglobal
428
429 # Direct the Sun Studio compiler to use a static globalization prefix based on the
430 # name of the module rather than something unique. Otherwise, objects
431 # will not build deterministically, as subsequent compilations of identical
432 # source will yeild objects that always look different.
433 #
434 # In the same spirit, this will also remove the date from the N_OPT stab.
435 CGLOBALSTATIC= -W0,-xglobalstatic
436
437 # Sometimes we want all symbols and types in debugging information even
438 # if they aren't used.
439 CALLSYMS= -W0,-xdbggen=no%usedonly
440
441 #
442 # Default debug format for Sun Studio 11 is dwarf, so force it to
443 # generate stabs.
444 #
445 DEBUGFORMAT= -xdebugformat=stabs
446
447 #
448 # Flags used to build in debug mode for ctf generation. Bugs in the Devpro
449 # compilers currently prevent us from building with cc-emitted DWARF.
450 #
451 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
452 CTF_FLAGS_i386 = -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
453
454 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
455 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
456
457 # Sun Studio produces broken userland code when saving arguments.
458 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
459
460 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
461 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64)) $(DEBUGFORMAT)
462 CTF_FLAGS = $(CTF_FLAGS_32)
463
464 #
465 # Flags used with genoffsets
466 #
467 GOFLAGS = -_noecho \
468 $(CALLSYMS) \
469 $(CDWARFSTR)
470
471 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
472 $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
473
474 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
475 $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
476
477 #
478 # tradeoff time for space (smaller is better)
479 #
480 sparc_SPACEFLAG = -xspace -W0,-Lt
481 sparcv9_SPACEFLAG = -xspace -W0,-Lt
482 i386_SPACEFLAG = -xspace
483 amd64_SPACEFLAG =
484
485 SPACEFLAG = $($(MACH)_SPACEFLAG)
486 SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
487
488 #
489 # The Sun Studio 11 compiler has changed the behaviour of integer
490 # wrap arounds and so a flag is needed to use the legacy behaviour
491 # (without this flag panics/hangs could be exposed within the source).
492 #
493 sparc_IROPTFLAG = -W2,-xwrap_int
494 sparcv9_IROPTFLAG = -W2,-xwrap_int
495 i386_IROPTFLAG =
496 amd64_IROPTFLAG =
497
498 IROPTFLAG = $($(MACH)_IROPTFLAG)
499 IROPTFLAG64 = $($(MACH64)_IROPTFLAG)
500
501 sparc_XREGSFLAG = -xregs=no%appl
502 sparcv9_XREGSFLAG = -xregs=no%appl
503 i386_XREGSFLAG =
504 amd64_XREGSFLAG =
505
506 XREGSFLAG = $($(MACH)_XREGSFLAG)
507 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
508
509 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and
510 # avoids stripping it.
511 SOURCEDEBUG = $(POUND_SIGN)
512 SRCDBGBLD = $(SOURCEDEBUG:yes=)
513
514 #
515 # These variables are intended ONLY for use by developers to safely pass extra
516 # flags to the compilers without unintentionally overriding Makefile-set
517 # flags. They should NEVER be set to any value in a Makefile.
518 #
519 # They come last in the associated FLAGS variable such that they can
520 # explicitly override things if necessary, there are gaps in this, but it's
521 # the best we can manage.
522 #
523 CUSERFLAGS =
524 CUSERFLAGS64 = $(CUSERFLAGS)
525 CCUSERFLAGS =
526 CCUSERFLAGS64 = $(CCUSERFLAGS)
527
528 CSOURCEDEBUGFLAGS =
529 CCSOURCEDEBUGFLAGS =
530 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = -g -xs
531 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = -g -xs
532
533 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
534 $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG) \
535 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
536 $(CUSERFLAGS)
537 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
538 $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG64) \
539 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CSOURCEDEBUGFLAGS) \
540 $(CUSERFLAGS64)
541 #
542 # Flags that are used to build parts of the code that are subsequently
543 # run on the build machine (also known as the NATIVE_BUILD).
544 #
545 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
546 $(ILDOFF) $(CERRWARN) $(C99MODE) $($(NATIVE_MACH)_CCUNBOUND) \
547 $(IROPTFLAG) $(CGLOBALSTATIC) $(CCNOAUTOINLINE) \
548 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
549
550 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
551 DTS_ERRNO=-D_TS_ERRNO
552 CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \
553 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \
554 $(ADJUNCT_PROTO:%=-I%/usr/include)
555 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \
556 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include
557 CPPFLAGS= $(CPPFLAGS.master)
558 AS_CPPFLAGS= $(CPPFLAGS.master)
559 JAVAFLAGS= -deprecation
560
561 #
562 # For source message catalogue
563 #
564 .SUFFIXES: $(SUFFIXES) .i .po
565 MSGROOT= $(ROOT)/catalog
566 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
567 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
568 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
569 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
570
571 CLOBBERFILES += $(POFILE) $(POFILES)
572 COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS)
573 XGETTEXT= /usr/bin/xgettext
574 XGETFLAGS= -c TRANSLATION_NOTE
575 GNUXGETTEXT= /usr/gnu/bin/xgettext
576 GNUXGETFLAGS= --add-comments=TRANSLATION_NOTE --keyword=_ \
577 --strict --no-location --omit-header
578 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
579 $(RM) $@ ;\
580 $(SED) "/^domain/d" < $(<F).po > $@ ;\
581 $(RM) $(<F).po $<.i
582
583 #
584 # This is overwritten by local Makefile when PROG is a list.
585 #
586 POFILE= $(PROG).po
587
588 sparc_CCFLAGS= -cg92 -compat=4 \
589 -Qoption ccfe -messages=no%anachronism \
590 $(CCERRWARN)
591 sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \
592 -Qoption ccfe -messages=no%anachronism \
593 -Qoption ccfe -features=no%conststrings \
594 $(CCCREGSYM) \
595 $(CCERRWARN)
596 i386_CCFLAGS= -compat=4 \
597 -Qoption ccfe -messages=no%anachronism \
598 -Qoption ccfe -features=no%conststrings \
599 $(CCERRWARN)
600 amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \
601 -Qoption ccfe -messages=no%anachronism \
602 -Qoption ccfe -features=no%conststrings \
603 $(CCERRWARN)
604
605 sparc_CCOPTFLAG= -O
606 sparcv9_CCOPTFLAG= -O
607 i386_CCOPTFLAG= -O
608 amd64_CCOPTFLAG= -O
609
610 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
611 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
612 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
613 $(CCUSERFLAGS)
614 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
615 $(CCUSERFLAGS64)
616
617 #
618 #
619 #
620 ELFWRAP_FLAGS =
621 ELFWRAP_FLAGS64 = -64
622
623 #
624 # Various mapfiles that are used throughout the build, and delivered to
625 # /usr/lib/ld.
626 #
627 MAPFILE.NED_i386 = $(SRC)/common/mapfiles/common/map.noexdata
628 MAPFILE.NED_sparc =
629 MAPFILE.NED = $(MAPFILE.NED_$(MACH))
630 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
631 MAPFILE.NES = $(SRC)/common/mapfiles/common/map.noexstk
632 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
633 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
634
635 #
636 # Generated mapfiles that are compiler specific, and used throughout the
637 # build. These mapfiles are not delivered in /usr/lib/ld.
638 #
639 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_cc_map.noexeglobs
640 $(__GNUC64)MAPFILE.NGB_sparc= \
641 $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
642 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_cc_map.noexeglobs
643 $(__GNUC64)MAPFILE.NGB_sparcv9= \
644 $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
645 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_cc_map.noexeglobs
646 $(__GNUC64)MAPFILE.NGB_i386= \
647 $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
648 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_cc_map.noexeglobs
649 $(__GNUC64)MAPFILE.NGB_amd64= \
650 $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
651 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
652
653 #
654 # A generic interface mapfile name, used by various dynamic objects to define
655 # the interfaces and interposers the object must export.
656 #
657 MAPFILE.INT = mapfile-intf
658
659 #
660 # LDLIBS32 can be set in the environment to override the following assignment.
661 # LDLIBS64 can be set to override the assignment made in Makefile.master.64.
662 # These environment settings make sure that no libraries are searched outside
663 # of the local workspace proto area:
664 # LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
665 # LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
666 #
667 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
668 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
669 LDLIBS.cmd = $(LDLIBS32)
670 LDLIBS.lib = $(LDLIBS32)
671 #
672 # Define compilation macros.
673 #
674 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
675 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
676 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
677 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
678 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
679 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
680 COMPILE.d= $(DTRACE) -G -32
681 COMPILE64.d= $(DTRACE) -G -64
682 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
683 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
684
685 CLASSPATH= .
686 COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH)
687
688 #
689 # Link time macros
690 #
691 CCNEEDED = -lC
692 CCEXTNEEDED = -lCrun -lCstd
693 $(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
694 $(__GNUC)CCEXTNEEDED = $(CCNEEDED)
695
696 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
697 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
698 NORUNPATH= -norunpath -nolib
699 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
700 $(LDFLAGS) $(CCNEEDED)
701 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
702 $(LDFLAGS) $(CCNEEDED)
703
704 #
705 # lint macros
706 #
707 # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once
708 # ON is built with a version of lint that has the fix for 4484186.
709 #
710 ALWAYS_LINT_DEFS = -errtags=yes -s
711 ALWAYS_LINT_DEFS += -erroff=E_PTRDIFF_OVERFLOW
712 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_NARROW_CONV
713 ALWAYS_LINT_DEFS += -U__PRAGMA_REDEFINE_EXTNAME
714 ALWAYS_LINT_DEFS += $(C99LMODE)
715 ALWAYS_LINT_DEFS += -errsecurity=$(SECLEVEL)
716 ALWAYS_LINT_DEFS += -erroff=E_SEC_CREAT_WITHOUT_EXCL
717 ALWAYS_LINT_DEFS += -erroff=E_SEC_FORBIDDEN_WARN_CREAT
718 # XX64 -- really only needed for amd64 lint
719 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_INT_TO_SMALL_INT
720 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
721 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_TO_SMALL_INT
722 ALWAYS_LINT_DEFS += -erroff=E_CAST_TO_PTR_FROM_INT
723 ALWAYS_LINT_DEFS += -erroff=E_COMP_INT_WITH_LARGE_INT
724 ALWAYS_LINT_DEFS += -erroff=E_INTEGRAL_CONST_EXP_EXPECTED
725 ALWAYS_LINT_DEFS += -erroff=E_PASS_INT_TO_SMALL_INT
726 ALWAYS_LINT_DEFS += -erroff=E_PTR_CONV_LOSES_BITS
727
728 # This forces lint to pick up note.h and sys/note.h from Devpro rather than
729 # from the proto area. The note.h that ON delivers would disable NOTE().
730 ONLY_LINT_DEFS = -I$(SPRO_VROOT)/prod/include/lint
731
732 SECLEVEL= core
733 LINT.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS) $(CPPFLAGS) \
734 $(ALWAYS_LINT_DEFS)
735 LINT64.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS64) $(CPPFLAGS) \
736 $(ALWAYS_LINT_DEFS)
737 LINT.s= $(LINT.c)
738
739 # For some future builds, NATIVE_MACH and MACH might be different.
740 # Therefore, NATIVE_MACH needs to be redefined in the
741 # environment as `uname -p` to override this macro.
742 #
743 # For now at least, we cross-compile amd64 on i386 machines.
744 NATIVE_MACH= $(MACH:amd64=i386)
745
746 # Define native compilation macros
747 #
748
749 # Base directory where compilers are loaded.
750 # Defined here so it can be overridden by developer.
751 #
752 SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro
753 SPRO_VROOT= $(SPRO_ROOT)/SS12
754 GNU_ROOT= $(SFW_ROOT)
755
756 # Till SS12u1 formally becomes the NV CBE, LINT is hard
757 # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/
758 # location. Impacted variables are sparc_LINT, sparcv9_LINT,
759 # i386_LINT, amd64_LINT.
760 # Reset them when SS12u1 is rolled out.
761 #
762
763 # Specify platform compiler versions for languages
764 # that we use (currently only c and c++).
765 #
766 sparc_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
767 $(__GNUC)sparc_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
768 sparc_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
769 $(__GNUC)sparc_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
770 sparc_CPP= /usr/ccs/lib/cpp
771 sparc_AS= /usr/ccs/bin/as -xregsym=no
772 sparc_LD= /usr/ccs/bin/ld
773 sparc_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
774
775 sparcv9_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
776 $(__GNUC64)sparcv9_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
777 sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
778 $(__GNUC64)sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
779 sparcv9_CPP= /usr/ccs/lib/cpp
780 sparcv9_AS= /usr/ccs/bin/as -xregsym=no
781 sparcv9_LD= /usr/ccs/bin/ld
782 sparcv9_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
783
784 i386_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
785 $(__GNUC)i386_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
786 i386_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
787 $(__GNUC)i386_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
788 i386_CPP= /usr/ccs/lib/cpp
789 i386_AS= /usr/ccs/bin/as
790 $(__GNUC)i386_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
791 i386_LD= /usr/ccs/bin/ld
792 i386_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
793
794 amd64_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
795 $(__GNUC64)amd64_CC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
796 amd64_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
797 $(__GNUC64)amd64_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
798 amd64_CPP= /usr/ccs/lib/cpp
799 amd64_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
800 amd64_LD= /usr/ccs/bin/ld
801 amd64_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
802
803 NATIVECC= $($(NATIVE_MACH)_CC)
804 NATIVECCC= $($(NATIVE_MACH)_CCC)
805 NATIVECPP= $($(NATIVE_MACH)_CPP)
806 NATIVEAS= $($(NATIVE_MACH)_AS)
807 NATIVELD= $($(NATIVE_MACH)_LD)
808 NATIVELINT= $($(NATIVE_MACH)_LINT)
809
810 #
811 # Makefile.master.64 overrides these settings
812 #
813 CC= $(NATIVECC)
814 CCC= $(NATIVECCC)
815 CPP= $(NATIVECPP)
816 AS= $(NATIVEAS)
817 LD= $(NATIVELD)
818 LINT= $(NATIVELINT)
819
820 # The real compilers used for this build
821 CW_CC_CMD= $(CC) -_compiler
822 CW_CCC_CMD= $(CCC) -_compiler
823 REAL_CC= $(CW_CC_CMD:sh)
824 REAL_CCC= $(CW_CCC_CMD:sh)
825
826 # Pass -Y flag to cpp (method of which is release-dependent)
827 CCYFLAG= -Y I,
828
829 BDIRECT= -Bdirect
830 BDYNAMIC= -Bdynamic
831 BLOCAL= -Blocal
832 BNODIRECT= -Bnodirect
833 BREDUCE= -Breduce
834 BSTATIC= -Bstatic
835
836 ZDEFS= -zdefs
837 ZDIRECT= -zdirect
838 ZIGNORE= -zignore
839 ZINITFIRST= -zinitfirst
840 ZINTERPOSE= -zinterpose
841 ZLAZYLOAD= -zlazyload
842 ZLOADFLTR= -zloadfltr
843 ZMULDEFS= -zmuldefs
844 ZNODEFAULTLIB= -znodefaultlib
845 ZNODEFS= -znodefs
846 ZNODELETE= -znodelete
847 ZNODLOPEN= -znodlopen
848 ZNODUMP= -znodump
849 ZNOLAZYLOAD= -znolazyload
850 ZNOLDYNSYM= -znoldynsym
851 ZNORELOC= -znoreloc
852 ZNOVERSION= -znoversion
853 ZRECORD= -zrecord
854 ZREDLOCSYM= -zredlocsym
855 ZTEXT= -ztext
856 ZVERBOSE= -zverbose
857
858 GSHARED= -G
859 CCMT= -mt
860
861 # Handle different PIC models on different ISAs
862 # (May be overridden by lower-level Makefiles)
863
864 sparc_C_PICFLAGS = -K pic
865 sparcv9_C_PICFLAGS = -K pic
866 i386_C_PICFLAGS = -K pic
867 amd64_C_PICFLAGS = -K pic
868 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
869 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
870
871 sparc_C_BIGPICFLAGS = -K PIC
872 sparcv9_C_BIGPICFLAGS = -K PIC
873 i386_C_BIGPICFLAGS = -K PIC
874 amd64_C_BIGPICFLAGS = -K PIC
875 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
876 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
877
878 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
879 sparc_CC_PICFLAGS = -Kpic
880 sparcv9_CC_PICFLAGS = -KPIC
881 i386_CC_PICFLAGS = -Kpic
882 amd64_CC_PICFLAGS = -Kpic
883 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
884 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
885
886 AS_PICFLAGS= $(C_PICFLAGS)
887 AS_BIGPICFLAGS= $(C_BIGPICFLAGS)
888
889 #
890 # Default label for CTF sections
891 #
892 CTFCVTFLAGS= -i -L VERSION
893 $(SRCDBGBLD)CTFCVTFLAGS += -g
894
895 #
896 # Override to pass module-specific flags to ctfmerge. Currently used only by
897 # krtld to turn on fuzzy matching, and source-level debugging to inhibit
898 # stripping.
899 #
900 CTFMRGFLAGS=
901 $(SRCDBGBLD)CTFMRGFLAGS += -g
902
903
904 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
905
906 ELFSIGN_O= $(TRUE)
907 ELFSIGN_CRYPTO= $(ELFSIGN_O)
908 ELFSIGN_OBJECT= $(ELFSIGN_O)
909
910 # Rules (normally from make.rules) and macros which are used for post
911 # processing files. Normally, these do stripping of the comment section
912 # automatically.
913 # RELEASE_CM: Should be editted to reflect the release.
914 # POST_PROCESS_O: Post-processing for `.o' files.
915 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
916 # POST_PROCESS_SO: Post-processing for `.so' files.
917 # POST_PROCESS: Post-processing for executable files (no suffix).
918 # Note that these macros are not completely generalized as they are to be
919 # used with the file name to be processed following.
920 #
921 # It is left as an exercise to Release Engineering to embellish the generation
922 # of the release comment string.
923 #
924 # If this is a standard development build:
925 # compress the comment section (mcs -c)
926 # add the standard comment (mcs -a $(RELEASE_CM))
927 # add the development specific comment (mcs -a $(DEV_CM))
928 #
929 # If this is an installation build:
930 # delete the comment section (mcs -d)
931 # add the standard comment (mcs -a $(RELEASE_CM))
932 # add the development specific comment (mcs -a $(DEV_CM))
933 #
934 # If this is an release build:
935 # delete the comment section (mcs -d)
936 # add the standard comment (mcs -a $(RELEASE_CM))
937 #
938 # The following list of macros are used in the definition of RELEASE_CM
939 # which is used to label all binaries in the build:
940 #
941 # RELEASE Specific release of the build, eg: 5.2
942 # RELEASE_MAJOR Major version number part of $(RELEASE)
943 # RELEASE_MINOR Minor version number part of $(RELEASE)
944 # VERSION Version of the build (alpha, beta, Generic)
945 # PATCHID If this is a patch this value should contain
946 # the patchid value (eg: "Generic 100832-01"), otherwise
947 # it will be set to $(VERSION)
948 # RELEASE_DATE Date of the Release Build
949 # PATCH_DATE Date the patch was created, if this is blank it
950 # will default to the RELEASE_DATE
951 #
952 RELEASE_MAJOR= 5
953 RELEASE_MINOR= 11
954 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
955 VERSION= SunOS Development
956 PATCHID= $(VERSION)
957 RELEASE_DATE= release date not set
958 PATCH_DATE= $(RELEASE_DATE)
959 RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
960 DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: non-nightly build"
961
962 PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
963 $(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
964
965 STRIP_STABS= :
966 $(RELEASE_BUILD)STRIP_STABS= $(STRIP) -x $@
967 $(SRCDBGBLD)STRIP_STABS= :
968
969 POST_PROCESS_O= $(PROCESS_COMMENT) $@
970 POST_PROCESS_A=
971 POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
972 $(ELFSIGN_OBJECT)
973 POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
974 $(ELFSIGN_OBJECT)
975
976 #
977 # chk4ubin is a tool that inspects a module for a symbol table
978 # ELF section size which can trigger an OBP bug on older platforms.
979 # This problem affects only specific sun4u bootable modules.
980 #
981 CHK4UBIN= $(ONBLD_TOOLS)/bin/$(MACH)/chk4ubin
982 CHK4UBINFLAGS=
983 CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@
984
985 #
986 # PKGARCHIVE specifies the default location where packages should be
987 # placed if built.
988 #
989 $(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd
990 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
991
992 #
993 # The repositories will be created with these publisher settings. To
994 # update an image to the resulting repositories, this must match the
995 # publisher name provided to "pkg set-publisher."
996 #
997 PKGPUBLISHER_REDIST= on-nightly
998 PKGPUBLISHER_NONREDIST= on-extra
999
1000 # Default build rules which perform comment section post-processing.
1001 #
1002 .c:
1003 $(LINK.c) -o $@ $< $(LDLIBS)
1004 $(POST_PROCESS)
1005 .c.o:
1006 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
1007 $(POST_PROCESS_O)
1008 .c.a:
1009 $(COMPILE.c) -o $% $<
1010 $(PROCESS_COMMENT) $%
1011 $(AR) $(ARFLAGS) $@ $%
1012 $(RM) $%
1013 .s.o:
1014 $(COMPILE.s) -o $@ $<
1015 $(POST_PROCESS_O)
1016 .s.a:
1017 $(COMPILE.s) -o $% $<
1018 $(PROCESS_COMMENT) $%
1019 $(AR) $(ARFLAGS) $@ $%
1020 $(RM) $%
1021 .cc:
1022 $(LINK.cc) -o $@ $< $(LDLIBS)
1023 $(POST_PROCESS)
1024 .cc.o:
1025 $(COMPILE.cc) $(OUTPUT_OPTION) $<
1026 $(POST_PROCESS_O)
1027 .cc.a:
1028 $(COMPILE.cc) -o $% $<
1029 $(AR) $(ARFLAGS) $@ $%
1030 $(PROCESS_COMMENT) $%
1031 $(RM) $%
1032 .y:
1033 $(YACC.y) $<
1034 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
1035 $(POST_PROCESS)
1036 $(RM) y.tab.c
1037 .y.o:
1038 $(YACC.y) $<
1039 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
1040 $(POST_PROCESS_O)
1041 $(RM) y.tab.c
1042 .l:
1043 $(RM) $*.c
1044 $(LEX.l) $< > $*.c
1045 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
1046 $(POST_PROCESS)
1047 $(RM) $*.c
1048 .l.o:
1049 $(RM) $*.c
1050 $(LEX.l) $< > $*.c
1051 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
1052 $(POST_PROCESS_O)
1053 $(RM) $*.c
1054
1055 .bin.o:
1056 $(COMPILE.b) -o $@ $<
1057 $(POST_PROCESS_O)
1058
1059 .java.class:
1060 $(COMPILE.java) $<
1061
1062 # Bourne and Korn shell script message catalog build rules.
1063 # We extract all gettext strings with sed(1) (being careful to permit
1064 # multiple gettext strings on the same line), weed out the dups, and
1065 # build the catalogue with awk(1).
1066
1067 .sh.po .ksh.po:
1068 $(SED) -n -e ":a" \
1069 -e "h" \
1070 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
1071 -e "x" \
1072 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
1073 -e "t a" \
1074 $< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
1075
1076 #
1077 # Python and Perl executable and message catalog build rules.
1078 #
1079 .SUFFIXES: .pl .pm .py .pyc
1080
1081 .pl:
1082 $(RM) $@;
1083 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
1084 $(CHMOD) +x $@
1085
1086 .py:
1087 $(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@
1088
1089 .py.pyc:
1090 $(RM) $@
1091 $(PYTHON) -mpy_compile $<
1092 @[ $(<)c = $@ ] || $(MV) $(<)c $@
1093
1094 .py.po:
1095 $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $(<F:%.py=%) $< ;
1096
1097 .pl.po .pm.po:
1098 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
1099 $(RM) $@ ;
1100 $(SED) "/^domain/d" < $(<F).po > $@ ;
1101 $(RM) $(<F).po
1102
1103 #
1104 # When using xgettext, we want messages to go to the default domain,
1105 # rather than the specified one. This special version of the
1106 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
1107 # causing xgettext to put all messages into the default domain.
1108 #
1109 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
1110
1111 .c.i:
1112 $(CPPFORPO) $< > $@
1113
1114 .h.i:
1115 $(CPPFORPO) $< > $@
1116
1117 .y.i:
1118 $(YACC) -d $<
1119 $(CPPFORPO) y.tab.c > $@
1120 $(RM) y.tab.c
1121
1122 .l.i:
1123 $(LEX) $<
1124 $(CPPFORPO) lex.yy.c > $@
1125 $(RM) lex.yy.c
1126
1127 .c.po:
1128 $(CPPFORPO) $< > $<.i
1129 $(BUILD.po)
1130
1131 .y.po:
1132 $(YACC) -d $<
1133 $(CPPFORPO) y.tab.c > $<.i
1134 $(BUILD.po)
1135 $(RM) y.tab.c
1136
1137 .l.po:
1138 $(LEX) $<
1139 $(CPPFORPO) lex.yy.c > $<.i
1140 $(BUILD.po)
1141 $(RM) lex.yy.c
1142
1143 #
1144 # Rules to perform stylistic checks
1145 #
1146 .SUFFIXES: .x .xml .check .xmlchk
1147
1148 .h.check:
1149 $(DOT_H_CHECK)
1150
1151 .x.check:
1152 $(DOT_X_CHECK)
1153
1154 .xml.xmlchk:
1155 $(MANIFEST_CHECK)
1156
1157 #
1158 # Include rules to render automated sccs get rules "safe".
1159 #
1160 include $(SRC)/Makefile.noget