xref: /illumos-gate/usr/src/lib/fm/libfmevent/Makefile.com (revision a92282e44f968185a6bba094d1e5fece2da819cf)
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) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23#
24
25LIBRARY = libfmevent.a
26VERS = .1
27
28LIBSRCS = fmev_subscribe.c \
29	fmev_evaccess.c \
30	fmev_errstring.c \
31	fmev_util.c \
32	fmev_publish.c
33
34OBJECTS = $(LIBSRCS:%.c=%.o)
35
36include ../../../Makefile.lib
37
38# This library must install in /lib/fm since it is a dependency of
39# svc.startd and may be required in early boot.  Thus we cannot
40# include ../Makefile.lib - instead we set ROOTFMHDRDIR and
41# ROOTFMHDRS and redefine ROOTLIBDIR and ROOTLIBDIR64 accordingly
42
43ROOTFMHDRDIR = $(ROOTHDRDIR)/fm
44ROOTFMHDRS   = $(FMHDRS:%=$(ROOTFMHDRDIR)/%)
45
46ROOTLIBDIR=     $(ROOTFS_LIBDIR)/fm
47ROOTLIBDIR64=   $(ROOTFS_LIBDIR)/fm/$(MACH64)
48
49SRCS = $(LIBSRCS:%.c=../common/%.c)
50LIBS = $(DYNLIB)
51
52SRCDIR =	../common
53
54CSTD = $(CSTD_GNU99)
55
56CPPFLAGS += -I../common -I.
57$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
58
59CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
60CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS)
61
62CERRWARN += -_gcc=-Wno-parentheses
63CERRWARN += -_gcc=-Wno-unused-function
64CERRWARN += $(CNOWARN_UNINIT)
65
66FMLIBDIR=usr/lib/fm
67$(BUILD64)FMLIBDIR64=usr/lib/fm/$(MACH64)
68
69$(DYNLIB) := LDLIBS += -lumem -lnvpair -luutil -lsysevent \
70	-L$(ROOT)/$(FMLIBDIR) -ltopo -lc
71
72$(BUILD64)$(DYNLIB) := LDLIBS64 += -lumem -lnvpair -luutil -lsysevent \
73	-L$(ROOT)/$(FMLIBDIR64) -ltopo -lc
74
75
76CLEANFILES += ../common/fmev_errstring.c
77
78COMPATLINKS =	usr/lib/fm/$(DYNLIB) \
79		usr/lib/fm/$(LIBLINKS)
80
81COMPATLINKS64 =	usr/lib/fm/$(MACH64)/$(DYNLIB) \
82		usr/lib/fm/$(MACH64)/$(LIBLINKS)
83
84$(ROOT)/usr/lib/fm/libfmevent.so.1 := \
85	COMPATLINKTARGET=../../../lib/fm/libfmevent.so.1
86$(ROOT)/usr/lib/fm/libfmevent.so := \
87	COMPATLINKTARGET=../../../lib/fm/libfmevent.so.1
88$(ROOT)/usr/lib/fm/$(MACH64)/libfmevent.so.1:= \
89	COMPATLINKTARGET=../../../../lib/fm/$(MACH64)/libfmevent.so.1
90$(ROOT)/usr/lib/fm/$(MACH64)/libfmevent.so:= \
91	COMPATLINKTARGET=../../../../lib/fm/$(MACH64)/libfmevent.so.1
92
93.KEEP_STATE:
94
95all: $(LIBS)
96
97pics/%.o: ../$(MACH)/%.c
98	$(COMPILE.c) -o $@ $<
99	$(POST_PROCESS_O)
100
101../common/fmev_errstring.c: ../common/mkerror.sh ../common/libfmevent.h
102	sh ../common/mkerror.sh ../common/libfmevent.h > $@
103
104%.o: ../common/%.c
105	$(COMPILE.c) -o $@ $<
106	$(POST_PROCESS_O)
107
108include ../../../Makefile.targ
109include ../../Makefile.targ
110