xref: /illumos-gate/usr/src/cmd/sgs/messages/Makefile.targ (revision a38ddfee9c8c6b6c5a2947ff52fd2338362a4444)
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#ident	"%Z%%M%	%I%	%E% SMI"
23#
24# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# cmd/sgs/messages/Makefile.targ
28
29all:		$(POFILE)
30
31include		$(SRC)/cmd/Makefile.targ
32
33catalog \
34install:	$(MSGDOMAIN)/$(POFILE)
35
36$(MSGDOMAIN)/$(POFILE): \
37		$(MSGDOMAIN) $(POFILE)
38		$(RM) $(MSGDOMAIN)/$(POFILE)
39		cp $(POFILE) $(MSGDOMAIN)
40
41delete lint:
42
43clean:
44		$(RM) $(CLEANFILES)
45
46# The elfedit modules message files need a special rule that runs
47# the elfedit catalog target. It generates module messages files
48# as part of that process.
49$(POFILES_ELFEDIT_MODULES) :
50		@ cd ../../elfedit; pwd; $(MAKE) catalog
51
52$(POFILE):	$(POFILES) $(POFILES_ELFEDIT_MODULES)
53		$(RM) $(POFILE)
54		cat $(POFILES) $(POFILES_ELFEDIT_MODULES) > $(POFILE)
55
56
57# Install a local version of the message catalog.  Test using: LANG=piglatin
58
59test:		$(MSGDIR)/$(TEST_MOFILE)
60
61$(MSGDIR)/$(TEST_MOFILE): \
62		$(MSGDIR) $(TEST_MSGID) $(TEST_MSGSTR)
63		$(RM) $(MSGDIR)/$(TEXT_DOMAIN).mo
64		sort $(TEST_MSGID) $(TEST_MSGSTR) | \
65			sed -e "s/ *[0-9]*	//" > $(TEST_POFILE)
66		$(MSGFMT) -o $(MSGDIR)/$(TEST_MOFILE) $(TEST_POFILE)
67
68$(TEST_MSGID):	$(POFILE)
69		grep "^msgid" $(POFILE) | \
70			$(SGSMSG_PIGLATIN_NL) 1 > $(TEST_MSGID)
71
72$(TEST_MSGSTR):	$(POFILE)
73		cat $(POFILE) | $(SGSTOOLS)/$(MACH)/piglatin | \
74		    grep "^sgidmay" | sed -e "s/^sgidmay/msgstr/" | \
75		    $(SGSMSG_PIGLATIN_NL) 2 > $(TEST_MSGSTR)
76
77$(MSGDIR):
78		-@mkdir -p $(MSGDIR)
79