252N/A#
252N/A# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
252N/A#
252N/A# U.S. Government Rights - Commercial software. Government users are subject
252N/A# to the Sun Microsystems, Inc. standard license agreement and applicable
252N/A# provisions of the FAR and its supplements.
252N/A#
252N/A# Use is subject to license terms.
252N/A#
252N/A# This distribution may include materials developed by third parties. Sun,
252N/A# Sun Microsystems, the Sun logo and Solaris are trademarks or registered
252N/A# trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
252N/A#
252N/A#
252N/A#
252N/A#
252N/A#
252N/A# Makefile to generate demo_module_8.so
252N/A#
252N/A# usage:
252N/A# setenv CC /usr/bin/cc (or correct path)
252N/A# "make" : generate library for 64bit
252N/A# "make ARCH=32" : generate library for 32bit
252N/A# "make clean" : remove *.o , *.so
252N/A#
252N/A
252N/AINSTALL_PATH=/usr
252N/AARCH=64
252N/A#LDFLAGS_64=-g -m64 -I$(INSTALL_PATH)/include -I.
252N/A#LDFLAGS_32=-g -I$(INSTALL_PATH)/include -I.
252N/A#LDFLAGS=$(LDFLAGS_$(ARCH))
252N/A
252N/AOBJS1=demo_module_8.o me1LoadGroup.so
252N/ATARGETS=demo_module_8
252N/ALD=/usr/ccs/bin/ld
252N/A
252N/ACFLAGS=-I. `$(INSTALL_PATH)/bin/net-snmp-config-$(ARCH) --cflags`
252N/ABUILDLIBS=`$(INSTALL_PATH)/bin/net-snmp-config-$(ARCH) --libs`
252N/ABUILDAGENTLIBS=`$(INSTALL_PATH)/bin/net-snmp-config-$(ARCH) --agent-libs`
252N/A
252N/A# shared library flags (assumes gcc)
252N/A#DLFLAGS=-fPIC -shared
252N/A# shared library flags (assumes cc)
252N/ADLFLAGS=-dy -G
252N/A
252N/A# compile subagent
252N/Aall: $(TARGETS)
252N/A
252N/A# link subagent object, shared library module, and agent libs
252N/A# and output demo_module_8, the subagent.
252N/Ademo_module_8: $(OBJS1)
252N/A $(CC) -o demo_module_8 $(OBJS1) $(BUILDLIBS) $(BUILDAGENTLIBS)
252N/A
252N/Aclean:
252N/A rm $(OBJS1) $(TARGETS)
252N/A
252N/A# compile module source, producing module object file
252N/A# produce (-G) and load module shared object from module object file,
252N/A# using dynamic linking (-dy)
252N/Ame1LoadGroup.so: me1LoadGroup.o Makefile
252N/A $(CC) $(CFLAGS) -c -o me1LoadGroup.o me1LoadGroup.c
252N/A $(LD) $(DLFLAGS) -o me1LoadGroup.so me1LoadGroup.o
252N/A