xref: /titanic_41/usr/src/Makefile.master (revision 70818f5837509317d1f5dac4d82d7b5a2d547c29)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24 # Use is subject to license terms.
25 #
26 # ident	"%Z%%M%	%I%	%E% SMI"
27 #
28 
29 #
30 # Makefile.master, global definitions for system source
31 #
32 ROOT=		/proto
33 
34 # Historically, ON builds were always done with root permissions, and the
35 # owner/group information was duplicated in the Makefiles and the packaging
36 # data and kept in sync by manual intervention.  This is no longer true.
37 # The only source of this information is packaging.  The proto area ($ROOT)
38 # does not have definitive onwer/group information, and no Makefile should
39 # attempt to set this.  CH once toggled operations restricted to root.  It
40 # is now just set to `#'.
41 #
42 # At some point in the future, CH, CHOWN, CHGRP, OWNER, and GROUP should all
43 # be stripped completely from the source base.  They are kept for now until
44 # on10-based projects can merge and transition away from them.
45 #
46 # RELEASE_BUILD should be cleared for final release builds. This is completely
47 # independent of CH. NOT_RELEASE_BUILD is exactly what the name implies.
48 #
49 # INTERNAL_RELEASE_BUILD is a subset of RELEASE_BUILD. It mostly controls
50 # identification strings. Enabling RELEASE_BUILD automatically enables
51 # INTERNAL_RELEASE_BUILD.
52 #
53 # EXPORT_RELEASE_BUILD controls whether binaries are built in a form that
54 # can be released for export under a binary license.  It is orthogonal to
55 # the other *RELEASE_BUILD settings.  ("#" means do an export release
56 # build, "" means do a normal build.)
57 #
58 # CLOSED_BUILD controls whether we try to build files under
59 # usr/closed.  ("" means to build closed code, "#" means don't try to
60 # build it.)  Skipping the closed code implies doing an export release
61 # build.
62 #
63 # STRIP_COMMENTS toggles comment section striping. Generally the same setting
64 # as INTERNAL_RELEASE_BUILD.
65 #
66 # __GNUC toggles the building of ON components using gcc and related tools.
67 # Normally set to `#', set it to `' to do gcc build.
68 #
69 # The declaration POUND_SIGN is always '#'. This is needed to get around the
70 # make feature that '#' is always a comment delimiter, even when escaped or
71 # quoted.  The only way of generating this is the :sh macro mechanism.  Note
72 # however that in general :sh macros should be avoided in makefiles that are
73 # widely included into other makefiles, as the resulting shell executions can
74 # cause a noticable slowdown in build times.
75 #
76 POUND_SIGN:sh=				echo \\043
77 CH=					$(POUND_SIGN)
78 
79 NOT_RELEASE_BUILD=
80 INTERNAL_RELEASE_BUILD=			$(POUND_SIGN)
81 RELEASE_BUILD=				$(POUND_SIGN)
82 $(RELEASE_BUILD)NOT_RELEASE_BUILD=	$(POUND_SIGN)
83 $(RELEASE_BUILD)INTERNAL_RELEASE_BUILD=
84 PATCH_BUILD=				$(POUND_SIGN)
85 
86 # If CLOSED_IS_PRESENT is not set, assume the closed tree is present.
87 CLOSED_BUILD_1=	$(CLOSED_IS_PRESENT:yes=)
88 CLOSED_BUILD=	$(CLOSED_BUILD_1:no=$(POUND_SIGN))
89 
90 EXPORT_RELEASE_BUILD=			$(POUND_SIGN)
91 $(CLOSED_BUILD)EXPORT_RELEASE_BUILD=
92 
93 # SPARC_BLD is '#' for an Intel build.
94 # INTEL_BLD is '#' for a Sparc build.
95 SPARC_BLD_1=    $(MACH:i386=$(POUND_SIGN))
96 SPARC_BLD=      $(SPARC_BLD_1:sparc=)
97 INTEL_BLD_1=    $(MACH:sparc=$(POUND_SIGN))
98 INTEL_BLD=      $(INTEL_BLD_1:i386=)
99 
100 STRIP_COMMENTS=	$(INTERNAL_RELEASE_BUILD)
101 
102 # set __GNUC= in the environment to build 32-bit with the gcc compiler.
103 # The default is to use the Sun Studio compiler for all processor types.
104 __GNUC=		$(POUND_SIGN)
105 
106 # set __GNUC64= in the environment to build 64-bit with the gcc compiler.
107 # Inherit the __GNUC value by default, and if that is set to $(POUND_SIGN)
108 # then this means use the Sun Studio compiler.
109 __GNUC64=	$(__GNUC)
110 
111 # set __SSNEXT= in the enviroment to build with the 'next' release of
112 # the Sun Studio compiler. This will cause command line options specific
113 # to the 'next' version of the Sun Studio compiler to be used.
114 __SSNEXT=	$(POUND_SIGN)
115 
116 # CLOSED is the root of the tree that contains source which isn't released
117 # as open source
118 CLOSED=		$(SRC)/../closed
119 
120 # BUILD_TOOLS is the root of all tools including compilers.
121 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
122 
123 BUILD_TOOLS=		/ws/onnv-tools
124 ONBLD_TOOLS=		$(BUILD_TOOLS)/onbld
125 
126 JAVA_ROOT=	/usr/java
127 
128 SFW_ROOT=	/usr/sfw
129 SFWINCDIR=	$(SFW_ROOT)/include
130 SFWLIBDIR=	$(SFW_ROOT)/lib
131 SFWLIBDIR64=	$(SFW_ROOT)/lib/$(MACH64)
132 
133 RPCGEN=		/usr/bin/rpcgen
134 STABS=		$(ONBLD_TOOLS)/bin/$(MACH)/stabs
135 ELFEXTRACT=	$(ONBLD_TOOLS)/bin/$(MACH)/elfextract
136 MBH_PATCH=	$(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch
137 ECHO=		echo
138 INS=		install
139 TRUE=		true
140 SYMLINK=	/usr/bin/ln -s
141 LN=		/usr/bin/ln
142 CHMOD=		/usr/bin/chmod
143 CHOWN=		$(TRUE)
144 CHGRP=		$(TRUE)
145 MV=		/usr/bin/mv -f
146 RM=		/usr/bin/rm -f
147 CUT=		/usr/bin/cut
148 NM=		/usr/ccs/bin/nm
149 DIFF=		/usr/bin/diff
150 GREP=		/usr/bin/grep
151 EGREP=		/usr/bin/egrep
152 KSH93=		/usr/bin/ksh93
153 SED=		/usr/bin/sed
154 NAWK=		/usr/bin/nawk
155 CP=		/usr/bin/cp -f
156 MCS=		/usr/ccs/bin/mcs
157 CAT=            /usr/bin/cat
158 ELFDUMP=	/usr/ccs/bin/elfdump
159 M4=		/usr/ccs/bin/m4
160 STRIP=		/usr/ccs/bin/strip
161 LEX=		/usr/ccs/bin/lex
162 FLEX=		$(SFW_ROOT)/bin/flex
163 YACC=		/usr/ccs/bin/yacc
164 CPP=		/usr/lib/cpp
165 JAVAC=		$(JAVA_ROOT)/bin/javac
166 JAVAH=		$(JAVA_ROOT)/bin/javah
167 JAVADOC=	$(JAVA_ROOT)/bin/javadoc
168 RMIC=		$(JAVA_ROOT)/bin/rmic
169 JAR=		$(JAVA_ROOT)/bin/jar
170 CTFCONVERT=	$(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert
171 CTFMERGE=	$(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge
172 CTFSTABS=	$(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
173 NDRGEN=		$(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
174 GENOFFSETS=	$(ONBLD_TOOLS)/bin/genoffsets
175 CTFCVTPTBL=	$(ONBLD_TOOLS)/bin/ctfcvtptbl
176 CTFFINDMOD=	$(ONBLD_TOOLS)/bin/ctffindmod
177 XREF=		$(ONBLD_TOOLS)/bin/xref
178 FIND=		/usr/bin/find
179 PERL=		/usr/bin/perl
180 SORT=		/usr/bin/sort
181 TOUCH=		/usr/bin/touch
182 WC=		/usr/bin/wc
183 XARGS=		/usr/bin/xargs
184 ELFEDIT=	/usr/bin/elfedit
185 ELFSIGN=	/usr/bin/elfsign
186 DTRACE=		/usr/sbin/dtrace
187 
188 FILEMODE=	644
189 DIRMODE=	755
190 
191 # Note: owner and group for proto area objects is no longer set by
192 # Makefiles at all.  These have no real effect and are kept here for
193 # transition purposes.  They (along with CH, CHOWN, and CHGRP) should be
194 # removed early in the s11 development cycle.
195 OWNER=		root
196 GROUP=		bin
197 
198 #
199 # The version of the patch makeup table optimized for build-time use.  Used
200 # during patch builds only.
201 $(PATCH_BUILD)PMTMO_FILE=$(SRC)/patch_makeup_table.mo
202 
203 # Declare that nothing should be built in parallel.
204 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
205 .NO_PARALLEL:
206 
207 # For stylistic checks
208 #
209 # Note that the X and C checks are not used at this time and may need
210 # modification when they are actually used.
211 #
212 CSTYLE=		cstyle
213 CSTYLE_TAIL=
214 HDRCHK=		hdrchk
215 HDRCHK_TAIL=
216 JSTYLE=		jstyle
217 
218 DOT_H_CHECK=	\
219 	@$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
220 	$(HDRCHK) $< $(HDRCHK_TAIL)
221 
222 DOT_X_CHECK=	\
223 	@$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
224 	$(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
225 
226 DOT_C_CHECK=	\
227 	@$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
228 
229 MANIFEST_CHECK=	\
230 	@$(ECHO) "checking $<"; \
231 	SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
232 	$(SRC)/cmd/svc/svccfg/svccfg-native validate $<
233 
234 INS.file=	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $<
235 INS.dir=	$(INS) -s -d -m $(DIRMODE) $@
236 # installs and renames at once
237 #
238 INS.rename=	$(INS.file); $(MV) $(@D)/$(<F) $@
239 
240 # install a link
241 INSLINKTARGET=	$<
242 INS.link=	$(RM) $@; $(LN) $(INSLINKTARGET) $@
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 # One optimization the compiler might perform is to turn this:
302 #	#pragma weak foo
303 #	extern int foo;
304 #	if (&foo)
305 #		foo = 5;
306 # into
307 #	foo = 5;
308 # Since we do some of this (foo might be referenced in common kernel code
309 # but provided only for some cpu modules or platforms), we disable this
310 # optimization.
311 #
312 sparc_CCUNBOUND	= -Wd,-xsafe=unboundsym
313 i386_CCUNBOUND	=
314 CCUNBOUND	= $($(MACH)_CCUNBOUND)
315 
316 #
317 # compiler '-xarch' flag. This is here to centralize it and make it
318 # overridable for testing.
319 sparc_XARCH=		-xarch=v8
320 sparcv9_XARCH=		-xarch=v9
321 i386_XARCH=
322 amd64_XARCH=		-xarch=amd64 -Ui386 -U__i386
323 
324 # assembler '-xarch' flag.  Different from compiler '-xarch' flag.
325 sparc_AS_XARCH=		-xarch=v8plus
326 sparcv9_AS_XARCH=	-xarch=v9
327 i386_AS_XARCH=
328 amd64_AS_XARCH=		-xarch=amd64 -P -Ui386 -U__i386
329 
330 #
331 # These flags define what we need to be 'standalone' i.e. -not- part
332 # of the rather more cosy userland environment.  This basically means
333 # the kernel.
334 #
335 # XX64	future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
336 #
337 sparc_STAND_FLAGS=	-_gcc=-ffreestanding
338 sparcv9_STAND_FLAGS=	-_gcc=-ffreestanding
339 i386_STAND_FLAGS=	-_gcc=-ffreestanding
340 amd64_STAND_FLAGS=	-Wu,-xmodel=kernel
341 $(__SSNEXT)amd64_STAND_FLAGS=	-xmodel=kernel
342 
343 SAVEARGS=		-Wu,-save_args
344 amd64_STAND_FLAGS	+= $(SAVEARGS)
345 
346 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
347 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
348 
349 #
350 # disable the incremental linker
351 ILDOFF=			-xildoff
352 #
353 XDEPEND=		-xdepend
354 XFFLAG=			-xF=%all
355 XESS=			-xs
356 XSTRCONST=		-xstrconst
357 
358 #
359 # turn warnings into errors (C)
360 CERRWARN = -errtags=yes -errwarn=%all
361 CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
362 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
363 
364 #
365 # turn warnings into errors (C++)
366 CCERRWARN=		-xwe
367 
368 # C99 mode
369 C99_ENABLE=	-xc99=%all
370 C99_DISABLE=	-xc99=%none
371 C99MODE=	$(C99_DISABLE)
372 C99LMODE=	$(C99MODE:-xc99%=-Xc99%)
373 
374 # In most places, assignments to these macros should be appended with +=
375 # (CPPFLAGS.master allows values to be prepended to CPPFLAGS).
376 sparc_CFLAGS=	$(sparc_XARCH) $(CCSTATICSYM)
377 sparcv9_CFLAGS=	$(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
378 		$(CCSTATICSYM)
379 i386_CFLAGS=	$(i386_XARCH)
380 amd64_CFLAGS=	$(amd64_XARCH)
381 
382 sparc_ASFLAGS=	$(sparc_AS_XARCH)
383 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
384 i386_ASFLAGS=	$(i386_AS_XARCH)
385 amd64_ASFLAGS=	$(amd64_AS_XARCH)
386 
387 #
388 sparc_COPTFLAG=		-xO3
389 sparcv9_COPTFLAG=	-xO3
390 i386_COPTFLAG=		-O
391 amd64_COPTFLAG=		-xO3
392 
393 COPTFLAG= $($(MACH)_COPTFLAG)
394 COPTFLAG64= $($(MACH64)_COPTFLAG)
395 
396 # When -g is used, the compiler globalizes static objects
397 # (gives them a unique prefix). Disable that.
398 CNOGLOBAL= -W0,-noglobal
399 
400 # Direct the Sun Studio compiler to use a static globalization prefix based on the
401 # name of the module rather than something unique. Otherwise, objects
402 # will not build deterministically, as subsequent compilations of identical
403 # source will yeild objects that always look different.
404 #
405 # In the same spirit, this will also remove the date from the N_OPT stab.
406 CGLOBALSTATIC= -W0,-xglobalstatic
407 
408 # Normally, gcc uses indirect DWARF strings to save space.  However,
409 # this causes relocations that ctfconvert cannot handle.  Disable this.
410 CDWARFSTR=	-_gcc=-fno-dwarf2-indirect-strings
411 
412 # Sometimes we want all symbols and types in debugging information even
413 # if they aren't used.
414 CALLSYMS=	-W0,-xdbggen=no%usedonly
415 
416 #
417 # Default debug format for Sun Studio 11 is dwarf, so force it to
418 # generate stabs.
419 #
420 DEBUGFORMAT=	-xdebugformat=stabs
421 
422 #
423 # Flags used to build in debug mode for ctf generation.  Bugs in the Devpro
424 # compilers currently prevent us from building with cc-emitted DWARF.
425 #
426 CTF_FLAGS_sparc	= -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
427 CTF_FLAGS_i386	= -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
428 CTF_FLAGS	= $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
429 
430 #
431 # Flags used with genoffsets
432 #
433 GOFLAGS = -_noecho \
434 	$(CALLSYMS) \
435 	$(CDWARFSTR)
436 
437 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
438 	$(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
439 
440 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
441 	$(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
442 
443 #
444 # tradeoff time for space (smaller is better)
445 #
446 sparc_SPACEFLAG		= -xspace -W0,-Lt
447 sparcv9_SPACEFLAG	= -xspace -W0,-Lt
448 i386_SPACEFLAG		= -xspace
449 amd64_SPACEFLAG		=
450 
451 SPACEFLAG		= $($(MACH)_SPACEFLAG)
452 SPACEFLAG64		= $($(MACH64)_SPACEFLAG)
453 
454 #
455 # The Sun Studio 11 compiler has changed the behaviour of integer
456 # wrap arounds and so a flag is needed to use the legacy behaviour
457 # (without this flag panics/hangs could be exposed within the source).
458 #
459 sparc_IROPTFLAG		= -W2,-xwrap_int
460 sparcv9_IROPTFLAG	= -W2,-xwrap_int
461 i386_IROPTFLAG		=
462 amd64_IROPTFLAG		=
463 
464 IROPTFLAG		= $($(MACH)_IROPTFLAG)
465 IROPTFLAG64		= $($(MACH64)_IROPTFLAG)
466 
467 sparc_XREGSFLAG		= -xregs=no%appl
468 sparcv9_XREGSFLAG	= -xregs=no%appl
469 i386_XREGSFLAG		=
470 amd64_XREGSFLAG		=
471 
472 XREGSFLAG		= $($(MACH)_XREGSFLAG)
473 XREGSFLAG64		= $($(MACH64)_XREGSFLAG)
474 
475 CFLAGS=         $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
476 		$(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG) \
477 		$(CGLOBALSTATIC)
478 CFLAGS64=       $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
479 		$(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG64) \
480 		$(CGLOBALSTATIC)
481 #
482 # Flags that are used to build parts of the code that are subsequently
483 # run on the build machine (also known as the NATIVE_BUILD).
484 #
485 NATIVE_CFLAGS=	$(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
486 		$(ILDOFF) $(CERRWARN) $(C99MODE) $($(NATIVE_MACH)_CCUNBOUND) \
487 		$(IROPTFLAG) $(CGLOBALSTATIC)
488 
489 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\"	# For messaging.
490 DTS_ERRNO=-D_TS_ERRNO
491 CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \
492 	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
493 CPPFLAGS=	$(CPPFLAGS.master)
494 AS_CPPFLAGS=	$(CPPFLAGS.master)
495 JAVAFLAGS=	-deprecation
496 
497 #
498 # For source message catalogue
499 #
500 .SUFFIXES: $(SUFFIXES) .i .po
501 MSGROOT= $(ROOT)/catalog
502 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
503 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
504 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
505 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
506 
507 CLOBBERFILES += $(POFILE) $(POFILES)
508 COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS)
509 XGETTEXT= /usr/bin/xgettext
510 XGETFLAGS= -c TRANSLATION_NOTE
511 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
512 	$(RM)	$@ ;\
513 	$(SED) "/^domain/d" < $(<F).po > $@ ;\
514 	$(RM) $(<F).po $<.i
515 
516 #
517 # This is overwritten by local Makefile when PROG is a list.
518 #
519 POFILE= $(PROG).po
520 
521 sparc_CCFLAGS=		-cg92 -compat=4 \
522 			-Qoption ccfe -messages=no%anachronism \
523 			$(CCERRWARN)
524 sparcv9_CCFLAGS=	$(sparcv9_XARCH) -dalign -compat=5 \
525 			-Qoption ccfe -messages=no%anachronism \
526 			-Qoption ccfe -features=no%conststrings \
527 			$(CCCREGSYM) \
528 			$(CCERRWARN)
529 i386_CCFLAGS=		-compat=4 \
530 			-Qoption ccfe -messages=no%anachronism \
531 			-Qoption ccfe -features=no%conststrings \
532 			$(CCERRWARN)
533 amd64_CCFLAGS=		$(amd64_XARCH) -compat=5 \
534 			-Qoption ccfe -messages=no%anachronism \
535 			-Qoption ccfe -features=no%conststrings \
536 			$(CCERRWARN)
537 
538 sparc_CCOPTFLAG=	-O
539 sparcv9_CCOPTFLAG=	-O
540 i386_CCOPTFLAG=		-O
541 amd64_CCOPTFLAG=	-O
542 
543 CCOPTFLAG=	$($(MACH)_CCOPTFLAG)
544 CCOPTFLAG64=	$($(MACH64)_CCOPTFLAG)
545 CCFLAGS=	$(CCOPTFLAG) $($(MACH)_CCFLAGS)
546 CCFLAGS64=	$(CCOPTFLAG64) $($(MACH64)_CCFLAGS)
547 
548 #
549 # Various mapfiles that are used throughout the build, and delivered to
550 # /usr/lib/ld.
551 #
552 MAPFILE.NED_i386 =	$(SRC)/common/mapfiles/i386/map.noexdata
553 MAPFILE.NED_sparc =
554 MAPFILE.NED =		$(MAPFILE.NED_$(MACH))
555 MAPFILE.PGA =		$(SRC)/common/mapfiles/$(MACH)/map.pagealign
556 MAPFILE.NES =		$(SRC)/common/mapfiles/common/map.noexstk
557 MAPFILE.FLT =		$(SRC)/common/mapfiles/common/map.filter
558 MAPFILE.LEX =		$(SRC)/common/mapfiles/common/map.lex.yy
559 
560 #
561 # Generated mapfiles that are compiler specific, and used throughout the
562 # build.  These mapfiles are not delivered in /usr/lib/ld.
563 #
564 MAPFILE.NGB_sparc=	$(SRC)/common/mapfiles/gen/sparc_cc_map.noexeglobs
565 $(__GNUC64)MAPFILE.NGB_sparc= \
566 			$(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
567 MAPFILE.NGB_sparcv9=	$(SRC)/common/mapfiles/gen/sparcv9_cc_map.noexeglobs
568 $(__GNUC64)MAPFILE.NGB_sparcv9= \
569 			$(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
570 MAPFILE.NGB_i386=	$(SRC)/common/mapfiles/gen/i386_cc_map.noexeglobs
571 $(__GNUC64)MAPFILE.NGB_i386= \
572 			$(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
573 MAPFILE.NGB_amd64=	$(SRC)/common/mapfiles/gen/amd64_cc_map.noexeglobs
574 $(__GNUC64)MAPFILE.NGB_amd64= \
575 			$(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
576 MAPFILE.NGB =		$(MAPFILE.NGB_$(MACH))
577 
578 #
579 # A generic interface mapfile name, used by various dynamic objects to define
580 # the interfaces and interposers the object must export.
581 #
582 MAPFILE.INT =		mapfile-intf
583 
584 #
585 # LDLIBS32 can be set in the environment to override the following assignment.
586 # LDLIBS64 can be set to override the assignment made in Makefile.master.64.
587 # These environment settings make sure that no libraries are searched outside
588 # of the local workspace proto area:
589 #	LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
590 #	LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
591 #
592 LDLIBS32 =	$(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
593 LDLIBS.cmd = 	$(LDLIBS32)
594 LDLIBS.lib =	$(LDLIBS32)
595 #
596 # Define compilation macros.
597 #
598 COMPILE.c=	$(CC) $(CFLAGS) $(CPPFLAGS) -c
599 COMPILE64.c=	$(CC) $(CFLAGS64) $(CPPFLAGS) -c
600 COMPILE.cc=	$(CCC) $(CCFLAGS) $(CPPFLAGS) -c
601 COMPILE64.cc=	$(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
602 COMPILE.s=	$(AS) $(ASFLAGS) $(AS_CPPFLAGS)
603 COMPILE64.s=	$(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
604 COMPILE.d=	$(DTRACE) -G -32
605 COMPILE64.d=	$(DTRACE) -G -64
606 
607 CLASSPATH=	.
608 COMPILE.java=	$(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH)
609 
610 #
611 # Link time macros
612 #
613 CCNEEDED		= -lC
614 $(__GNUC)CCNEEDED	= -L$(SFWLIBDIR) -R$(SFWLIBDIR) -lstdc++ -lgcc_s
615 
616 LINK.c=		$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
617 LINK64.c=	$(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
618 NORUNPATH=	-norunpath -nolib
619 LINK.cc=	$(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
620 		$(LDFLAGS) $(CCNEEDED)
621 LINK64.cc=	$(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
622 		$(LDFLAGS) $(CCNEEDED)
623 
624 #
625 # lint macros
626 #
627 # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once
628 # ON is built with a version of lint that has the fix for 4484186.
629 #
630 ALWAYS_LINT_DEFS =	-errtags=yes -s
631 ALWAYS_LINT_DEFS +=	-erroff=E_PTRDIFF_OVERFLOW
632 ALWAYS_LINT_DEFS +=	-erroff=E_ASSIGN_NARROW_CONV
633 ALWAYS_LINT_DEFS +=	-U__PRAGMA_REDEFINE_EXTNAME
634 ALWAYS_LINT_DEFS +=	$(C99LMODE)
635 ALWAYS_LINT_DEFS +=	-errsecurity=$(SECLEVEL)
636 ALWAYS_LINT_DEFS +=	-erroff=E_SEC_CREAT_WITHOUT_EXCL
637 ALWAYS_LINT_DEFS +=	-erroff=E_SEC_FORBIDDEN_WARN_CREAT
638 # XX64 -- really only needed for amd64 lint
639 ALWAYS_LINT_DEFS +=	-erroff=E_ASSIGN_INT_TO_SMALL_INT
640 ALWAYS_LINT_DEFS +=	-erroff=E_CAST_INT_CONST_TO_SMALL_INT
641 ALWAYS_LINT_DEFS +=	-erroff=E_CAST_INT_TO_SMALL_INT
642 ALWAYS_LINT_DEFS +=	-erroff=E_CAST_TO_PTR_FROM_INT
643 ALWAYS_LINT_DEFS +=	-erroff=E_COMP_INT_WITH_LARGE_INT
644 ALWAYS_LINT_DEFS +=	-erroff=E_INTEGRAL_CONST_EXP_EXPECTED
645 ALWAYS_LINT_DEFS +=	-erroff=E_PASS_INT_TO_SMALL_INT
646 ALWAYS_LINT_DEFS +=	-erroff=E_PTR_CONV_LOSES_BITS
647 
648 SECLEVEL=	core
649 LINT.c=		$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(ALWAYS_LINT_DEFS)
650 LINT64.c=	$(LINT) $(LINTFLAGS64) $(CPPFLAGS) $(ALWAYS_LINT_DEFS)
651 LINT.s=		$(LINT.c)
652 
653 # For some future builds, NATIVE_MACH and MACH might be different.
654 # Therefore, NATIVE_MACH needs to be redefined in the
655 # environment as `uname -p` to override this macro.
656 #
657 # For now at least, we cross-compile amd64 on i386 machines.
658 NATIVE_MACH=	$(MACH:amd64=i386)
659 
660 # Define native compilation macros
661 #
662 
663 # Base directory where compilers are loaded.
664 # Defined here so it can be overridden by developer.
665 #
666 SPRO_ROOT=		$(BUILD_TOOLS)/SUNWspro
667 SPRO_VROOT=		$(SPRO_ROOT)/SS11
668 GNU_ROOT=		$(SFW_ROOT)
669 
670 # Specify platform compiler versions for languages
671 # that we use (currently only c and c++).
672 #
673 sparc_CC=		$(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
674 $(__GNUC)sparc_CC=	$(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
675 sparc_CCC=		$(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
676 $(__GNUC)sparc_CCC=	$(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
677 sparc_CPP=		/usr/ccs/lib/cpp
678 sparc_AS=		/usr/ccs/bin/as -xregsym=no
679 sparc_LD=		/usr/ccs/bin/ld
680 sparc_LINT=		$(SPRO_VROOT)/bin/lint
681 
682 sparcv9_CC=		$(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
683 $(__GNUC64)sparcv9_CC=	$(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
684 sparcv9_CCC=		$(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
685 $(__GNUC64)sparcv9_CCC=	$(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
686 sparcv9_CPP=		/usr/ccs/lib/cpp
687 sparcv9_AS=		/usr/ccs/bin/as -xregsym=no
688 sparcv9_LD=		/usr/ccs/bin/ld
689 sparcv9_LINT=		$(SPRO_VROOT)/bin/lint
690 
691 # We compile 32-bit objects with cc by default
692 i386_CC=		$(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
693 $(__GNUC)i386_CC=	$(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
694 i386_CCC=		$(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
695 $(__GNUC)i386_CCC=	$(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
696 i386_CPP=		/usr/ccs/lib/cpp
697 i386_AS=		/usr/ccs/bin/as
698 $(__GNUC)i386_AS=	$(ONBLD_TOOLS)/bin/$(MACH)/aw
699 i386_LD=		/usr/ccs/bin/ld
700 i386_LINT=		$(SPRO_VROOT)/bin/lint
701 
702 # We compile 64-bit objects with gcc
703 amd64_CC=		$(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
704 $(__GNUC64)amd64_CC=	$(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
705 amd64_CCC=		$(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
706 $(__GNUC64)amd64_CCC=	$(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
707 amd64_CPP=		/usr/ccs/lib/cpp
708 amd64_AS=		$(ONBLD_TOOLS)/bin/$(MACH)/aw
709 amd64_LD=		/usr/ccs/bin/ld
710 amd64_LINT=		$(SPRO_VROOT)/bin/lint
711 
712 NATIVECC=		$($(NATIVE_MACH)_CC)
713 NATIVECCC=		$($(NATIVE_MACH)_CCC)
714 NATIVECPP=		$($(NATIVE_MACH)_CPP)
715 NATIVEAS=		$($(NATIVE_MACH)_AS)
716 NATIVELD=		$($(NATIVE_MACH)_LD)
717 NATIVELINT=		$($(NATIVE_MACH)_LINT)
718 
719 #
720 # Makefile.master.64 overrides these settings
721 #
722 CC=			$(NATIVECC)
723 CCC=			$(NATIVECCC)
724 CPP=			$(NATIVECPP)
725 AS=			$(NATIVEAS)
726 LD=			$(NATIVELD)
727 LINT=			$(NATIVELINT)
728 
729 # The real compilers used for this build
730 CW_CC_CMD=		$(CC) -_compiler
731 CW_CCC_CMD=		$(CCC) -_compiler
732 REAL_CC=		$(CW_CC_CMD:sh)
733 REAL_CCC=		$(CW_CCC_CMD:sh)
734 
735 # Pass -Y flag to cpp (method of which is release-dependent)
736 CCYFLAG=		-Y I,
737 
738 BDIRECT=	-Bdirect
739 BDYNAMIC=	-Bdynamic
740 BLOCAL=		-Blocal
741 BNODIRECT=	-Bnodirect
742 BREDUCE=	-Breduce
743 BSTATIC=	-Bstatic
744 
745 ZDEFS=		-zdefs
746 ZDIRECT=	-zdirect
747 ZIGNORE=	-zignore
748 ZINITFIRST=	-zinitfirst
749 ZINTERPOSE=	-zinterpose
750 ZLAZYLOAD=	-zlazyload
751 ZLOADFLTR=	-zloadfltr
752 ZMULDEFS=	-zmuldefs
753 ZNODEFAULTLIB=	-znodefaultlib
754 ZNODEFS=	-znodefs
755 ZNODELETE=	-znodelete
756 ZNODLOPEN=	-znodlopen
757 ZNODUMP=	-znodump
758 ZNOLAZYLOAD=	-znolazyload
759 ZNORELOC=	-znoreloc
760 ZNOVERSION=	-znoversion
761 ZRECORD=	-zrecord
762 ZREDLOCSYM=	-zredlocsym
763 ZTEXT=		-ztext
764 ZVERBOSE=	-zverbose
765 
766 GSHARED=	-G
767 CCMT=		-mt
768 
769 # Handle different PIC models on different ISAs
770 # (May be overridden by lower-level Makefiles)
771 
772 sparc_C_PICFLAGS =	-K pic
773 sparcv9_C_PICFLAGS =	-K pic
774 i386_C_PICFLAGS =	-K pic
775 amd64_C_PICFLAGS =	-K pic
776 C_PICFLAGS =		$($(MACH)_C_PICFLAGS)
777 C_PICFLAGS64 =		$($(MACH64)_C_PICFLAGS)
778 
779 sparc_C_BIGPICFLAGS =	-K PIC
780 sparcv9_C_BIGPICFLAGS =	-K PIC
781 i386_C_BIGPICFLAGS =	-K PIC
782 amd64_C_BIGPICFLAGS =	-K PIC
783 C_BIGPICFLAGS =		$($(MACH)_C_BIGPICFLAGS)
784 C_BIGPICFLAGS64 =	$($(MACH64)_C_BIGPICFLAGS)
785 
786 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
787 sparc_CC_PICFLAGS =	-Kpic
788 sparcv9_CC_PICFLAGS =	-KPIC
789 i386_CC_PICFLAGS = 	-Kpic
790 amd64_CC_PICFLAGS = 	-Kpic
791 CC_PICFLAGS =		$($(MACH)_CC_PICFLAGS)
792 CC_PICFLAGS64 =		$($(MACH64)_CC_PICFLAGS)
793 
794 AS_PICFLAGS=		$(C_PICFLAGS)
795 AS_BIGPICFLAGS=		$(C_BIGPICFLAGS)
796 
797 #
798 # Default label for CTF sections
799 #
800 CTFCVTFLAGS=		-i -L VERSION
801 
802 #
803 # Override to pass module-specific flags to ctfmerge.  Currently used
804 # only by krtld to turn on fuzzy matching.
805 #
806 CTFMRGFLAGS=
807 
808 CTFCONVERT_O		= $(CTFCONVERT) $(CTFCVTFLAGS) $@
809 
810 ELFSIGN_O=	$(TRUE)
811 ELFSIGN_CRYPTO=	$(ELFSIGN_O)
812 ELFSIGN_OBJECT=	$(ELFSIGN_O)
813 ELFSIGN_CRYPTO_LIMITED=	$(ELFSIGN_O)
814 $(EXPORT_RELEASE_BUILD)ELFSIGN_O =	$(ELFSIGN)
815 $(EXPORT_RELEASE_BUILD)ELFSIGN_CFNAME =	SUNWosnetCF
816 $(EXPORT_RELEASE_BUILD)ELFSIGN_KEY =	\
817 			$(CLOSED)/cmd/cmd-crypto/etc/keys/$(ELFSIGN_CFNAME)
818 $(EXPORT_RELEASE_BUILD)ELFSIGN_CERT=	\
819 			$(CLOSED)/cmd/cmd-crypto/etc/certs/$(ELFSIGN_CFNAME)
820 $(EXPORT_RELEASE_BUILD)ELFSIGN_CLNAME =	SUNWosnetCFLimited
821 $(EXPORT_RELEASE_BUILD)ELFSIGN_KEY_LIMITED =	\
822 			$(CLOSED)/cmd/cmd-crypto/etc/keys/$(ELFSIGN_CLNAME)
823 $(EXPORT_RELEASE_BUILD)ELFSIGN_CERT_LIMITED=	\
824 			$(CLOSED)/cmd/cmd-crypto/etc/certs/$(ELFSIGN_CLNAME)
825 $(EXPORT_RELEASE_BUILD)ELFSIGN_SENAME =	SUNWosnetSE
826 $(EXPORT_RELEASE_BUILD)ELFSIGN_SEKEY =	\
827 			$(CLOSED)/cmd/cmd-crypto/etc/keys/$(ELFSIGN_SENAME)
828 $(EXPORT_RELEASE_BUILD)ELFSIGN_SECERT=	\
829 			$(CLOSED)/cmd/cmd-crypto/etc/certs/$(ELFSIGN_SENAME)
830 $(EXPORT_RELEASE_BUILD)ELFSIGN_CRYPTO=	$(ELFSIGN_O) sign \
831 			$(ELFSIGN_FORMAT_OPTION) \
832 			-k $(ELFSIGN_KEY) -c $(ELFSIGN_CERT) -e $@
833 $(EXPORT_RELEASE_BUILD)ELFSIGN_CRYPTO_LIMITED=	$(ELFSIGN_O) sign \
834 			$(ELFSIGN_FORMAT_OPTION) \
835 			-k $(ELFSIGN_KEY_LIMITED) -c $(ELFSIGN_CERT_LIMITED) \
836 			-e $@
837 $(EXPORT_RELEASE_BUILD)ELFSIGN_OBJECT=	$(ELFSIGN_O) sign \
838 			$(ELFSIGN_FORMAT_OPTION) \
839 			-k $(ELFSIGN_SEKEY) -c $(ELFSIGN_SECERT) -e $@
840 
841 # Rules (normally from make.rules) and macros which are used for post
842 # processing files. Normally, these do stripping of the comment section
843 # automatically.
844 #    RELEASE_CM:	Should be editted to reflect the release.
845 #    POST_PROCESS_O:	Post-processing for `.o' files.
846 #    POST_PROCESS_A:	Post-processing for `.a' files (currently null).
847 #    POST_PROCESS_SO:	Post-processing for `.so' files.
848 #    POST_PROCESS:	Post-processing for executable files (no suffix).
849 # Note that these macros are not completely generalized as they are to be
850 # used with the file name to be processed following.
851 #
852 # It is left as an exercise to Release Engineering to embellish the generation
853 # of the release comment string.
854 #
855 #	If this is a standard development build:
856 #		compress the comment section (mcs -c)
857 #		add the standard comment (mcs -a $(RELEASE_CM))
858 #		add the development specific comment (mcs -a $(DEV_CM))
859 #
860 #	If this is an installation build:
861 #		delete the comment section (mcs -d)
862 #		add the standard comment (mcs -a $(RELEASE_CM))
863 #		add the development specific comment (mcs -a $(DEV_CM))
864 #
865 #	If this is an release build:
866 #		delete the comment section (mcs -d)
867 #		add the standard comment (mcs -a $(RELEASE_CM))
868 #
869 #	The ONVERS macro sets the default value for the VERSION string
870 #	within pkginfo.
871 #
872 # The following list of macros are used in the definition of RELEASE_CM
873 # which is used to label all binaries in the build:
874 #
875 # 	RELEASE		Specific release of the build, eg: 5.2
876 #	RELEASE_MAJOR	Major version number part of $(RELEASE)
877 #	RELEASE_MINOR	Minor version number part of $(RELEASE)
878 #	VERSION		Version of the build (alpha, beta, Generic)
879 #	PATCHID		If this is a patch this value should contain
880 #			the patchid value (eg: "Generic 100832-01"), otherwise
881 #			it will be set to $(VERSION)
882 #	RELEASE_DATE	Date of the Release Build
883 #	PATCH_DATE	Date the patch was created, if this is blank it
884 #			will default to the RELEASE_DATE
885 #
886 ONVERS=		"11.11"
887 RELEASE_MAJOR=	5
888 RELEASE_MINOR=	11
889 RELEASE=	$(RELEASE_MAJOR).$(RELEASE_MINOR)
890 VERSION=	SunOS Development
891 PATCHID=	$(VERSION)
892 RELEASE_DATE=	October 2007
893 PATCH_DATE=	$(RELEASE_DATE)
894 RELEASE_CM=	"@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
895 DEV_CM=		"@($(POUND_SIGN))SunOS Internal Development: \
896 `$(ECHO) $$LOGNAME` `date +%Y-%m-%d` `$(ECHO) [\`basename $$CODEMGR_WS\`]`"
897 
898 PROCESS_COMMENT=		   @?${MCS} -c -a $(RELEASE_CM) -a $(DEV_CM)
899 $(STRIP_COMMENTS)PROCESS_COMMENT=  @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
900 $(RELEASE_BUILD)PROCESS_COMMENT=   @?${MCS} -d -a $(RELEASE_CM)
901 
902 STRIP_STABS=			   :
903 $(RELEASE_BUILD)STRIP_STABS=	   $(STRIP) -x $@
904 
905 POST_PROCESS_O=		$(PROCESS_COMMENT) $@
906 POST_PROCESS_A=
907 POST_PROCESS_SO=	$(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
908 			$(ELFSIGN_OBJECT)
909 POST_PROCESS=		$(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
910 			$(ELFSIGN_OBJECT)
911 
912 #
913 # The PKGDEFS macro points to the source directory containing the majority
914 # of ON's package definitions plus Makefiles with general package creation
915 # rules.
916 #
917 # PKGARCHIVE specifies the default location where packages should be
918 # placed if built.
919 #
920 PKGDEFS=$(SRC)/pkgdefs
921 $(RELEASE_BUILD)PKGARCHIVESUFFIX=	-nd
922 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
923 
924 #	Default build rules which perform comment section post-processing.
925 #
926 .c:
927 	$(LINK.c) -o $@ $< $(LDLIBS)
928 	$(POST_PROCESS)
929 .c.o:
930 	$(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
931 	$(POST_PROCESS_O)
932 .c.a:
933 	$(COMPILE.c) -o $% $<
934 	$(PROCESS_COMMENT) $%
935 	$(AR) $(ARFLAGS) $@ $%
936 	$(RM) $%
937 .s.o:
938 	$(COMPILE.s) -o $@ $<
939 	$(POST_PROCESS_O)
940 .s.a:
941 	$(COMPILE.s) -o $% $<
942 	$(PROCESS_COMMENT) $%
943 	$(AR) $(ARFLAGS) $@ $%
944 	$(RM) $%
945 .cc:
946 	$(LINK.cc) -o $@ $< $(LDLIBS)
947 	$(POST_PROCESS)
948 .cc.o:
949 	$(COMPILE.cc) $(OUTPUT_OPTION) $<
950 	$(POST_PROCESS_O)
951 .cc.a:
952 	$(COMPILE.cc) -o $% $<
953 	$(AR) $(ARFLAGS) $@ $%
954 	$(PROCESS_COMMENT) $%
955 	$(RM) $%
956 .y:
957 	$(YACC.y) $<
958 	$(LINK.c) -o $@ y.tab.c $(LDLIBS)
959 	$(POST_PROCESS)
960 	$(RM) y.tab.c
961 .y.o:
962 	$(YACC.y) $<
963 	$(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
964 	$(POST_PROCESS_O)
965 	$(RM) y.tab.c
966 .l:
967 	$(RM) $*.c
968 	$(LEX.l) $< > $*.c
969 	$(LINK.c) -o $@ $*.c -ll $(LDLIBS)
970 	$(POST_PROCESS)
971 	$(RM) $*.c
972 .l.o:
973 	$(RM) $*.c
974 	$(LEX.l) $< > $*.c
975 	$(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
976 	$(POST_PROCESS_O)
977 	$(RM) $*.c
978 
979 .java.class:
980 	$(COMPILE.java) $<
981 
982 # Bourne and Korn shell script message catalog build rules.
983 # We extract all gettext strings with sed(1) (being careful to permit
984 # multiple gettext strings on the same line), weed out the dups, and
985 # build the catalogue with awk(1).
986 
987 .sh.po .ksh.po:
988 	$(SED) -n -e ":a" 				\
989 		  -e "h" 					\
990 		  -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p"	\
991 		  -e "x"					\
992 		  -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/"	\
993 		  -e "t a"					\
994 	       $< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
995 
996 #
997 # Python and Perl executable and message catalog build rules.
998 # Note that Python i18n isn't supported by this rule set yet,
999 # as it requires a special build tool (pygettext.py).
1000 #
1001 .SUFFIXES: .pl .pm .py
1002 
1003 .pl:
1004 	$(RM) $@;
1005 	$(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
1006 	$(CHMOD) +x $@
1007 
1008 .py:
1009 	$(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@
1010 
1011 .pl.po .pm.po:
1012 	$(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
1013 	$(RM)	$@ ;
1014 	$(SED) "/^domain/d" < $(<F).po > $@ ;
1015 	$(RM) $(<F).po
1016 
1017 #
1018 # When using xgettext, we want messages to go to the default domain,
1019 # rather than the specified one.  This special version of the
1020 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
1021 # causing xgettext to put all messages into the default domain.
1022 #
1023 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
1024 
1025 .c.i:
1026 	$(CPPFORPO) $< > $@
1027 
1028 .h.i:
1029 	$(CPPFORPO) $< > $@
1030 
1031 .y.i:
1032 	$(YACC) -d $<
1033 	$(CPPFORPO) y.tab.c  > $@
1034 	$(RM) y.tab.c
1035 
1036 .l.i:
1037 	$(LEX) $<
1038 	$(CPPFORPO) lex.yy.c  > $@
1039 	$(RM) lex.yy.c
1040 
1041 .c.po:
1042 	$(CPPFORPO) $< > $<.i
1043 	$(BUILD.po)
1044 
1045 .y.po:
1046 	$(YACC) -d $<
1047 	$(CPPFORPO) y.tab.c  > $<.i
1048 	$(BUILD.po)
1049 	$(RM) y.tab.c
1050 
1051 .l.po:
1052 	$(LEX) $<
1053 	$(CPPFORPO) lex.yy.c  > $<.i
1054 	$(BUILD.po)
1055 	$(RM) lex.yy.c
1056 
1057 #
1058 # Rules to perform stylistic checks
1059 #
1060 .SUFFIXES: .x .xml .check .xmlchk
1061 
1062 .h.check:
1063 	$(DOT_H_CHECK)
1064 
1065 .x.check:
1066 	$(DOT_X_CHECK)
1067 
1068 .xml.xmlchk:
1069 	$(MANIFEST_CHECK)
1070 
1071 #
1072 # Rules to process ONC+ Source partial files
1073 #
1074 %_onc_plus:	%
1075 	@$(ECHO) "extracting code from $< ... "
1076 	sed -n -e '/ONC_PLUS EXTRACT START/,/ONC_PLUS EXTRACT END/p' $<  > $@
1077 
1078 #
1079 # Include rules to render automated sccs get rules "safe".
1080 #
1081 include $(SRC)/Makefile.noget
1082