Makefile revision 7c478bd95313f5f23a4c958a745db2134aa03244
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# CDDL HEADER START
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner# The contents of this file are subject to the terms of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Common Development and Distribution License, Version 1.0 only
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# (the "License"). You may not use this file except in compliance
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# with the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# or http://www.opensolaris.org/os/licensing.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# See the License for the specific language governing permissions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# and limitations under the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# When distributing Covered Code, include this CDDL HEADER in each
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# If applicable, add the following below this CDDL HEADER, with the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# fields enclosed by brackets "[]" replaced with your own identifying
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# information: Portions Copyright [yyyy] [name of copyright owner]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# CDDL HEADER END
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Copyright 1998-2003 Sun Microsystems, Inc. All rights reserved.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Use is subject to license terms.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# ident "%Z%%M% %I% %E% SMI"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chininclude ../../Makefile.vars
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# OPTIONAL_INCLUDE_FILE:sh = /bin/sh ../../misc.sh ../../../cmd/Makefile.cmd
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# include $(OPTIONAL_INCLUDE_FILE)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chininclude $(SRC)/cmd/Makefile.cmd
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# In order to conform with the Solaris 2.6 way of packaging things,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# we now need to put any deliverable that is specified in the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# prototype file into a common "proto" area, so that their
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# packaging scheme knows where to obtain the input binaries.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinAGENT = snmp_trapsend
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinBINPROG = $(AGENT)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinOPTBIN = $(ROOT)/usr/sbin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinOPTPROG = $(PROG:%=$(OPTBIN)/%)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$(OPTBIN)/%: $(OPTBIN) %
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(INS.file)
$(OPTBIN):
$(INS.dir)
SOURCES.c=\
trapsend.c \
oid.c \
usage.c
SOURCES.h=\
../snmplib/impl.h\
../snmplib/error.h\
../snmplib/trace.h\
../snmplib/asn1.h\
../snmplib/snmp.h\
../snmplib/pdu.h \
./oid.h \
./usage.h
OBJECTS= $(SOURCES.c:%.c=$(BIN)/%.o)
MYLINKLIBS += $(LDLIBS) -L../snmplib -lssasnmp
LIBS= -lnsl
CPPFLAGS += -I. -I../snmplib -I../../include/netmgt -I${BIN}
CFLAGS += -c
LINT=lint
.KEEP_STATE:
#######################################################
#
# all
#
FILEMODE = 0755
PROG=$(BINPROG)
CLOBBERFILES=$(SOURCES.c) $(SOURCES.h)
all: $(SOURCES.h) $(BINPROG)
install: all $(OPTPROG)
$(BINPROG): $(BIN) $(OBJECTS)
$(CC) -o $(BINPROG) $(LDFLAGS) $(OBJECTS) $(MYLINKLIBS) $(LIBS)
$(POST_PROCESS)
$(BIN)/%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) $*.c -o $@
$(POST_PROCESS_O)
#
# lint
#
lint:
$(LINT) $(LDFLAGS) $(CPPFLAGS) $(DEFINES) $(SOURCES.c) $(MYLINKLIBS) $(LIBS)
#
# purify
#
purify:
$(PURIFY) $(CC) -o $(BINPROG) $(LDFLAGS) $(OBJECTS) $(MYLINKLIBS) $(LIBS)
#
# directories
#
$(BIN):
@$(TEST) -d $@ || mkdir $@
#
# clean
#
clean:
$(RM) $(OBJECTS) $(BINPROG)
realclobber: clean
sccs clean
# OPTIONAL_INCLUDE_FILE:sh = /bin/sh ../../misc.sh ../../../cmd/Makefile.targ
# include $(OPTIONAL_INCLUDE_FILE)
include $(SRC)/cmd/Makefile.targ