xref: /illumos-gate/usr/src/cmd/picl/plugins/common/piclevent/Makefile (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26LIBRARY=	libpiclevent.a
27VERS=		.1
28
29OBJECTS=	piclevent.o
30
31# include library definitions
32include $(SRC)/lib/Makefile.lib
33
34include $(SRC)/cmd/picl/plugins/Makefile.com
35
36MODULES = picl_slm.so
37MOD_SRCS = picl_slm.c
38MOD_OBJS = picl_slm.o
39MOD_LDLIBS = -L$(ROOT)/usr/lib -lsysevent -lnvpair -lc $(LDSTACKPROTECT)
40
41# sysevent SLM dirs
42SYSEVENT = sysevent
43MODDIR = modules
44ROOTLIBSYSEVENTDIR = $(ROOTLIB)/$(SYSEVENT)
45ROOTLIBSYSEVENTMODDIR = $(ROOTLIBSYSEVENTDIR)/$(MODDIR)
46ROOTLIBSYSEVENTMODULES = $(MODULES:%=$(ROOTLIBSYSEVENTMODDIR)/%)
47ROOTETCSYSEVENTDIR = $(ROOTETC)/$(SYSEVENT)
48
49SRCS=		$(OBJECTS:%.o=%.c)
50
51LIBS =		$(DYNLIB)
52
53ROOTLIBDIR =	$(USR_LIB_PLUGINDIR)
54ROOTETC	=	$(ROOT)/etc
55ROOTLIB =	$(ROOT)/usr/lib
56
57CLEANFILES=	$(MOD_OBJS)
58CLOBBERFILES += $(LIBLINKS)
59CLOBBERFILES += $(MODULES)
60
61CPPFLAGS +=	-I$(SRC)/lib/libsysevent -I$(SRC)/uts/sun
62
63CFLAGS +=	$(CCVERBOSE) $(C_PICFLAGS)
64CPPFLAGS +=	-D_REENTRANT
65LDFLAGS +=	$(BDIRECT)
66LDLIBS +=	-L$(SRC)/lib/libsysevent -L$(SRC)/lib/libpicltree/$(MACH)
67LDLIBS +=	-lc -lpicltree -lnvpair
68
69.KEEP_STATE:
70
71SUBDIRS=
72
73POFILE=	piclevent.po
74
75all :=		TARGET= all
76install :=	TARGET= install
77clean :=	TARGET= clean
78clobber :=	TARGET= clobber
79_msg :=		TARGET= _msg
80
81all: $(LIBS) $(LIBLINKS) $(MODULES)
82
83install:	$(ROOTLIBDIR) all $(ROOTLIBS) $(ROOTLINKS) \
84	$(ROOTETCSYSEVENTDIR)		\
85	$(ROOTLIBSYSEVENTDIR)		\
86	$(ROOTLIBSYSEVENTMODDIR)	\
87	$(ROOTLIBSYSEVENTMODULES)
88
89_msg:	$(MSGDOMAIN) $(POFILE)
90	$(RM) $(MSGDOMAIN)/$(POFILE)
91	$(CP) $(POFILE) $(MSGDOMAIN)
92
93
94$(MSGDOMAIN):
95	$(INS.dir)
96
97$(LIBLINKS):	FRC
98	$(RM) $@; $(SYMLINK) $(DYNLIB) $@
99
100# include library targets
101include $(SRC)/cmd/picl/plugins/Makefile.targ
102include $(SRC)/lib/Makefile.targ
103
104%.so: %.o
105	$(LINK.c) -o $@ $(GSHARED) -Wl,-h$@ $< $(MOD_LDLIBS)
106
107%.o: %.c
108	$(COMPILE.c) -o $@ $<
109
110$(SUBDIRS): FRC
111	@cd $@; pwd; $(MAKE) $(TARGET)
112
113$(ROOTLIBSYSEVENTDIR):
114	$(INS.dir)
115
116$(ROOTETCSYSEVENTDIR):
117	$(INS.dir)
118
119$(ROOTLIBSYSEVENTDIR)/%: %
120	$(INS.file)
121
122$(ROOTLIBSYSEVENTMODDIR):
123	$(INS.dir)
124
125$(ROOTLIBSYSEVENTMODDIR)/%.so: %.so
126	$(INS.file)
127
128FRC:
129