xref: /illumos-gate/usr/src/cmd/fm/dicts/Makefile (revision 8d2b0ea9d2a9f0e441345ec63219b0f8b91021f8)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26include ../../Makefile.cmd
27
28common_DCNAMES = \
29	DISK \
30	FMD \
31	NXGE \
32	SUNOS \
33	PCI \
34	PCIEX \
35	ZFS \
36	SCA500 \
37	SCA1000 \
38	SENSOR
39
40i386_DCNAMES = \
41	AMD \
42	INTEL \
43	GMCA
44
45sparc_DCNAMES = \
46	SCF \
47	SUN4 \
48	SUN4U \
49	SUN4V
50
51DCNAMES = \
52	$(common_DCNAMES) \
53	$($(MACH)_DCNAMES)
54
55ALLDCNAMES = \
56	$(common_DCNAMES) \
57	$(sparc_DCNAMES) \
58	$(i386_DCNAMES)
59
60DCFILES = $(DCNAMES:%=%.dict)
61POFILES = $(DCNAMES:%=%.po)
62MOFILES = $(DCNAMES:%=%.mo)
63
64ROOTDCDIR = $(ROOTLIB)/fm/dict
65ROOTLCDIR = $(ROOTLIB)/locale/C/LC_MESSAGES
66
67ROOTDCFILES = $(DCNAMES:%=$(ROOTDCDIR)/%.dict)
68ROOTPOFILES = $(DCNAMES:%=$(ROOTLCDIR)/%.po)
69ROOTMOFILES = $(DCNAMES:%=$(ROOTLCDIR)/%.mo)
70ROOTALLPOFILES = $(ALLDCNAMES:%=$(ROOTLCDIR)/%.po)
71
72FILEMODE = 0444
73$(ROOTALLPOFILES) := FILEMODE = 0644
74
75DICTCK = ../scripts/dictck
76DICTCKFLAGS = -b ../scripts/buildcode
77
78all: $(MOFILES)
79
80_msg: $(ROOTALLPOFILES)
81
82$(ROOTDCDIR):
83	$(INS.dir)
84
85$(ROOTLIB)/locale:
86	$(INS.dir)
87
88$(ROOTLIB)/locale/C: $(ROOTLIB)/locale
89	$(INS.dir)
90
91$(ROOTLCDIR): $(ROOTLIB)/locale/C
92	$(INS.dir)
93
94$(ROOTDCDIR)/%: %
95	$(INS.file)
96
97$(ROOTLCDIR)/%: %
98	$(INS.file)
99
100%.mo: %.po
101	msgfmt -s -o $@ $<
102
103lint:
104	@for name in $(DCNAMES); do\
105		$(DICTCK) $(DICTCKFLAGS) $$name.dict $$name.po;\
106	done
107
108clean install_h lint:
109
110clobber:
111	$(RM) $(MOFILES)
112
113install: all $(ROOTDCDIR) $(ROOTLCDIR) \
114	$(ROOTDCFILES) $(ROOTALLPOFILES) $(ROOTMOFILES)
115