xref: /titanic_44/usr/src/lib/fm/topo/modules/Makefile.plugin (revision 48a4016cae8aa2b8b3d8b258eb22e0c781912bed)
17aec1d6eScindi#
27aec1d6eScindi# CDDL HEADER START
37aec1d6eScindi#
47aec1d6eScindi# The contents of this file are subject to the terms of the
57aec1d6eScindi# Common Development and Distribution License (the "License").
67aec1d6eScindi# You may not use this file except in compliance with the License.
77aec1d6eScindi#
87aec1d6eScindi# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97aec1d6eScindi# or http://www.opensolaris.org/os/licensing.
107aec1d6eScindi# See the License for the specific language governing permissions
117aec1d6eScindi# and limitations under the License.
127aec1d6eScindi#
137aec1d6eScindi# When distributing Covered Code, include this CDDL HEADER in each
147aec1d6eScindi# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157aec1d6eScindi# If applicable, add the following below this CDDL HEADER, with the
167aec1d6eScindi# fields enclosed by brackets "[]" replaced with your own identifying
177aec1d6eScindi# information: Portions Copyright [yyyy] [name of copyright owner]
187aec1d6eScindi#
197aec1d6eScindi# CDDL HEADER END
207aec1d6eScindi#
217aec1d6eScindi#
22a4aef2baSTarik Soydan# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237aec1d6eScindi# Use is subject to license terms.
247aec1d6eScindi#
257aec1d6eScindi
267aec1d6eScindi.KEEP_STATE:
277aec1d6eScindi.SUFFIXES:
287aec1d6eScindi
297aec1d6eScindiMODCLASS = plugins
307aec1d6eScindi
317aec1d6eScindiinclude ../../../../Makefile.lib
327aec1d6eScindiinclude ../../../../../Makefile.lib
337aec1d6eScindi
347aec1d6eScindi#
357aec1d6eScindi# Set PROG and OBJS based on the values of MODULE and SRCS.  We expect that
367aec1d6eScindi# these macros to be defined by the Makefile that is including this file.
377aec1d6eScindi#
38602ca9eaScth# SHAREDSRCS is used to share sources between multiple libtopo modules.
39602ca9eaScth#
40602ca9eaScthSRCS = $(MODULESRCS:%.c=%.c) $(SHAREDSRCS:%.c=../../common/$(SHAREDMODULE)/%.c)
417aec1d6eScindiPROG = $(MODULE:%=%.so)
42602ca9eaScthOBJS = $(MODULESRCS:%.c=%.o) $(SHAREDSRCS:%.c=%.o)
437aec1d6eScindi
447aec1d6eScindi#
457aec1d6eScindi# Set ROOTPROG and ROOTCONF based on the values of MODULE, CLASS, and PLATFORMS
467aec1d6eScindi# We expect these macros to be defined by the Makefile that is including us.
477aec1d6eScindi#
487aec1d6eScindicommon_ROOTPROG = $(ROOT)/usr/lib/fm/topo/plugins/$(PROG)
497aec1d6eScindiarch_ROOTPROG = $(ROOT)/usr/platform/$(ARCH)/lib/fm/topo/plugins/$(PROG)
507aec1d6eScindiplat_ROOTPROG = $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/plugins/$(PROG))
517aec1d6eScindiROOTPROG = $($(CLASS)_ROOTPROG)
527aec1d6eScindi
537aec1d6eScindicommon_ROOTCONF = $(ROOT)/usr/lib/fm/topo/plugins/$(CONF)
547aec1d6eScindiarch_ROOTCONF = $(ROOT)/usr/platform/$(ARCH)/lib/fm/topo/plugins/$(CONF)
557aec1d6eScindiplat_ROOTCONF = $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/plugins/$(CONF))
567aec1d6eScindiROOTCONF = $($(CLASS)_ROOTCONF)
577aec1d6eScindi
5892ba7109SeschrockLINTFLAGS = -msux
59*48a4016cSRobert MustacchiLINTFILES = $(MODULESRCS:%.c=%.ln) $(SHAREDSRCS:%.c=%.ln)
607aec1d6eScindi
617014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized
627014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
637014882cSRichard Lowe
647aec1d6eScindiAPIMAP = ../../../libtopo/common/topo_mod.map
65f808c858SrafMAPFILES =		# use APIMAP instead
667aec1d6eScindi
67a4aef2baSTarik SoydanC99MODE  = $(C99_ENABLE)
687aec1d6eScindiCFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) $(CC_PICFLAGS)
697aec1d6eScindiCFLAGS += -G $(XREGSFLAG)
707aec1d6eScindi
7140e5e17bSzx143588CPPFLAGS += -I.
727aec1d6eScindiCPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
737aec1d6eScindiLDFLAGS += $(ZIGNORE) -M$(APIMAP)
7492ba7109SeschrockLDLIBS += -L$(ROOTLIBDIR)/fm -ltopo -lnvpair -lc
7592ba7109SeschrockDYNFLAGS += -R/usr/lib/fm
767aec1d6eScindi
777aec1d6eScindiall: $(PROG)
787aec1d6eScindi
797aec1d6eScindi.NO_PARALLEL:
807aec1d6eScindi.PARALLEL: $(OBJS) $(LINTFILES)
817aec1d6eScindi
827aec1d6eScindi$(PROG): $(OBJS) $(APIMAP)
837aec1d6eScindi	$(LINK.c) $(DYNFLAGS) $(OBJS) -o $@ $(LDLIBS)
847aec1d6eScindi	$(CTFMERGE) -L VERSION -o $@ $(OBJS)
857aec1d6eScindi	$(POST_PROCESS_SO)
867aec1d6eScindi
870eb822a1Scindi%.o: ../../common/$(MODULE)/%.c
887aec1d6eScindi	$(COMPILE.c) $<
897aec1d6eScindi	$(CTFCONVERT_O)
907aec1d6eScindi
91602ca9eaScth%.o: ../../common/$(SHAREDMODULE)/%.c
92602ca9eaScth	$(COMPILE.c) $<
93602ca9eaScth	$(CTFCONVERT_O)
94602ca9eaScth
957aec1d6eScindi%.o: %.c
967aec1d6eScindi	$(COMPILE.c) $<
977aec1d6eScindi	$(CTFCONVERT_O)
987aec1d6eScindi
997aec1d6eScindiclean:
1007aec1d6eScindi	$(RM) $(OBJS) $(LINTFILES) $(CLEANFILES)
1017aec1d6eScindi
1027aec1d6eScindiclobber: clean
103b6805bf7SGordon Ross	$(RM) $(PROG) $(CLOBBERFILES)
1047aec1d6eScindi
1050eb822a1Scindi%.ln: ../../common/$(MODULE)/%.c
1067aec1d6eScindi	$(LINT.c) -c $<
1077aec1d6eScindi
108*48a4016cSRobert Mustacchi%.ln: ../../common/$(SHAREDMODULE)/%.c
109*48a4016cSRobert Mustacchi	$(LINT.c) -c $<
110*48a4016cSRobert Mustacchi
1117aec1d6eScindi%.ln: %.c
1127aec1d6eScindi	$(LINT.c) -c $<
1137aec1d6eScindi
1147aec1d6eScindilint: $(LINTFILES)
1157aec1d6eScindi	$(LINT) $(LINTFLAGS) $(LINTFILES) $(LDLIBS)
1167aec1d6eScindi
1177aec1d6eScindicheck:	$(CHECKHDRS)
1187aec1d6eScindi
1197aec1d6eScindiinstall_h:
1207aec1d6eScindi
1217aec1d6eScindi$(ROOTPROG): $$(@D) $(PROG)
1227aec1d6eScindi	$(RM) $@; $(INS) -s -m 0555 -f $(@D) $(PROG)
1237aec1d6eScindi
1247aec1d6eScindiinstall: $(ROOTPROG)
1257aec1d6eScindi
1267aec1d6eScindiinclude ../../../Makefile.rootdirs
127