2 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
4 # U.S. Government Rights - Commercial software. Government users are subject
5 # to the Sun Microsystems, Inc. standard license agreement and applicable
6 # provisions of the FAR and its supplements.
8 # Use is subject to license terms.
10 # This distribution may include materials developed by third parties. Sun,
11 # Sun Microsystems, the Sun logo and Solaris are trademarks or registered
12 # trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
18 # Makefile to generate demo_module_8.so
21 # setenv CC /usr/bin/cc (or correct path)
22 # "make" : generate library for 64bit
23 # "make ARCH=32" : generate library for 32bit
24 # "make clean" : remove *.o , *.so
29 #LDFLAGS_64=-g -m64 -I$(INSTALL_PATH)/include -I.
30 #LDFLAGS_32=-g -I$(INSTALL_PATH)/include -I.
31 #LDFLAGS=$(LDFLAGS_$(ARCH))
33 OBJS1
=demo_module_8.o me1LoadGroup.so
37 CFLAGS
=-I.
`$(INSTALL_PATH)/bin/net-snmp-config-$(ARCH) --cflags`
38 BUILDLIBS
=`$(INSTALL_PATH)/bin/net-snmp-config-$(ARCH) --libs`
39 BUILDAGENTLIBS
=`$(INSTALL_PATH)/bin/net-snmp-config-$(ARCH) --agent-libs`
41 # shared library flags (assumes gcc)
42 #DLFLAGS=-fPIC -shared
43 # shared library flags (assumes cc)
49 # link subagent object, shared library module, and agent libs
50 # and output demo_module_8, the subagent.
51 demo_module_8
: $(OBJS1
)
52 $(CC
) -o demo_module_8
$(OBJS1
) $(BUILDLIBS
) $(BUILDAGENTLIBS
)
55 rm $(OBJS1
) $(TARGETS
)
57 # compile module source, producing module object file
58 # produce (-G) and load module shared object from module object file,
59 # using dynamic linking (-dy)
60 me1LoadGroup.so
: me1LoadGroup.o Makefile
61 $(CC
) $(CFLAGS
) -c
-o me1LoadGroup.o me1LoadGroup.c
62 $(LD
) $(DLFLAGS
) -o me1LoadGroup.so me1LoadGroup.o