2 # Makefile.in (at the root of net-snmp)
7 SUBDIRS = snmplib agent apps local man mibs
11 -Iinclude -I$(srcdir)/include -I$(srcdir)/agent/mibgroup -I. -I$(srcdir) \
12 -DDONT_INC_STRUCTS -DBINDIR=$(bindir) \
15 INSTALLHEADERS=version.h
17 INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi.h cygwin.h darwin.h \
18 dynix.h freebsd2.h freebsd3.h freebsd4.h freebsd.h generic.h hpux.h \
19 irix.h linux.h mips.h netbsd.h openbsd.h solaris2.6.h solaris2.7.h \
20 solaris2.8.h solaris2.9.h solaris.h sunos.h svr5.h sysv.h ultrix4.h
21 INCLUDESUBDIR2=machine
22 INCLUDESUBDIRHEADERS2=generic.h
23 INSTALLBUILTHEADERS=include/net-snmp/net-snmp-config.h
24 INSTALLBINSCRIPTS=net-snmp-config
25 INSTALLUCDHEADERS=ucd-snmp-config.h version.h mib_module_config.h
28 # other install rules.
30 OTHERINSTALL=copypersistentfiles @PERLINSTALLTARGS@
31 COPY_PERSISTENT_FILES=@COPY_PERSISTENT_FILES@
32 PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
33 UCDPERSISTENT_DIRECTORY=@UCDPERSISTENT_DIRECTORY@
38 # yes, order matters here. default_store must occur before anything else
39 PERLMODULES=default_store SNMP ASN OID agent
44 all: sedscript EXAMPLE.conf standardall net-snmp-config-x @PERLTARGS@
47 @touch build-in-progress-flag
50 @rm -f build-in-progress-flag > /dev/null 2>&1
55 sedscript: sedscript.in include/net-snmp/net-snmp-config.h $(srcdir)/agent/mibgroup/mibdefs.h
56 $(CPP) $(srcdir)/sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
57 echo 's#DATADIR#$(datadir)#g' >> sedscript
58 echo 's#LIBDIR#$(libdir)#g' >> sedscript
59 echo 's#BINDIR#$(bindir)#g' >> sedscript
60 echo 's#PERSISTENT_DIRECTORY#$(PERSISTENT_DIRECTORY)#g' >> sedscript
61 echo 's#SYSCONFDIR#$(sysconfdir)#g' >> sedscript
63 EXAMPLE.conf: sedscript EXAMPLE.conf.def
64 $(SED) -f sedscript $(srcdir)/EXAMPLE.conf.def > EXAMPLE.conf
68 docsdir: docsdox docsmunge
71 srcdir=$(srcdir) doxygen $(srcdir)/doxygen.conf
74 find docs/html -name \*.html -exec perl -p -i -e 's/Generated on/<!--#include virtual=\"\/sfbutton.html\" --><br>Generated on\n/; s/<body/<body bgcolor=white/' {} \;
78 @for i in docs/man/man3/* ; do \
79 cp $$i man/netsnmp_`basename $$i` ; \
82 net-snmp-config-x: net-snmp-config
83 chmod a+x net-snmp-config
84 touch net-snmp-config-x
91 @if test "$(COPY_PERSISTENT_FILES)" = "yes" -a -d $(UCDPERSISTENT_DIRECTORY) -a ! -d $(PERSISTENT_DIRECTORY) ; then \
92 cp -pr $(UCDPERSISTENT_DIRECTORY) $(PERSISTENT_DIRECTORY) ; \
93 echo "copying $(UCDPERSISTENT_DIRECTORY) to $(PERSISTENT_DIRECTORY)" ; \
99 ( cd testing; $(MAKE) test )
102 for i in $(TESTDIRS) ; do \
103 ( cd $$i ; $(MAKE) ) ; \
104 if test $$? != 0 ; then \
109 distall: ${srcdir}/configure ${srcdir}/include/net-snmp/net-snmp-config.h
111 OTHERCLEANTARGETS=EXAMPLE.conf sedscript
112 OTHERCLEANTODOS=perlclean
115 # perl specific build rules
117 perlmodules: perlmakefiles
118 @(cd perl ; $(MAKE)) ; \
119 if test $$? != 0 ; then \
124 @if test ! -f perl/Makefile; then \
127 perl Makefile.PL -NET-SNMP-IN-SOURCE=true -NET-SNMP-CONFIG="sh $$dir/net-snmp-config") ; \
131 @(cd perl ; $(MAKE) install) ; \
132 if test $$? != 0 ; then \
137 @(cd perl ; $(MAKE) test) ; \
138 if test $$? != 0 ; then \
143 @if test -f perl/Makefile; then \
144 ( cd perl ; $(MAKE) clean ) ; \
148 # make distclean completely removes all traces of building including
149 # any files generated by configure itself.
151 distclean: clean configclean tarclean
154 rm -f Makefile snmplib/Makefile \
155 agent/Makefile agent/mibgroup/Makefile \
156 agent/helpers/Makefile \
157 apps/Makefile apps/snmpnetstat/Makefile \
158 man/Makefile mibs/Makefile ov/Makefile \
159 local/Makefile testing/Makefile
161 configclean: makefileclean
162 rm -f config.cache config.status config.log \
163 libtool include/net-snmp/net-snmp-config.h \
164 net-snmp-config net-snmp-config-x configure-summary
166 rm -f include/net-snmp/agent/mib_module_config.h \
167 snmplib/snmpsm_init.h \
168 agent/mibgroup/mib_module_includes.h \
169 agent/mibgroup/mib_module_inits.h \
170 agent/mibgroup/mib_module_shutdown.h \
171 agent/mibgroup/mib_module_dot_conf.h
175 # Configure script related targets
178 touch configure include/net-snmp/net-snmp-config.h.in
180 touch stamp-h stamp-h.in
182 Makefile: Makefile.in config.status Makefile.rules Makefile.top
183 @if test "x$(NOAUTODEPS)" = "x"; then \
186 echo "WARNING: not running config.status"; \
189 $(srcdir)/include/net-snmp/net-snmp-config.h.in: stamp-h.in
190 $(srcdir)/stamp-h.in: configure.in acconfig.h
191 @if test "x$(NOAUTODEPS)" = "x" -a "x$(AUTOHEADER)" != "x:"; then \
192 cd ${srcdir} && LC_COLLATE=C $(AUTOHEADER); \
193 echo timestamp > ${srcdir}/stamp-h.in; \
195 echo "WARNING: not running autoheader"; \
198 include/net-snmp/net-snmp-config.h: stamp-h
199 stamp-h: include/net-snmp/net-snmp-config.h.in config.status
200 @if test "x$(NOAUTODEPS)" = "x"; then \
202 echo timestamp > stamp-h; \
204 echo "WARNING: not running config.status"; \
207 $(srcdir)/configure: configure.in aclocal.m4
208 @if test "x$(NOAUTODEPS)" = "x" -a "x$(AUTOCONF)" != "x:"; then \
209 cd ${srcdir} && $(AUTOCONF); \
210 echo "Please run configure now."; \
213 echo "WARNING: not running autoconf"; \
216 config.status: configure
217 @if test "x$(NOAUTODEPS)" = "x"; then \
218 ./config.status --recheck; \
220 echo "WARNING: not running config.status --recheck"; \
227 find $(srcdir) -name '*.[ch]' -print | etags -
230 # Internal distribution packaging, etc.
233 @if test "x$(VERSION)" = "x"; then \
234 echo "you need to supply a VERSION string."; \
237 ${srcdir}/agent/mibgroup/versiontag $(VERSION) reverse
240 @if test "x$(VERSION)" = "x"; then \
241 echo "you need to supply a VERSION string."; \
244 ${srcdir}/agent/mibgroup/versiontag $(VERSION) tag
247 @if test "x$(VERSION)" = "x"; then \
248 echo "you need to supply a VERSION string."; \
251 ${srcdir}/agent/mibgroup/versiontag $(VERSION) tar
254 @if test -x ${srcdir}/agent/mibgroup/versiontag ; then \
255 ${srcdir}/agent/mibgroup/versiontag Ext clean ; \
259 grep -n // `find $(srcdir)/ -name \*.\[ch\]` | egrep -v "(ftp|http|/win32/)"
261 dist: version tag tar
266 .PHONY: docs docsdir mancp testdirs test TAGS
267 # note: tags and docs are phony to force rebulding