xref: /illumos-gate/usr/src/cmd/fm/notify/snmp-notify/Makefile.com (revision e86372a01d2d16a5dd4a64e144ed978ba17fe7dd)
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)
31
32PROG = snmp-notify
33ROOTLIBFM = $(ROOT)/usr/lib/fm
34ROOTLIBNOTIFY = $(ROOT)/usr/lib/fm/notify
35ROOTPROG = $(ROOTLIBNOTIFY)/$(PROG)
36
37ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)/fm
38ROOTMANIFEST = $(ROOTMANIFESTDIR)/$(PROG).xml
39ROOTNOTIFYPARAMS = $(ROOTMANIFESTDIR)/notify-params.xml
40$(ROOTMANIFEST) := FILEMODE = 0444
41$(ROOTNOTIFYPARAMS) := FILEMODE = 0444
42
43$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
44CPPFLAGS += -I. -I../common -I../../../../../lib/fm/libfmnotify/common
45CSTD	= $(CSTD_GNU99)
46CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST)
47LDLIBS += -L$(ROOT)/usr/lib/fm -lnvpair -lfmevent -lfmd_msg -lfmnotify \
48	-lumem -lnetsnmp -lnetsnmpagent
49NATIVE_LIBS += libnetsnmp.so libnetsnmpagent.so
50LDFLAGS += -R/usr/lib/fm
51
52CERRWARN += -_gcc=-Wno-parentheses
53
54.NO_PARALLEL:
55.PARALLEL: $(OBJS)
56
57all: $(PROG)
58
59$(PROG): $(OBJS)
60	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
61	$(CTFMERGE) -L VERSION -o $@ $(OBJS)
62	$(POST_PROCESS)
63
64%.o: ../common/%.c
65	$(COMPILE.c) $<
66	$(CTFCONVERT_O)
67
68%.o: %.c
69	$(COMPILE.c) $<
70	$(CTFCONVERT_O)
71
72clean:
73	$(RM) $(OBJS)
74
75clobber: clean
76	$(RM) $(PROG)
77
78$(ROOTLIBNOTIFY):
79	$(INS.dir)
80
81$(ROOTLIBNOTIFY)/%: %
82	$(INS.file)
83
84$(ROOTMANIFESTDIR):
85	$(INS.dir)
86
87$(ROOTMANIFESTDIR)/%.xml: ../common/%.xml
88	$(INS.file)
89
90$(ROOTMANIFESTDIR)/notify-params.xml: ../../notify-params.xml
91	$(INS.file) ../../notify-params.xml
92
93install_h:
94
95install: all $(ROOTLIBNOTIFY) $(ROOTPROG) $(ROOTMANIFESTDIR) $(ROOTMANIFEST) $(ROOTNOTIFYPARAMS)
96