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