xref: /illumos-gate/usr/src/cmd/fm/dicts/Makefile (revision 5c0b3261bd16d5eb356ffc864b6eab76c2e760e5)
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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copryight 2022 Garrett D'Amore
24#
25
26include ../../Makefile.cmd
27
28common_DCNAMES = \
29	DISK \
30	FMD \
31	FMNOTIFY \
32	NXGE \
33	SMF \
34	SUNOS \
35	PCI \
36	PCIEX \
37	ZFS \
38	SCA500 \
39	SCA1000 \
40	SENSOR \
41	STORAGE \
42	TEST \
43	NIC
44
45i386_DCNAMES = \
46	AMD \
47	INTEL \
48	GMCA
49
50DCNAMES = \
51	$(common_DCNAMES) \
52	$($(MACH)_DCNAMES)
53
54DCFILES = $(DCNAMES:%=%.dict)
55POFILES = $(DCNAMES:%=%.po)
56MOFILES = $(DCNAMES:%=%.mo)
57
58ROOTDCDIR = $(ROOTLIB)/fm/dict
59ROOTLCDIR = $(ROOTLIB)/locale/C/LC_MESSAGES
60
61ROOTDCFILES = $(DCNAMES:%=$(ROOTDCDIR)/%.dict)
62ROOTPOFILES = $(DCNAMES:%=$(ROOTLCDIR)/%.po)
63ROOTMOFILES = $(DCNAMES:%=$(ROOTLCDIR)/%.mo)
64
65FILEMODE = 0444
66$(ROOTPOFILES) := FILEMODE = 0644
67
68DICTCK = ../scripts/dictck
69DICTCKFLAGS = -b ../scripts/buildcode
70
71all: $(MOFILES)
72
73_msg: $(ROOTPOFILES)
74
75$(ROOTDCDIR):
76	$(INS.dir)
77
78$(ROOTLIB)/locale:
79	$(INS.dir)
80
81$(ROOTLIB)/locale/C: $(ROOTLIB)/locale
82	$(INS.dir)
83
84$(ROOTLCDIR): $(ROOTLIB)/locale/C
85	$(INS.dir)
86
87$(ROOTDCDIR)/%: %
88	$(INS.file)
89
90$(ROOTLCDIR)/%: %
91	$(INS.file)
92
93%.mo: %.po
94	$(MSGFMT) -o $@ $<
95
96lint:
97	@for name in $(DCNAMES); do\
98		$(DICTCK) $(DICTCKFLAGS) $$name.dict $$name.po;\
99	done
100
101clean install_h lint:
102
103clobber:
104	$(RM) $(MOFILES)
105
106install: all $(ROOTDCDIR) $(ROOTLCDIR) \
107	$(ROOTDCFILES) $(ROOTPOFILES) $(ROOTMOFILES)
108