xref: /titanic_51/usr/src/cmd/sgs/messages/Makefile.targ (revision fa9e4066f08beec538e775443c5be79dd423fcab)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright (c) 2000 by Sun Microsystems, Inc.
26# All rights reserved.
27#
28# cmd/sgs/messages/Makefile.targ
29
30all:		$(POFILE)
31
32include		$(SRC)/cmd/Makefile.targ
33
34catalog \
35install:	$(MSGDOMAIN)/$(POFILE)
36
37$(MSGDOMAIN)/$(POFILE): \
38		$(MSGDOMAIN) $(POFILE)
39		$(RM) $(MSGDOMAIN)/$(POFILE)
40		cp $(POFILE) $(MSGDOMAIN)
41
42delete lint:
43
44clean:
45		$(RM) $(CLEANFILES)
46
47$(POFILE):	$(POFILES)
48		$(RM) $(POFILE)
49		cat $(POFILES) > $(POFILE)
50
51
52# Install a local version of the message catalog.  Test using: LANG=piglatin
53
54test:		$(MSGDIR)/$(TEST_MOFILE)
55
56$(MSGDIR)/$(TEST_MOFILE): \
57		$(MSGDIR) $(TEST_MSGID) $(TEST_MSGSTR)
58		$(RM) $(MSGDIR)/$(TEXT_DOMAIN).mo
59		sort $(TEST_MSGID) $(TEST_MSGSTR) | \
60			sed -e "s/ *[0-9]*	//" > $(TEST_POFILE)
61		$(MSGFMT) -o $(MSGDIR)/$(TEST_MOFILE) $(TEST_POFILE)
62
63$(TEST_MSGID):	$(POFILE)
64		grep "^msgid" $(POFILE) | nl -v1 -i2 > $(TEST_MSGID)
65
66$(TEST_MSGSTR):	$(POFILE)
67		cat $(POFILE) | $(SGSTOOLS)/$(MACH)/piglatin | \
68		    grep "^sgidmay" | sed -e "s/^sgidmay/msgstr/" | \
69		    nl -v2 -i2 > $(TEST_MSGSTR)
70
71$(MSGDIR):
72		-@mkdir -p $(MSGDIR)
73