149b225e1SGavin Maltby#
249b225e1SGavin Maltby# CDDL HEADER START
349b225e1SGavin Maltby#
449b225e1SGavin Maltby# The contents of this file are subject to the terms of the
549b225e1SGavin Maltby# Common Development and Distribution License (the "License").
649b225e1SGavin Maltby# You may not use this file except in compliance with the License.
749b225e1SGavin Maltby#
849b225e1SGavin Maltby# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
949b225e1SGavin Maltby# or http://www.opensolaris.org/os/licensing.
1049b225e1SGavin Maltby# See the License for the specific language governing permissions
1149b225e1SGavin Maltby# and limitations under the License.
1249b225e1SGavin Maltby#
1349b225e1SGavin Maltby# When distributing Covered Code, include this CDDL HEADER in each
1449b225e1SGavin Maltby# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1549b225e1SGavin Maltby# If applicable, add the following below this CDDL HEADER, with the
1649b225e1SGavin Maltby# fields enclosed by brackets "[]" replaced with your own identifying
1749b225e1SGavin Maltby# information: Portions Copyright [yyyy] [name of copyright owner]
1849b225e1SGavin Maltby#
1949b225e1SGavin Maltby# CDDL HEADER END
2049b225e1SGavin Maltby#
2149b225e1SGavin Maltby#
22f6e214c7SGavin Maltby# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
2349b225e1SGavin Maltby#
2449b225e1SGavin Maltby
2549b225e1SGavin MaltbyLIBRARY = libfmevent.a
2649b225e1SGavin MaltbyVERS = .1
2749b225e1SGavin Maltby
2849b225e1SGavin MaltbyLIBSRCS = fmev_subscribe.c \
2949b225e1SGavin Maltby	fmev_evaccess.c \
3049b225e1SGavin Maltby	fmev_errstring.c \
31f6e214c7SGavin Maltby	fmev_util.c \
32f6e214c7SGavin Maltby	fmev_publish.c
3349b225e1SGavin Maltby
3449b225e1SGavin MaltbyOBJECTS = $(LIBSRCS:%.c=%.o)
3549b225e1SGavin Maltby
3649b225e1SGavin Maltbyinclude ../../../Makefile.lib
37fc5ba5b7SAntonello Cruz
38fc5ba5b7SAntonello Cruz# This library must install in /lib/fm since it is a dependency of
39fc5ba5b7SAntonello Cruz# svc.startd and may be required in early boot.  Thus we cannot
40fc5ba5b7SAntonello Cruz# include ../Makefile.lib - instead we set ROOTFMHDRDIR and
41fc5ba5b7SAntonello Cruz# ROOTFMHDRS and redefine ROOTLIBDIR and ROOTLIBDIR64 accordingly
42fc5ba5b7SAntonello Cruz
43fc5ba5b7SAntonello CruzROOTFMHDRDIR = $(ROOTHDRDIR)/fm
44fc5ba5b7SAntonello CruzROOTFMHDRS   = $(FMHDRS:%=$(ROOTFMHDRDIR)/%)
45fc5ba5b7SAntonello Cruz
46fc5ba5b7SAntonello CruzROOTLIBDIR=     $(ROOTFS_LIBDIR)/fm
47fc5ba5b7SAntonello CruzROOTLIBDIR64=   $(ROOTFS_LIBDIR)/fm/$(MACH64)
4849b225e1SGavin Maltby
4949b225e1SGavin MaltbySRCS = $(LIBSRCS:%.c=../common/%.c)
50241c90a0SRichard LoweLIBS = $(DYNLIB)
5149b225e1SGavin Maltby
5249b225e1SGavin MaltbySRCDIR =	../common
5349b225e1SGavin Maltby
54bd0ce624SYuri PankovCSTD = $(CSTD_GNU99)
55f6e214c7SGavin Maltby
5649b225e1SGavin MaltbyCPPFLAGS += -I../common -I.
5749b225e1SGavin Maltby$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
5849b225e1SGavin Maltby
5949b225e1SGavin MaltbyCFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
6049b225e1SGavin MaltbyCFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS)
61fc5ba5b7SAntonello Cruz
627014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
637014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function
64d3b5f563SJohn LevonCERRWARN += $(CNOWARN_UNINIT)
657014882cSRichard Lowe
66fc5ba5b7SAntonello CruzFMLIBDIR=usr/lib/fm
67fc5ba5b7SAntonello Cruz$(BUILD64)FMLIBDIR64=usr/lib/fm/$(MACH64)
68fc5ba5b7SAntonello Cruz
69fc5ba5b7SAntonello Cruz$(DYNLIB) := LDLIBS += -lumem -lnvpair -luutil -lsysevent \
70fc5ba5b7SAntonello Cruz	-L$(ROOT)/$(FMLIBDIR) -ltopo -lc
71fc5ba5b7SAntonello Cruz
72fc5ba5b7SAntonello Cruz$(BUILD64)$(DYNLIB) := LDLIBS64 += -lumem -lnvpair -luutil -lsysevent \
73fc5ba5b7SAntonello Cruz	-L$(ROOT)/$(FMLIBDIR64) -ltopo -lc
7449b225e1SGavin Maltby
7549b225e1SGavin Maltby
7649b225e1SGavin MaltbyCLEANFILES += ../common/fmev_errstring.c
7749b225e1SGavin Maltby
78*cd61ae21SRichard LoweCOMPATLINKS =	usr/lib/fm/$(DYNLIB) \
79*cd61ae21SRichard Lowe		usr/lib/fm/$(LIBLINKS)
80*cd61ae21SRichard Lowe
81*cd61ae21SRichard LoweCOMPATLINKS64 =	usr/lib/fm/$(MACH64)/$(DYNLIB) \
82*cd61ae21SRichard Lowe		usr/lib/fm/$(MACH64)/$(LIBLINKS)
83*cd61ae21SRichard Lowe
84*cd61ae21SRichard Lowe$(ROOT)/usr/lib/fm/libfmevent.so.1 := \
85*cd61ae21SRichard Lowe	COMPATLINKTARGET=../../../lib/fm/libfmevent.so.1
86*cd61ae21SRichard Lowe$(ROOT)/usr/lib/fm/libfmevent.so := \
87*cd61ae21SRichard Lowe	COMPATLINKTARGET=../../../lib/fm/libfmevent.so.1
88*cd61ae21SRichard Lowe$(ROOT)/usr/lib/fm/$(MACH64)/libfmevent.so.1:= \
89*cd61ae21SRichard Lowe	COMPATLINKTARGET=../../../../lib/fm/$(MACH64)/libfmevent.so.1
90*cd61ae21SRichard Lowe$(ROOT)/usr/lib/fm/$(MACH64)/libfmevent.so:= \
91*cd61ae21SRichard Lowe	COMPATLINKTARGET=../../../../lib/fm/$(MACH64)/libfmevent.so.1
92*cd61ae21SRichard Lowe
9349b225e1SGavin Maltby.KEEP_STATE:
9449b225e1SGavin Maltby
9549b225e1SGavin Maltbyall: $(LIBS)
9649b225e1SGavin Maltby
9749b225e1SGavin Maltbypics/%.o: ../$(MACH)/%.c
9849b225e1SGavin Maltby	$(COMPILE.c) -o $@ $<
9949b225e1SGavin Maltby	$(POST_PROCESS_O)
10049b225e1SGavin Maltby
10149b225e1SGavin Maltby../common/fmev_errstring.c: ../common/mkerror.sh ../common/libfmevent.h
10249b225e1SGavin Maltby	sh ../common/mkerror.sh ../common/libfmevent.h > $@
10349b225e1SGavin Maltby
10449b225e1SGavin Maltby%.o: ../common/%.c
10549b225e1SGavin Maltby	$(COMPILE.c) -o $@ $<
10649b225e1SGavin Maltby	$(POST_PROCESS_O)
10749b225e1SGavin Maltby
10849b225e1SGavin Maltbyinclude ../../../Makefile.targ
10949b225e1SGavin Maltbyinclude ../../Makefile.targ
110