xref: /titanic_50/usr/src/cmd/sgs/messages/Makefile.targ (revision 37ffaf8335982d89ab569e9a1020419e32003404)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5d29b2c44Sab196087# Common Development and Distribution License (the "License").
6d29b2c44Sab196087# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22*37ffaf83SRod Evans# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23d29b2c44Sab196087# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# cmd/sgs/messages/Makefile.targ
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateall:		$(POFILE)
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateinclude		$(SRC)/cmd/Makefile.targ
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gatecatalog \
327c478bd9Sstevel@tonic-gateinstall:	$(MSGDOMAIN)/$(POFILE)
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate$(MSGDOMAIN)/$(POFILE): \
357c478bd9Sstevel@tonic-gate		$(MSGDOMAIN) $(POFILE)
367c478bd9Sstevel@tonic-gate		$(RM) $(MSGDOMAIN)/$(POFILE)
377c478bd9Sstevel@tonic-gate		cp $(POFILE) $(MSGDOMAIN)
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gatedelete lint:
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gateclean:
427c478bd9Sstevel@tonic-gate		$(RM) $(CLEANFILES)
437c478bd9Sstevel@tonic-gate
44d29b2c44Sab196087# The elfedit modules message files need a special rule that runs
45d29b2c44Sab196087# the elfedit catalog target. It generates module messages files
46d29b2c44Sab196087# as part of that process.
47d29b2c44Sab196087$(POFILES_ELFEDIT_MODULES) :
48d29b2c44Sab196087		@ cd ../../elfedit; pwd; $(MAKE) catalog
49d29b2c44Sab196087
50d29b2c44Sab196087$(POFILE):	$(POFILES) $(POFILES_ELFEDIT_MODULES)
517c478bd9Sstevel@tonic-gate		$(RM) $(POFILE)
52d29b2c44Sab196087		cat $(POFILES) $(POFILES_ELFEDIT_MODULES) > $(POFILE)
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate
557c478bd9Sstevel@tonic-gate# Install a local version of the message catalog.  Test using: LANG=piglatin
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gatetest:		$(MSGDIR)/$(TEST_MOFILE)
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gate$(MSGDIR)/$(TEST_MOFILE): \
607c478bd9Sstevel@tonic-gate		$(MSGDIR) $(TEST_MSGID) $(TEST_MSGSTR)
617c478bd9Sstevel@tonic-gate		$(RM) $(MSGDIR)/$(TEXT_DOMAIN).mo
62*37ffaf83SRod Evans		sort -n $(TEST_MSGID) $(TEST_MSGSTR) | \
637c478bd9Sstevel@tonic-gate			sed -e "s/ *[0-9]*	//" > $(TEST_POFILE)
647c478bd9Sstevel@tonic-gate		$(MSGFMT) -o $(MSGDIR)/$(TEST_MOFILE) $(TEST_POFILE)
657c478bd9Sstevel@tonic-gate
667c478bd9Sstevel@tonic-gate$(TEST_MSGID):	$(POFILE)
67d29b2c44Sab196087		grep "^msgid" $(POFILE) | \
68d29b2c44Sab196087			$(SGSMSG_PIGLATIN_NL) 1 > $(TEST_MSGID)
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gate$(TEST_MSGSTR):	$(POFILE)
717c478bd9Sstevel@tonic-gate		cat $(POFILE) | $(SGSTOOLS)/$(MACH)/piglatin | \
727c478bd9Sstevel@tonic-gate		    grep "^sgidmay" | sed -e "s/^sgidmay/msgstr/" | \
73d29b2c44Sab196087		    $(SGSMSG_PIGLATIN_NL) 2 > $(TEST_MSGSTR)
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gate$(MSGDIR):
767c478bd9Sstevel@tonic-gate		-@mkdir -p $(MSGDIR)
77