xref: /titanic_50/usr/src/cmd/picl/plugins/common/piclevent/Makefile (revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29LIBRARY=	libpiclevent.a
30VERS=		.1
31
32OBJECTS=	piclevent.o
33
34# include library definitions
35include $(SRC)/lib/Makefile.lib
36
37include $(SRC)/cmd/picl/plugins/Makefile.com
38
39MODULES = picl_slm.so
40MOD_SRCS = picl_slm.c
41MOD_OBJS = picl_slm.o
42MOD_LDLIBS = -L$(ROOT)/usr/lib -lsysevent -lnvpair -lc
43
44# sysevent SLM dirs
45SYSEVENT = sysevent
46MODDIR = modules
47ROOTLIBSYSEVENTDIR = $(ROOTLIB)/$(SYSEVENT)
48ROOTLIBSYSEVENTMODDIR = $(ROOTLIBSYSEVENTDIR)/$(MODDIR)
49ROOTLIBSYSEVENTMODULES = $(MODULES:%=$(ROOTLIBSYSEVENTMODDIR)/%)
50ROOTETCSYSEVENTDIR = $(ROOTETC)/$(SYSEVENT)
51
52SRCS=		$(OBJECTS:%.o=%.c)
53
54LIBS =		$(DYNLIB)
55
56ROOTLIBDIR =	$(USR_LIB_PLUGINDIR)
57ROOTETC	=	$(ROOT)/etc
58ROOTLIB =	$(ROOT)/usr/lib
59
60CLEANFILES=	$(LINTOUT) $(LINTLIB) $(MOD_OBJS)
61CLOBBERFILES += $(LIBLINKS)
62CLOBBERFILES += $(MODULES)
63
64CPPFLAGS +=	-I$(SRC)/lib/libsysevent -I$(SRC)/uts/sun
65
66CFLAGS +=	$(CCVERBOSE) $(C_PICFLAGS)
67CPPFLAGS +=	-D_REENTRANT
68LDLIBS +=	-L$(SRC)/lib/libsysevent -L$(SRC)/lib/libpicltree/$(MACH)
69LDLIBS +=	-lc -lpicltree -lnvpair
70
71LINTFLAGS +=	-L$(SRC)/lib/libpicltree/$(MACH) -lpicltree
72
73
74$(ROOTLIBSYSEVENTDIR)	:= OWNER= root
75$(ROOTLIBSYSEVENTDIR)	:= GROUP= bin
76
77$(ROOTLIBSYSEVENTMODDIR) := OWNER= root
78$(ROOTLIBSYSEVENTMODDIR) := GROUP= bin
79
80$(ROOTLIBSYSEVENTMODULES) := OWNER= root
81$(ROOTLIBSYSEVENTMODULES) := GROUP= bin
82
83
84.KEEP_STATE:
85
86SUBDIRS=
87
88POFILE=	piclevent.po
89
90all :=		TARGET= all
91install :=	TARGET= install
92clean :=	TARGET= clean
93clobber :=	TARGET= clobber
94lint :=		TARGET= lint
95_msg :=		TARGET= _msg
96
97all: $(LIBS) $(LIBLINKS) $(MODULES)
98
99install:	$(ROOTLIBDIR) all $(ROOTLIBS) $(ROOTLINKS) \
100	$(ROOTETCSYSEVENTDIR)		\
101	$(ROOTLIBSYSEVENTDIR)		\
102	$(ROOTLIBSYSEVENTMODDIR)	\
103	$(ROOTLIBSYSEVENTMODULES)
104
105_msg:	$(MSGDOMAIN) $(POFILE)
106	$(RM) $(MSGDOMAIN)/$(POFILE)
107	$(CP) $(POFILE) $(MSGDOMAIN)
108
109
110$(MSGDOMAIN):
111	$(INS.dir)
112
113$(LIBLINKS):	FRC
114	$(RM) $@; $(SYMLINK) $(DYNLIB) $@
115
116# include library targets
117include $(SRC)/cmd/picl/plugins/Makefile.targ
118include $(SRC)/lib/Makefile.targ
119
120lint :
121	$(LINT.c) $(SRCS)
122
123%.so: %.o
124	$(LINK.c) -o $@ $(GSHARED) -h $@ $< $(MOD_LDLIBS)
125
126%.o: %.c
127	$(COMPILE.c) -o $@ $<
128
129$(SUBDIRS): FRC
130	@cd $@; pwd; $(MAKE) $(TARGET)
131
132$(ROOTLIBSYSEVENTDIR):
133	$(INS.dir)
134
135$(ROOTETCSYSEVENTDIR):
136	$(INS.dir)
137
138$(ROOTLIBSYSEVENTDIR)/%: %
139	$(INS.file)
140
141$(ROOTLIBSYSEVENTMODDIR):
142	$(INS.dir)
143
144$(ROOTLIBSYSEVENTMODDIR)/%.so: %.so
145	$(INS.file)
146
147FRC:
148