chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 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 | # |
April Chin | 7c2fbfb | 2008-12-27 14:59:38 -0800 | [diff] [blame] | 21 | |
chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 22 | # |
April Chin | 7c2fbfb | 2008-12-27 14:59:38 -0800 | [diff] [blame] | 23 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 24 | # Use is subject to license terms. |
| 25 | # |
chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 26 | |
| 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 Chin | 7c2fbfb | 2008-12-27 14:59:38 -0800 | [diff] [blame] | 34 | # $ export ON_BUILD_AST_L10N_CATALOGS=0 |
| 35 | ON_BUILD_AST_L10N_CATALOGS=1 |
chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 36 | |
| 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=) |
| 41 | |
| 42 | # |
| 43 | # l10n message catalog generation for AST libraries |
| 44 | # |
| 45 | |
| 46 | MSGLIBNAME= $(LIBRARY:.a=) |
| 47 | ASTMSGCATALOG= $(ROOT)/usr/lib/locale/C/LC_MESSAGES/$(MSGLIBNAME) |
| 48 | |
chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 49 | $(DO_BUILD_AST_CATALOGS)ASTMSGCC= \ |
April Chin | 7c2fbfb | 2008-12-27 14:59:38 -0800 | [diff] [blame] | 50 | PATH="/usr/ast/bin/:/bin:/usr/bin" \ |
| 51 | /usr/bin/ksh93 /usr/ast/bin/msgcc >>msgcc.out 2>&1 |
chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 52 | |
| 53 | ASTMSGS= $(OBJECTS:%.o=msgs/%.mso) |
| 54 | |
| 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) |
| 61 | |
| 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 "$@" |
| 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)" ; \ |
chin | fd66f38 | 2007-08-24 11:06:46 -0700 | [diff] [blame] | 77 | sed 's/^$$translation msgcc .*//' <"$(MSGLIBNAME).msg" | gencat "$@" - ; \ |
| 78 | $(CHMOD) 0644 $(ASTMSGCATALOG) |
chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 79 | |
| 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) ; \ |
chin | fd66f38 | 2007-08-24 11:06:46 -0700 | [diff] [blame] | 87 | $(TOUCH) $(ASTMSGCATALOG) ; \ |
| 88 | $(CHMOD) 0644 $(ASTMSGCATALOG) |
chin | da2e3eb | 2007-08-17 12:01:52 -0700 | [diff] [blame] | 89 | |
| 90 | # Add message catalogs to the list of files to "clobber" |
| 91 | CLOBBERFILES += \ |
| 92 | $(ASTMSGS) \ |
| 93 | $(ASTMSGCATALOG) \ |
| 94 | $(MSGLIBNAME).msg \ |
| 95 | msgcc.out |