blob: 096805e825989aaad05b04d091ca3ff3cc4e7840 [file] [log] [blame]
chinda2e3eb2007-08-17 12:01:52 -07001#
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#
April Chin7c2fbfb2008-12-27 14:59:38 -080021
chinda2e3eb2007-08-17 12:01:52 -070022#
April Chin7c2fbfb2008-12-27 14:59:38 -080023# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
chinda2e3eb2007-08-17 12:01:52 -070024# Use is subject to license terms.
25#
chinda2e3eb2007-08-17 12:01:52 -070026
27#
28# Temporarily control building AST l10n catalogs until all build
29# machines have been updated.
30#
31
32# Should we build AST l10n catalogs ?
33# This can be overridden at build time via:
April Chin7c2fbfb2008-12-27 14:59:38 -080034# $ export ON_BUILD_AST_L10N_CATALOGS=0
35ON_BUILD_AST_L10N_CATALOGS=1
chinda2e3eb2007-08-17 12:01:52 -070036
37DO_BUILD_AST_CATALOGS_1= $(ON_BUILD_AST_L10N_CATALOGS:0=$(POUND_SIGN))
38DONT_BUILD_AST_CATALOGS_1= $(ON_BUILD_AST_L10N_CATALOGS:1=$(POUND_SIGN))
39DO_BUILD_AST_CATALOGS= $(DO_BUILD_AST_CATALOGS_1:1=)
40DONT_BUILD_AST_CATALOGS= $(DONT_BUILD_AST_CATALOGS_1:0=)
41
42#
43# l10n message catalog generation for AST libraries
44#
45
46MSGLIBNAME= $(LIBRARY:.a=)
47ASTMSGCATALOG= $(ROOT)/usr/lib/locale/C/LC_MESSAGES/$(MSGLIBNAME)
48
chinda2e3eb2007-08-17 12:01:52 -070049$(DO_BUILD_AST_CATALOGS)ASTMSGCC= \
April Chin7c2fbfb2008-12-27 14:59:38 -080050 PATH="/usr/ast/bin/:/bin:/usr/bin" \
51 /usr/bin/ksh93 /usr/ast/bin/msgcc >>msgcc.out 2>&1
chinda2e3eb2007-08-17 12:01:52 -070052
53ASTMSGS= $(OBJECTS:%.o=msgs/%.mso)
54
55# cpp defines needed by msgcc
56i386_ASTMSGCCFLAGS= -D__i386
57amd64_ASTMSGCCFLAGS= -D__amd64
58sparc_ASTMSGCCFLAGS= -D__sparc
59sparcv9_ASTMSGCCFLAGS= -D__sparcv9
60ASTMSGCCFLAGS= -D_STDC_C99 -D__STDC__ -D__BUILTIN_VA_ARG_INCR $($(TARGETMACH)_ASTMSGCCFLAGS)
61
62msgs/%.mso: ../common/%.c
63 @mkdir -p "$$(dirname "$@")" ; \
64 print "# Processing file $< to $@" >>msgcc.out ; \
65 $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -c "$<" -o "$@"
66msgs/%.mso: ../%.c
67 @mkdir -p "$$(dirname "$@")" ; \
68 print "# Processing file $< to $@" >>msgcc.out ; \
69 $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -c "$<" -o "$@"
70
71$(MSGLIBNAME).msg: $(ASTMSGS)
72 @print "# Processing files $(ASTMSGS) to $@" >>msgcc.out ; \
73 $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -o $@ $(ASTMSGS)
74
75$(ASTMSGCATALOG): $(MSGLIBNAME).msg
76 @$(RM) "$(ASTMSGCATALOG)" ; \
chinfd66f382007-08-24 11:06:46 -070077 sed 's/^$$translation msgcc .*//' <"$(MSGLIBNAME).msg" | gencat "$@" - ; \
78 $(CHMOD) 0644 $(ASTMSGCATALOG)
chinda2e3eb2007-08-17 12:01:52 -070079
80# Main catalog target
81$(DO_BUILD_AST_CATALOGS)_msg: $(ASTMSGCATALOG)
82
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) ; \
chinfd66f382007-08-24 11:06:46 -070087 $(TOUCH) $(ASTMSGCATALOG) ; \
88 $(CHMOD) 0644 $(ASTMSGCATALOG)
chinda2e3eb2007-08-17 12:01:52 -070089
90# Add message catalogs to the list of files to "clobber"
91CLOBBERFILES += \
92 $(ASTMSGS) \
93 $(ASTMSGCATALOG) \
94 $(MSGLIBNAME).msg \
95 msgcc.out