home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / snmp / mib2c-data / mfd-makefile.m2m < prev    next >
Encoding:
Text File  |  2007-02-07  |  3.4 KB  |  131 lines

  1. ####################################################### -*- Makefile -*-
  2. ## $Id: mfd-makefile.m2m,v 1.11 2004/03/29 23:39:53 rstory Exp $
  3. ##
  4. ########################################################################
  5. @if $m2c_mark_boundary == 1@
  6. # START code generated by $RCSfile: mfd-makefile.m2m,v $ $Revision: 1.11 $
  7. @end@
  8. ########################################################################
  9. ##
  10. @strict token off@
  11. @open ${name}_Makefile@
  12. @ifconf ${name}_Makefile.m2m@
  13. @   include ${name}_Makefile.m2m@
  14. @else@
  15. CC=gcc
  16.  
  17. @if "$mfd_netsnmp_dir" ne ""@
  18. NETSNMPDIR=$mfd_netsnmp_dir
  19. NETSNMPCONFIG=$(NETSNMPDIR)/net-snmp-config
  20. @else@
  21. NETSNMPCONFIG=net-snmp-config
  22. @end@
  23.  
  24. @if "$mfd_netsnmp_dir" ne ""@
  25.  
  26. # Assuming we're linking against a Net-SNMP build tree (which may or
  27. # may not be the same as the source tree) and not an installed package.
  28.  
  29. # Note: to do this we REQUIRE gnu-make.
  30.  
  31. NETSNMPBASECFLAGS := $(shell $(NETSNMPCONFIG) --base-cflags)
  32. NETSNMPINCLUDES := $(shell $(NETSNMPCONFIG) --build-includes $(NETSNMPDIR))
  33. # base flags after build/src include, in case it has /usr/local/include
  34. NETSNMPCFLAGS=$(NETSNMPINCLUDES) $(NETSNMPBASECFLAGS)
  35.  
  36. NETSNMPBASELIBS := $(shell $(NETSNMPCONFIG) --base-agent-libs)
  37. NETSNMPEXTLIBS := $(shell $(NETSNMPCONFIG) --external-agent-libs)
  38. NETSNMPLIBDIRS := $(shell $(NETSNMPCONFIG) --build-lib-dirs $(NETSNMPDIR))
  39. NETSNMPLIBDEPS := $(shell $(NETSNMPCONFIG) --build-lib-deps $(NETSNMPDIR))
  40. LIB_DEPS=$(NETSNMPLIBDEPS)
  41. LIBS=$(NETSNMPLIBDIRS) -Wl,-Bstatic $(NETSNMPBASELIBS) -Wl,-Bdynamic $(NETSNMPEXTLIBS)
  42.  
  43. @else@
  44.  
  45. # uncomment this if you have GNU make
  46. #NETSNMPCFLAGS := $(shell $(NETSNMPCONFIG) --base-cflags)
  47. #NETSNMPLIBS := $(shell $(NETSNMPCONFIG) --agent-libs)
  48. NETSNMPCFLAGS=`$(NETSNMPCONFIG) --base-cflags`
  49. NETSNMPLIBS=`$(NETSNMPCONFIG) --agent-libs`
  50.  
  51. LIBS=$(NETSNMPLIBS)
  52.  
  53. @end@
  54.  
  55. STRICT_FLAGS = -Wall -Wstrict-prototypes
  56. CFLAGS=-I. $(NETSNMPCFLAGS) $(STRICT_FLAGS)
  57.  
  58. USER_SRCS = \
  59. @if $m2c_create_fewer_files != 1@
  60.     ${name}_data_get.c \
  61.     ${name}_data_set.c \
  62. @end@
  63.     ${name}_data_access.c
  64.  
  65. SRCS = $(USER_SRCS) \
  66.     ${name}.c \
  67.     ${name}_subagent.c \
  68.     ${name}_interface.c
  69.  
  70. USER_OBJS =  \
  71. @if $m2c_create_fewer_files != 1@
  72.     ${name}_data_get.o \
  73.     ${name}_data_set.o \
  74. @end@
  75.     ${name}_data_access.o 
  76.  
  77. OBJS =  $(USER_OBJS) \
  78.     ${name}.o \
  79.     ${name}_subagent.o \
  80.     ${name}_interface.o
  81.  
  82. TARGETS=${name}
  83.  
  84. .SUFFIXES:
  85. .SUFFIXES: .c .o .deps
  86.  
  87.  
  88. all: $(TARGETS)
  89.  
  90. user: $(USER_OBJS)
  91.  
  92. $(TARGETS): $(LIB_DEPS)
  93.  
  94. ${name}: $(OBJS) ${name}_Makefile
  95.     $(CC) -o ${name} $(OBJS) $(LIBS)
  96.  
  97. clean:
  98.     rm -f $(OBJS) $(TARGETS)
  99.  
  100. @if "$mfd_netsnmp_dir" ne ""@
  101.  
  102. ${name}.deps ${name}_subagent.deps ${name}_interface.deps: ${name}_Makefile
  103. ${name}_data_access.deps:                                  ${name}_Makefile
  104. @if $m2c_create_fewer_files != 1@
  105. ${name}_data_get.deps:                                     ${name}_Makefile
  106. ${name}_data_set.deps:                                     ${name}_Makefile
  107. @end@
  108.  
  109. %.deps : %.c
  110.     @echo "Generating makefile $@ ..."
  111.     @set -e; $(CC) -M $(COPTS) $(CFLAGS) $(CPPFLAGS) $< \
  112.     | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
  113.     [ -s $@ ] || $(RM) $(RMFLAGS) $@
  114.  
  115. include ${name}.deps
  116. include ${name}_subagent.deps
  117. include ${name}_interface.deps
  118. include ${name}_data_access.deps
  119. @if $m2c_create_fewer_files != 1@
  120. include ${name}_data_get.deps
  121. include ${name}_data_set.deps
  122. @end@
  123. @end@
  124.  
  125.  
  126. @end@
  127. ########################################################################
  128. @if $m2c_mark_boundary == 1@
  129. # END code generated by $RCSfile: mfd-makefile.m2m,v $ $Revision: 1.11 $
  130. @end@
  131.