Makefile revision bf56214c0556fa6864189c826d39dbe156bb22a0
219N/A#
219N/A# CDDL HEADER START
219N/A#
219N/A# The contents of this file are subject to the terms of the
219N/A# Common Development and Distribution License (the "License").
219N/A# You may not use this file except in compliance with the License.
219N/A#
219N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
219N/A# or http://www.opensolaris.org/os/licensing.
219N/A# See the License for the specific language governing permissions
219N/A# and limitations under the License.
219N/A#
219N/A# When distributing Covered Code, include this CDDL HEADER in each
219N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
219N/A# If applicable, add the following below this CDDL HEADER, with the
219N/A# fields enclosed by brackets "[]" replaced with your own identifying
219N/A# information: Portions Copyright [yyyy] [name of copyright owner]
219N/A#
219N/A# CDDL HEADER END
219N/A#
219N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
814N/A# Use is subject to license terms.
219N/A#
219N/A# ident "%Z%%M% %I% %E% SMI"
219N/A#
219N/A
219N/A#####################################################
219N/A#
219N/A# Makefile for a SNMP Agent
219N/A#
618N/A#####################################################
219N/A
219N/A#
219N/A# Makefile.vars
618N/A#
219N/A
219N/A#####################################################
219N/A# Edit the following variables as needed
219N/A#####################################################
219N/A
219N/ABIN= bin
814N/A
219N/ASNMP_ROOT= /usr
219N/A
219N/ASNMP_LIB= $(SNMP_ROOT)/lib
219N/A
219N/ASNMP_INC= $(SNMP_ROOT)/include/snmp
219N/A
219N/APURIFY_HOME= /usr/soft/purify3.0
219N/A
219N/A
219N/AAGENT= snmpdemo
219N/A
219N/AMIBS= mib_demo.txt
219N/A
219N/A
219N/A#####################################################
219N/A
219N/ATARGET= $(AGENT)d
219N/A
219N/A
219N/A.KEEP_STATE:
219N/A
219N/ASOURCES.c=\
219N/A $(AGENT)_tree.c\
219N/A $(AGENT)_stub.c\
219N/A $(AGENT)_trap.c\
219N/A $(AGENT)_appl.c\
219N/A $(AGENT)_demoEntry.c
219N/A
219N/ASOURCES.h=\
219N/A $(SNMP_INC)/impl.h\
219N/A $(SNMP_INC)/asn1.h\
219N/A $(SNMP_INC)/error.h\
219N/A $(SNMP_INC)/pdu.h\
219N/A $(SNMP_INC)/trap.h\
219N/A $(SNMP_INC)/node.h\
219N/A $(AGENT)_stub.h
219N/A
219N/AOBJECTS= $(SOURCES.c:%.c=$(BIN)/%.o)
219N/A
219N/A
219N/A#
219N/A# CC flags
219N/A#
219N/A
219N/ADEFINES=
219N/A
219N/AMY_INCLUDE= -I. -I$(SNMP_INC)
219N/A
219N/ACPPFLAGS += $(MY_INCLUDE)
219N/A
219N/ACFLAGS= -c
219N/A
219N/A
219N/A#
219N/A# LD flags
219N/A#
219N/A
219N/AEXT = 1
219N/A
219N/AMYLINKLIBS += $(LDLIBS) -L$(SNMP_LIB) -lssagent -L$(SNMP_LIB) -lssasnmp
219N/A
219N/ALIBS= $(MYLINKLIBS) -lsocket -lnsl -ly -ll -lelf -lgen
219N/A
219N/ATEST= test
219N/A
219N/APURIFY= $(PURIFY_HOME)/purify
219N/A
219N/APARSER= $(SNMP_ROOT)/$(BIN)/mibcodegen
219N/A
219N/A
219N/A#####################################################
219N/A
219N/A#
219N/A# all
219N/A#
219N/A
219N/Aall: $(SOURCES.h) $(TARGET)
219N/A
219N/Ainstall: all
219N/A
219N/A$(TARGET): $(BIN) $(OBJECTS) $(MYLIBS)
219N/A $(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(MYLIBS) $(LIBS)
219N/A
219N/A$(BIN)/%.o: %.c
219N/A $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) $*.c -o $@
219N/A
219N/A
219N/A#
219N/A# parse
219N/A#
parse: $(MIBS)
$(PARSER) -b $(AGENT) -f $(MIBS)
#
# lint
#
lint:
$(LINT) $(LDFLAGS) $(CPPFLAGS) $(DEFINES) $(SOURCES.c) $(MYLIBS) $(LIBS)
#
# purify
#
purify:
$(PURIFY) $(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(MYLIBS) $(LIBS)
#
# directories
#
$(BIN):
@$(TEST) -d $@ || mkdir $@
#
# clean
#
clean:
$(RM) $(OBJECTS)
clobber: clean
$(RM) $(TARGET)