8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / Makefile.astmsg
blob096805e825989aaad05b04d091ca3ff3cc4e7840
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
23 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24 # Use is subject to license terms.
28 # Temporarily control building AST l10n catalogs until all build
29 # machines have been updated.
32 # Should we build AST l10n catalogs ?
33 # This can be overridden at build time via:
34 # $ export ON_BUILD_AST_L10N_CATALOGS=0
35 ON_BUILD_AST_L10N_CATALOGS=1
37 DO_BUILD_AST_CATALOGS_1=        $(ON_BUILD_AST_L10N_CATALOGS:0=$(POUND_SIGN))
38 DONT_BUILD_AST_CATALOGS_1=      $(ON_BUILD_AST_L10N_CATALOGS:1=$(POUND_SIGN))
39 DO_BUILD_AST_CATALOGS=          $(DO_BUILD_AST_CATALOGS_1:1=)
40 DONT_BUILD_AST_CATALOGS=        $(DONT_BUILD_AST_CATALOGS_1:0=)
43 # l10n message catalog generation for AST libraries
46 MSGLIBNAME= $(LIBRARY:.a=)
47 ASTMSGCATALOG= $(ROOT)/usr/lib/locale/C/LC_MESSAGES/$(MSGLIBNAME)
49 $(DO_BUILD_AST_CATALOGS)ASTMSGCC= \
50         PATH="/usr/ast/bin/:/bin:/usr/bin" \
51                 /usr/bin/ksh93 /usr/ast/bin/msgcc >>msgcc.out 2>&1
53 ASTMSGS=  $(OBJECTS:%.o=msgs/%.mso)
55 # cpp defines needed by msgcc
56 i386_ASTMSGCCFLAGS=     -D__i386
57 amd64_ASTMSGCCFLAGS=    -D__amd64
58 sparc_ASTMSGCCFLAGS=    -D__sparc
59 sparcv9_ASTMSGCCFLAGS=  -D__sparcv9
60 ASTMSGCCFLAGS= -D_STDC_C99 -D__STDC__ -D__BUILTIN_VA_ARG_INCR $($(TARGETMACH)_ASTMSGCCFLAGS)
62 msgs/%.mso: ../common/%.c
63         @mkdir -p "$$(dirname "$@")" ; \
64         print "# Processing file $< to $@" >>msgcc.out  ; \
65         $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -c "$<" -o "$@"
66 msgs/%.mso: ../%.c
67         @mkdir -p "$$(dirname "$@")" ; \
68         print "# Processing file $< to $@" >>msgcc.out  ; \
69         $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -c "$<" -o "$@"
71 $(MSGLIBNAME).msg: $(ASTMSGS)
72         @print "# Processing files $(ASTMSGS) to $@" >>msgcc.out ; \
73         $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -o $@ $(ASTMSGS)
75 $(ASTMSGCATALOG): $(MSGLIBNAME).msg
76         @$(RM) "$(ASTMSGCATALOG)" ; \
77         sed 's/^$$translation msgcc .*//' <"$(MSGLIBNAME).msg" | gencat "$@" - ; \
78         $(CHMOD) 0644 $(ASTMSGCATALOG)
80 # Main catalog target
81 $(DO_BUILD_AST_CATALOGS)_msg: $(ASTMSGCATALOG)
83 # Create empty catalog file when we do not build it (to avoid that we have to hack the
84 # package database each time we toggle the switch)
85 $(DONT_BUILD_AST_CATALOGS)_msg:
86 $(DONT_BUILD_AST_CATALOGS)      $(RM) $(ASTMSGCATALOG) ; \
87         $(TOUCH) $(ASTMSGCATALOG) ; \
88         $(CHMOD) 0644 $(ASTMSGCATALOG)
90 # Add message catalogs to the list of files to "clobber"
91 CLOBBERFILES += \
92         $(ASTMSGS) \
93         $(ASTMSGCATALOG) \
94         $(MSGLIBNAME).msg \
95         msgcc.out