Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / Makefile.in
1 #
2 # Makefile.in (at the root of net-snmp)
3 #
4
5 top_builddir    = .
6
7 SUBDIRS         = snmplib agent apps local man mibs
8 TESTDIRS        = testing
9
10 CPP             = @CPP@                                                 \
11                 -Iinclude -I$(srcdir)/include -I$(srcdir)/agent/mibgroup -I. -I$(srcdir)        \
12                 -DDONT_INC_STRUCTS -DBINDIR=$(bindir)                   \
13                 $(EXTRACPPFLAGS)
14
15 INSTALLHEADERS=version.h
16 INCLUDESUBDIR=system
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
26
27 #
28 # other install rules.
29 #
30 OTHERINSTALL=copypersistentfiles @PERLINSTALLTARGS@
31 COPY_PERSISTENT_FILES=@COPY_PERSISTENT_FILES@
32 PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
33 UCDPERSISTENT_DIRECTORY=@UCDPERSISTENT_DIRECTORY@
34
35 #
36 # perl specific
37 #
38 # yes, order matters here.  default_store must occur before anything else
39 PERLMODULES=default_store SNMP ASN OID agent
40
41 #
42 # targets
43 #
44 all:    sedscript EXAMPLE.conf standardall net-snmp-config-x @PERLTARGS@ 
45
46 start-flag:
47         @touch build-in-progress-flag
48
49 end-flag:
50         @rm -f build-in-progress-flag > /dev/null 2>&1 
51
52 #
53 # local build rules
54 #
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
62
63 EXAMPLE.conf: sedscript EXAMPLE.conf.def
64         $(SED) -f sedscript $(srcdir)/EXAMPLE.conf.def > EXAMPLE.conf
65
66 docs: docsdir mancp
67
68 docsdir: docsdox docsmunge
69
70 docsdox: doxygen.conf
71         srcdir=$(srcdir) doxygen $(srcdir)/doxygen.conf
72
73 docsmunge:
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/' {} \;
75
76
77 mancp:
78         @for i in docs/man/man3/* ; do \
79              cp $$i man/netsnmp_`basename $$i` ; \
80         done
81
82 net-snmp-config-x: net-snmp-config
83         chmod a+x net-snmp-config
84         touch net-snmp-config-x
85
86 #
87 # extra install rules
88 #
89
90 copypersistentfiles:
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)" ; \
94         fi
95 #
96 # test targets
97 #
98 test: all testdirs
99         ( cd testing; $(MAKE) test )
100
101 testdirs:
102         for i in $(TESTDIRS) ; do       \
103            ( cd $$i ; $(MAKE) ) ;               \
104            if test $$? != 0 ; then \
105               exit 1 ; \
106            fi  \
107         done
108
109 distall: ${srcdir}/configure ${srcdir}/include/net-snmp/net-snmp-config.h 
110
111 OTHERCLEANTARGETS=EXAMPLE.conf sedscript
112 OTHERCLEANTODOS=perlclean
113
114 #
115 # perl specific build rules
116 #
117 perlmodules: perlmakefiles
118         @(cd perl ; $(MAKE)) ; \
119         if test $$? != 0 ; then \
120            exit 1 ; \
121         fi  \
122
123 perlmakefiles:
124         @if test ! -f perl/Makefile; then \
125           (dir=`pwd`; \
126            cd perl ; \
127            perl Makefile.PL -NET-SNMP-IN-SOURCE=true -NET-SNMP-CONFIG="sh $$dir/net-snmp-config") ; \
128         fi ; \
129
130 perlinstall:
131         @(cd perl ; $(MAKE) install) ; \
132         if test $$? != 0 ; then \
133            exit 1 ; \
134         fi  \
135
136 perltest:
137         @(cd perl ; $(MAKE) test) ; \
138         if test $$? != 0 ; then \
139            exit 1 ; \
140         fi  \
141
142 perlclean:
143         @if test -f perl/Makefile; then \
144            ( cd perl ; $(MAKE) clean ) ; \
145         fi ; \
146
147 #
148 # make distclean completely removes all traces of building including
149 # any files generated by configure itself.
150 #
151 distclean: clean configclean tarclean
152
153 makefileclean:
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
160
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
165         rm -f mibs/.index
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
172         rm -f *.core
173
174 #
175 # Configure script related targets
176 #
177 touchit:
178         touch configure include/net-snmp/net-snmp-config.h.in
179         touch config.status
180         touch stamp-h stamp-h.in
181
182 Makefile: Makefile.in config.status Makefile.rules Makefile.top
183         @if test "x$(NOAUTODEPS)" = "x"; then \
184             ./config.status; \
185         else \
186             echo "WARNING: not running config.status"; \
187         fi
188
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; \
194         else \
195             echo "WARNING: not running autoheader"; \
196         fi
197
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 \
201             ./config.status; \
202             echo timestamp > stamp-h; \
203         else \
204             echo "WARNING: not running config.status"; \
205         fi
206
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."; \
211             sh -c exit 2; \
212         else \
213             echo "WARNING: not running autoconf"; \
214         fi
215
216 config.status: configure
217         @if test "x$(NOAUTODEPS)" = "x"; then \
218             ./config.status --recheck; \
219         else \
220             echo "WARNING: not running config.status --recheck"; \
221         fi
222
223 #
224 # Emacs TAGS file
225 #
226 TAGS:
227         find $(srcdir) -name '*.[ch]' -print | etags -
228
229 #
230 # Internal distribution packaging, etc.
231 #
232 version:
233         @if test "x$(VERSION)" = "x"; then \
234           echo "you need to supply a VERSION string."; \
235           exit 2; \
236         fi
237         ${srcdir}/agent/mibgroup/versiontag $(VERSION) reverse
238
239 tag:
240         @if test "x$(VERSION)" = "x"; then \
241           echo "you need to supply a VERSION string."; \
242           exit 2; \
243         fi
244         ${srcdir}/agent/mibgroup/versiontag $(VERSION) tag
245
246 tar:
247         @if test "x$(VERSION)" = "x"; then \
248           echo "you need to supply a VERSION string."; \
249           exit 2; \
250         fi
251         ${srcdir}/agent/mibgroup/versiontag $(VERSION) tar
252
253 tarclean:
254         @if test -x ${srcdir}/agent/mibgroup/versiontag ; then \
255           ${srcdir}/agent/mibgroup/versiontag Ext clean ; \
256         fi
257
258 commentcheck:
259         grep -n // `find $(srcdir)/ -name \*.\[ch\]` | egrep -v "(ftp|http|/win32/)"
260
261 dist: version tag tar
262
263 FAQ.html:
264         local/FAQ2HTML FAQ
265
266 .PHONY: docs docsdir mancp testdirs test TAGS
267 # note: tags and docs are phony to force rebulding