1ea4282e9Sjmerrill# 2ea4282e9Sjmerrill# CDDL HEADER START 3ea4282e9Sjmerrill# 4ea4282e9Sjmerrill# The contents of this file are subject to the terms of the 50eb822a1Scindi# Common Development and Distribution License (the "License"). 60eb822a1Scindi# You may not use this file except in compliance with the License. 7ea4282e9Sjmerrill# 8ea4282e9Sjmerrill# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9ea4282e9Sjmerrill# or http://www.opensolaris.org/os/licensing. 10ea4282e9Sjmerrill# See the License for the specific language governing permissions 11ea4282e9Sjmerrill# and limitations under the License. 12ea4282e9Sjmerrill# 13ea4282e9Sjmerrill# When distributing Covered Code, include this CDDL HEADER in each 14ea4282e9Sjmerrill# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15ea4282e9Sjmerrill# If applicable, add the following below this CDDL HEADER, with the 16ea4282e9Sjmerrill# fields enclosed by brackets "[]" replaced with your own identifying 17ea4282e9Sjmerrill# information: Portions Copyright [yyyy] [name of copyright owner] 18ea4282e9Sjmerrill# 19ea4282e9Sjmerrill# CDDL HEADER END 20ea4282e9Sjmerrill# 21ea4282e9Sjmerrill 22ea4282e9Sjmerrill# 23940d71d2Seschrock# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 247aec1d6eScindi# Use is subject to license terms. 25c5591576SRob Johnston# 26c5591576SRob Johnston# Copyright 2020 Joyent, Inc. 27ea4282e9Sjmerrill# 28ea4282e9Sjmerrill 290eb822a1Scindi.KEEP_STATE: 30184cd04cScth.SUFFIXES: 311410cb93SJoshua M. Clulow.SUFFIXES: .xml .xmlgen .xmlgenksh $(SUFFIXES) 320eb822a1Scindi 330eb822a1ScindiMODCLASS = maps 340eb822a1Scindi 357aec1d6eScindiinclude ../../../Makefile.lib 367aec1d6eScindiinclude ../../../../Makefile.lib 37ea4282e9Sjmerrill 387aec1d6eScindiDTDSRC = $(DTDFILE:%=../common/%) 397aec1d6eScindiDTDTARG = $(DTDFILE:%=%) 400eb822a1ScindiROOTDTDTARG = $(DTDTARG:%=$(ROOT)/usr/share/lib/xml/dtd/%) 410eb822a1Scindi 42c5591576SRob JohnstonDIGRAPH_DTD = digraph-topology.dtd.1 43c5591576SRob JohnstonDIGRAPH_DTD_SRC = ../common/$(DIGRAPH_DTD) 44c5591576SRob JohnstonROOT_DTD_DIR=$(ROOT)/usr/share/lib/xml/dtd 45c5591576SRob JohnstonROOT_DIGRAPH_DTD=$(ROOT_DTD_DIR)/$(DIGRAPH_DTD) 46c5591576SRob Johnston 470eb822a1Scindicommon_ROOTTOPOROOT = $(ROOT)/usr/lib/fm/topo/$(MODCLASS) 480eb822a1Scindiarch_ROOTTOPOROOT = $(ROOT)/usr/platform/$(ARCH)/lib/fm/topo/$(MODCLASS) 490eb822a1Scindiplatform_ROOTTOPOROOT = \ 500eb822a1Scindi $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/$(MODCLASS)) 510eb822a1ScindiROOTTOPOROOT = $($(CLASS)_ROOTTOPOROOT) 520eb822a1ScindiROOTTOPOMAPS = $(TOPOFILE:%=$(ROOTTOPOROOT)/%) 530eb822a1Scindi 540eb822a1Scindiinstall:= FILEMODE = 0444 550eb822a1Scindi 56d91236feSeschrock# The .xmlgen perl file automatically generates a new xml file. This is done 57d91236feSeschrock# to avoid having to deal with things like 48 platform specific internal 58d91236feSeschrock# storage bays by hand. 59184cd04cScth.xmlgen.xml: 60c5591576SRob Johnston $(RM) $@ 61d91236feSeschrock $(CAT) ../common/xmlgen-header.xml > $@ 62d91236feSeschrock $(PERL) $< >> $@ 631410cb93SJoshua M. Clulow 641410cb93SJoshua M. Clulow.xmlgenksh.xml: 651410cb93SJoshua M. Clulow $(RM) $@ 661410cb93SJoshua M. Clulow $(CAT) ../common/xmlgen-header-new.xml > $@ 671410cb93SJoshua M. Clulow $(KSH93) $< >> $@ 68c5591576SRob Johnston 69ee5416c9Syc%.xml: ../common/%.xml 700eb822a1Scindi $(RM) $@ 710eb822a1Scindi $(CAT) $< > $@ 72ea4282e9Sjmerrill 730eb822a1Scindiinclude ../../Makefile.rootdirs 74ea4282e9Sjmerrill 750eb822a1Scindiall: $(TOPOFILE) 76ea4282e9Sjmerrill 777aec1d6eScindiclean: 780eb822a1Scindi $(RM) $(ROOTTOPOMAPS) 79ee5416c9Syc $(RM) $(TEMPTOPOFILE) 807aec1d6eScindi 817aec1d6eScindiclobber: clean 82b6805bf7SGordon Ross $(RM) $(CLOBBERFILES) 837aec1d6eScindi 84*241c90a0SRichard Lowecheck: $(CHECKHDRS) $(TOPOFILE:%=%.chk) 857aec1d6eScindi 86940d71d2Seschrockinstall_h _msg: 87940d71d2Seschrock 88940d71d2Seschrock%.xml.chk: %.xml 89940d71d2Seschrock @echo xmllint $< 90940d71d2Seschrock @xmllint --dropdtd $< | \ 91940d71d2Seschrock xmllint --noout --dtdvalid $(DTDSRC) - 927aec1d6eScindi 93*241c90a0SRichard Lowe%.usbtopo.chk: %.usbtopo 94*241c90a0SRichard Lowe 950eb822a1Scindi$($(CLASS)_ROOTTOPOROOT)/%: % 960eb822a1Scindi $(INS.file) 977aec1d6eScindi 980eb822a1Scindi$(ROOTDTDTARG): $$(@D) 990eb822a1Scindi $(RM) $@; $(INS) -s -m 0444 -f $(@D) $(DTDSRC) 1007aec1d6eScindi 101c5591576SRob Johnston$(ROOT_DIGRAPH_DTD): $(DIGRAPH_DTD_SRC) 102c5591576SRob Johnston $(RM) $@; $(INS) -s -m 0444 -f $(ROOT_DTD_DIR) $(DIGRAPH_DTD_SRC) 103c5591576SRob Johnston 104c5591576SRob Johnstoninstall: all $(ROOTDTDTARG) $(ROOT_DIGRAPH_DTD) $(ROOTTOPOROOT) $(ROOTTOPOMAPS) 105