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#
23# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24#
25
26.KEEP_STATE:
27.SUFFIXES:
28
29SRCS += snmp-notify.c
30OBJS = $(SRCS:%.c=%.o)
31LINTFILES = $(SRCS:%.c=%.ln)
32
33PROG = snmp-notify
34ROOTLIBFM = $(ROOT)/usr/lib/fm
35ROOTLIBNOTIFY = $(ROOT)/usr/lib/fm/notify
36ROOTPROG = $(ROOTLIBNOTIFY)/$(PROG)
37
38ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)/fm
39ROOTMANIFEST = $(ROOTMANIFESTDIR)/$(PROG).xml
40ROOTNOTIFYPARAMS = $(ROOTMANIFESTDIR)/notify-params.xml
41$(ROOTMANIFEST) := FILEMODE = 0444
42$(ROOTNOTIFYPARAMS) := FILEMODE = 0444
43
44$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
45CPPFLAGS += -I. -I../common -I../../../../../lib/fm/libfmnotify/common
46C99MODE	= $(C99_ENABLE)
47CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST)
48LDLIBS += -L$(ROOT)/usr/lib/fm -lnvpair -lfmevent -lfmd_msg -lfmnotify \
49	-lumem -lnetsnmp -lnetsnmpagent
50LDFLAGS += -R/usr/lib/fm
51LINTFLAGS += -mnu
52
53.NO_PARALLEL:
54.PARALLEL: $(OBJS) $(LINTFILES)
55
56all: $(PROG)
57
58$(PROG): $(OBJS)
59	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
60	$(CTFMERGE) -L VERSION -o $@ $(OBJS)
61	$(POST_PROCESS)
62
63%.o: ../common/%.c
64	$(COMPILE.c) $<
65	$(CTFCONVERT_O)
66
67%.o: %.c
68	$(COMPILE.c) $<
69	$(CTFCONVERT_O)
70
71clean:
72	$(RM) $(OBJS) $(LINTFILES)
73
74clobber: clean
75	$(RM) $(PROG)
76
77%.ln: ../common/%.c
78	$(LINT.c) -c $<
79
80%.ln: %.c
81	$(LINT.c) -c $<
82
83lint: $(LINTFILES)
84	$(LINT) $(LINTFLAGS) $(LINTFILES)
85
86$(ROOTLIBNOTIFY):
87	$(INS.dir)
88
89$(ROOTLIBNOTIFY)/%: %
90	$(INS.file)
91
92$(ROOTMANIFESTDIR):
93	$(INS.dir)
94
95$(ROOTMANIFESTDIR)/%.xml: ../common/%.xml
96	$(INS.file)
97
98$(ROOTMANIFESTDIR)/notify-params.xml: ../../notify-params.xml
99	$(INS.file) ../../notify-params.xml
100
101install_h:
102
103install: all $(ROOTLIBNOTIFY) $(ROOTPROG) $(ROOTMANIFESTDIR) $(ROOTMANIFEST) $(ROOTNOTIFYPARAMS)
104