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