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
5d29b2c44Sab# Common Development and Distribution License (the "License").
6d29b2c44Sab# 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#
2237ffaf83SRod Evans# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23d29b2c44Sab# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
25*cf9a187cSAndy Fiddaman# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
26*cf9a187cSAndy Fiddaman#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateall:		$(POFILE)
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateinclude		$(SRC)/cmd/Makefile.targ
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gatecatalog \
337c478bd9Sstevel@tonic-gateinstall:	$(MSGDOMAIN)/$(POFILE)
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gate$(MSGDOMAIN)/$(POFILE): \
367c478bd9Sstevel@tonic-gate		$(MSGDOMAIN) $(POFILE)
377c478bd9Sstevel@tonic-gate		$(RM) $(MSGDOMAIN)/$(POFILE)
387c478bd9Sstevel@tonic-gate		cp $(POFILE) $(MSGDOMAIN)
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateclean:
417c478bd9Sstevel@tonic-gate		$(RM) $(CLEANFILES)
427c478bd9Sstevel@tonic-gate
43d29b2c44Sab# The elfedit modules message files need a special rule that runs
44d29b2c44Sab# the elfedit catalog target. It generates module messages files
45d29b2c44Sab# as part of that process.
46d29b2c44Sab$(POFILES_ELFEDIT_MODULES) :
47d29b2c44Sab		@ cd ../../elfedit; pwd; $(MAKE) catalog
48d29b2c44Sab
49d29b2c44Sab$(POFILE):	$(POFILES) $(POFILES_ELFEDIT_MODULES)
507c478bd9Sstevel@tonic-gate		$(RM) $(POFILE)
51d29b2c44Sab		cat $(POFILES) $(POFILES_ELFEDIT_MODULES) > $(POFILE)
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate# Install a local version of the message catalog.  Test using: LANG=piglatin
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gatetest:		$(MSGDIR)/$(TEST_MOFILE)
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gate$(MSGDIR)/$(TEST_MOFILE): \
597c478bd9Sstevel@tonic-gate		$(MSGDIR) $(TEST_MSGID) $(TEST_MSGSTR)
607c478bd9Sstevel@tonic-gate		$(RM) $(MSGDIR)/$(TEXT_DOMAIN).mo
6137ffaf83SRod Evans		sort -n $(TEST_MSGID) $(TEST_MSGSTR) | \
627c478bd9Sstevel@tonic-gate			sed -e "s/ *[0-9]*	//" > $(TEST_POFILE)
637c478bd9Sstevel@tonic-gate		$(MSGFMT) -o $(MSGDIR)/$(TEST_MOFILE) $(TEST_POFILE)
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gate$(TEST_MSGID):	$(POFILE)
66d29b2c44Sab		grep "^msgid" $(POFILE) | \
67d29b2c44Sab			$(SGSMSG_PIGLATIN_NL) 1 > $(TEST_MSGID)
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gate$(TEST_MSGSTR):	$(POFILE)
707c478bd9Sstevel@tonic-gate		cat $(POFILE) | $(SGSTOOLS)/$(MACH)/piglatin | \
717c478bd9Sstevel@tonic-gate		    grep "^sgidmay" | sed -e "s/^sgidmay/msgstr/" | \
72d29b2c44Sab		    $(SGSMSG_PIGLATIN_NL) 2 > $(TEST_MSGSTR)
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gate$(MSGDIR):
757c478bd9Sstevel@tonic-gate		-@mkdir -p $(MSGDIR)
76