blob: 181d3ff2876196149b9e5f97cbdee8c8751cd747 [file] [log] [blame]
#
# Makefile for snmpget, snmpwalk, snmpbulkwalk, snmptest, snmptranslate,
# snmptrapd, snmptable, snmpset, snmpgetnext, and other utilities.
#
top_builddir=..
# use GNU vpath, if available, to only set a path for source and headers
# VPATH will pick up objects too, which is bad if you are sharing a
# source dir...
@GNU_vpath@ %.h $(srcdir)
@GNU_vpath@ %.c $(srcdir)
# fallback to regular VPATH for non-gnu...
@NON_GNU_VPATH@ $(srcdir)
#
# Things to install
#
INSTALLBINPROGS = snmpget$(EXEEXT) \
snmpgetnext$(EXEEXT) \
snmpset$(EXEEXT) \
snmpusm$(EXEEXT) \
snmpwalk$(EXEEXT) \
snmpbulkwalk$(EXEEXT) \
snmptable$(EXEEXT) \
snmptrap$(EXEEXT) \
snmpbulkget$(EXEEXT) \
snmptranslate$(EXEEXT) \
snmpstatus$(EXEEXT) \
snmpdelta$(EXEEXT) \
snmptest$(EXEEXT) \
encode_keychange$(EXEEXT) \
snmpdf$(EXEEXT) \
snmpvacm$(EXEEXT)
INSTALLSBINPROGS = snmptrapd$(EXEEXT)
INSTALLLIBS = libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION)
SUBDIRS = snmpnetstat
#
# build variables.
#
# USELIBS/USEAGENTLIBS are for dependencies
USELIBS = ../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
HELPERLIB = ../agent/helpers/libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION)
AGENTLIB = ../agent/libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
MIBLIB = ../agent/libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
USEAGENTLIBS = $(MIBLIB) $(AGENTLIB) $(HELPERLIB) $(USELIBS)
LIBS = $(USELIBS) @LIBS@
PERLLDOPTS_FOR_APPS = @PERLLDOPTS_FOR_APPS@
PERLLDOPTS_FOR_LIBS = @PERLLDOPTS_FOR_LIBS@
#
# hack for compiling trapd when agent is disabled
TRAPDWITHAGENT = $(USETRAPLIBS) @AGENTLIBS@
TRAPDWITHOUTAGENT = $(LIBS)
# these will be set by configure to one of the above 2 lines
TRAPLIBS = @TRAPLIBS@ $(PERLLDOPTS_FOR_APPS)
USETRAPLIBS = @USETRAPLIBS@
CPPFLAGS = $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(HELPER_INCLUDES) \
$(MIBGROUP_INCLUDES) $(SNMPLIB_INCLUDES) @CPPFLAGS@
OSUFFIX = lo
TRAPD_OBJECTS = snmptrapd.$(OSUFFIX) @other_trapd_objects@
LIBTRAPD_OBJS = snmptrapd_handlers.o snmptrapd_log.o \
snmptrapd_auth.o
LLIBTRAPD_OBJS = snmptrapd_handlers.lo snmptrapd_log.lo \
snmptrapd_auth.lo
OBJS = *.o
LOBJS = *.lo
all: standardall
OTHERINSTALL=snmpinforminstall snmptrapdperlinstall
OTHERUNINSTALL=snmpinformuninstall snmptrapdperluninstall
#
# build rules
#
snmpwalk$(EXEEXT): snmpwalk.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpwalk.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpbulkwalk$(EXEEXT): snmpbulkwalk.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpbulkwalk.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpbulkget$(EXEEXT): snmpbulkget.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpbulkget.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmptranslate$(EXEEXT): snmptranslate.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmptranslate.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpstatus$(EXEEXT): snmpstatus.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpstatus.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpget$(EXEEXT): snmpget.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpget.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpdelta$(EXEEXT): snmpdelta.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpdelta.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmptable$(EXEEXT): snmptable.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmptable.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmptest$(EXEEXT): snmptest.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
$(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS}
snmptrap$(EXEEXT): snmptrap.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpinform$(EXEEXT): snmptrap$(EXEEXT)
rm -f snmpinform
$(LN_S) snmptrap$(EXEEXT) snmpinform$(EXEEXT)
snmpset$(EXEEXT): snmpset.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpset.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpusm$(EXEEXT): snmpusm.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpusm.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpvacm$(EXEEXT): snmpvacm.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpvacm.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpgetnext$(EXEEXT): snmpgetnext.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpgetnext.$(OSUFFIX) ${LDFLAGS} ${LIBS}
encode_keychange$(EXEEXT): encode_keychange.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ encode_keychange.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpdf$(EXEEXT): snmpdf.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpdf.$(OSUFFIX) ${LDFLAGS} ${LIBS}
libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS)
$(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS)
$(RANLIB) $@
snmpinforminstall:
rm -f $(INSTALL_PREFIX)$(bindir)/snmpinform$(EXEEXT)
$(LN_S) snmptrap$(EXEEXT) $(INSTALL_PREFIX)$(bindir)/snmpinform$(EXEEXT)
snmpinformuninstall:
rm -f $(INSTALL_PREFIX)$(bindir)/snmpinform$(EXEEXT)
snmptrapdperlinstall: installdirs
@$(INSTALL_DATA) $(srcdir)/snmp_perl_trapd.pl $(INSTALL_PREFIX)$(snmplibdir)/snmp_perl_trapd.pl
@echo "install: installed snmp_perl_trapd.pl in $(INSTALL_PREFIX)$(snmplibdir)"
snmptrapdperluninstall: installdirs
@rm -f $(INSTALL_PREFIX)$(snmplibdir)/snmp_perl_trapd.pl
@echo "removed snmp_perl_trapd.pl from $(INSTALL_PREFIX)$(snmplibdir)"
installdirs:
@$(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(snmplibdir)