xref: /illumos-gate/usr/src/lib/fm/topo/maps/Makefile.map (revision e7afc443cb8c2e0a379fe48b15a0c7fb61a4b2fc)
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#
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright 2020 Joyent, Inc.
27#
28
29.KEEP_STATE:
30.SUFFIXES:
31.SUFFIXES: .xml .xmlgen .xmlgenksh $(SUFFIXES)
32
33MODCLASS = maps
34
35include ../../../Makefile.lib
36include ../../../../Makefile.lib
37
38DTDSRC = $(DTDFILE:%=../common/%)
39DTDTARG = $(DTDFILE:%=%)
40ROOTDTDTARG = $(DTDTARG:%=$(ROOT)/usr/share/lib/xml/dtd/%)
41
42DIGRAPH_DTD = digraph-topology.dtd.1
43DIGRAPH_DTD_SRC = ../common/$(DIGRAPH_DTD)
44ROOT_DTD_DIR=$(ROOT)/usr/share/lib/xml/dtd
45ROOT_DIGRAPH_DTD=$(ROOT_DTD_DIR)/$(DIGRAPH_DTD)
46
47common_ROOTTOPOROOT = $(ROOT)/usr/lib/fm/topo/$(MODCLASS)
48arch_ROOTTOPOROOT = $(ROOT)/usr/platform/$(ARCH)/lib/fm/topo/$(MODCLASS)
49platform_ROOTTOPOROOT = \
50	$(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/$(MODCLASS))
51ROOTTOPOROOT = $($(CLASS)_ROOTTOPOROOT)
52ROOTTOPOMAPS = $(TOPOFILE:%=$(ROOTTOPOROOT)/%)
53
54install:= FILEMODE =	0444
55
56# The .xmlgen perl file automatically generates a new xml file.  This is done
57# to avoid having to deal with things like 48 platform specific internal
58# storage bays by hand.
59.xmlgen.xml:
60	$(RM) $@
61	$(CAT) ../common/xmlgen-header.xml > $@
62	$(PERL) $< >> $@
63
64.xmlgenksh.xml:
65	$(RM) $@
66	$(CAT) ../common/xmlgen-header-new.xml > $@
67	$(KSH93) $< >> $@
68
69%.xml: ../common/%.xml
70	$(RM) $@
71	$(CAT) $< > $@
72
73include ../../Makefile.rootdirs
74
75all: $(TOPOFILE)
76
77clean:
78	$(RM) $(ROOTTOPOMAPS)
79	$(RM) $(TEMPTOPOFILE)
80
81clobber: clean
82	$(RM) $(CLOBBERFILES)
83
84check: $(CHECKHDRS)  $(TOPOFILE:%=%.chk)
85
86install_h _msg:
87
88%.xml.chk: %.xml
89	@echo xmllint $<
90	@xmllint --dropdtd $< | \
91	xmllint --noout --dtdvalid  $(DTDSRC) -
92
93%.usbtopo.chk: %.usbtopo
94
95$($(CLASS)_ROOTTOPOROOT)/%: %
96	$(INS.file)
97
98$(ROOTDTDTARG): $$(@D)
99	$(RM) $@; $(INS) -s -m 0444 -f $(@D) $(DTDSRC)
100
101$(ROOT_DIGRAPH_DTD): $(DIGRAPH_DTD_SRC)
102	$(RM) $@; $(INS) -s -m 0444 -f $(ROOT_DTD_DIR) $(DIGRAPH_DTD_SRC)
103
104install: all $(ROOTDTDTARG) $(ROOT_DIGRAPH_DTD) $(ROOTTOPOROOT) $(ROOTTOPOMAPS)
105