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