3 # standard target definitions. Set appropriate variables to make use of them.
5 # note: the strange use of the "it" variable is for shell parsing when
6 # there is no targets to install for that rule.
9 # the standard items to build: libraries, bins, and sbins
10 STANDARDTARGETS =$(INSTALLLIBS) $(INSTALLBINPROGS) $(INSTALLSBINPROGS)
11 STANDARDCLEANTARGETS=$(INSTALLLIBS) $(INSTALLBINPROGS) $(INSTALLSBINPROGS) $(INSTALLUCDLIBS)
13 standardall: subdirs $(STANDARDTARGETS)
16 @if test "$(SUBDIRS)" != ""; then \
19 echo "making all in `pwd`/$$i"; \
20 ( cd $$i ; $(MAKE) ) ; \
21 if test $$? != 0 ; then \
27 install: installlocalheaders @installucdheaders@ \
28 installlocallibs @installucdlibs@ \
29 installlocalbin installlocalsbin \
30 installsubdirs $(OTHERINSTALL)
32 installprogs: installbin installsbin
37 # set INSTALLHEADERS to a list of things to install in each makefile.
38 # set INSTALLBUILTHEADERS to a list of things to install from builddir
39 # set INSTALLSUBDIRHEADERS and INSTALLSUBDIR to subdirectory headers
40 # set INSTALLSUBDIRHEADERS2 and INSTALLSUBDIR2 to more subdirectory headers
41 # set INSTALLBUILTSUBDIRHEADERS and INSTALLBUILTSUBDIR to a list from builddir
43 installheaders: installlocalheaders @installucdheaders@ installsubdirheaders
46 @if test "$(INSTALLHEADERS)" != "" ; then \
47 echo creating directory $(includedir) ; \
48 it="$(INSTALLHEADERS)" ; \
49 $(SHELL) $(top_srcdir)/mkinstalldirs $(includedir) ; \
51 $(INSTALL) $(top_srcdir)/include/net-snmp/$$i $(includedir) ; \
52 echo "installing $$i in $(includedir)" ; \
55 @if test "$(INSTALLBUILTHEADERS)" != "" ; then \
56 echo creating directory $(includedir) ; \
57 it="$(INSTALLBUILTHEADERS)" ; \
58 $(SHELL) $(top_srcdir)/mkinstalldirs $(includedir) ; \
60 $(INSTALL) $$i $(includedir) ; \
61 echo "installing $$i in $(includedir)" ; \
64 @if test "$(INCLUDESUBDIRHEADERS)" != "" ; then \
65 echo creating directory $(includedir)/$(INCLUDESUBDIR) ; \
66 it="$(INCLUDESUBDIRHEADERS)" ; \
67 $(SHELL) $(top_srcdir)/mkinstalldirs $(includedir)/$(INCLUDESUBDIR) ; \
69 $(INSTALL) $(top_srcdir)/include/net-snmp/$(INCLUDESUBDIR)/$$i $(includedir)/$(INCLUDESUBDIR) ; \
70 echo "installing $$i in $(includedir)/$(INCLUDESUBDIR)" ; \
73 @if test "$(INCLUDESUBDIRHEADERS2)" != "" ; then \
74 echo creating directory $(includedir)/$(INCLUDESUBDIR2) ; \
75 it="$(INCLUDESUBDIRHEADERS2)" ; \
76 $(SHELL) $(top_srcdir)/mkinstalldirs $(includedir)/$(INCLUDESUBDIR2) ; \
78 $(INSTALL) $(top_srcdir)/include/net-snmp/$(INCLUDESUBDIR2)/$$i $(includedir)/$(INCLUDESUBDIR2) ; \
79 echo "installing $$i in $(includedir)/$(INCLUDESUBDIR2)" ; \
82 @if test "$(INSTALLBUILTSUBDIRHEADERS)" != "" ; then \
83 echo creating directory $(includedir)/$(INSTALLBUILTSUBDIR) ; \
84 it="$(INSTALLBUILTSUBDIRHEADERS)" ; \
85 $(SHELL) $(top_srcdir)/mkinstalldirs $(includedir)/$(INSTALLBUILTSUBDIR) ; \
87 $(INSTALL) $$i $(includedir)/$(INSTALLBUILTSUBDIR) ; \
88 echo "installing $$i in $(includedir)/$(INSTALLBUILTSUBDIR)" ; \
93 @if test "$(SUBDIRS)" != ""; then \
96 echo "making installheaders in `pwd`/$$i"; \
97 ( cd $$i ; $(MAKE) installheaders) ; \
98 if test $$? != 0 ; then \
105 @if test "$(INSTALLUCDHEADERS)" != "" ; then \
106 echo creating directory $(ucdincludedir) ; \
107 it="$(INSTALLUCDHEADERS)" ; \
108 $(SHELL) $(top_srcdir)/mkinstalldirs $(ucdincludedir) ; \
110 $(INSTALL) $(top_srcdir)/include/ucd-snmp/$$i $(ucdincludedir) ; \
111 echo "installing $$i in $(ucdincludedir)" ; \
118 # set INSTALLLIBS to a list of things to install in each makefile.
120 installlibs: installlocallibs @installucdlibs@ installsubdirlibs
122 installlocallibs: $(INSTALLLIBS)
123 @if test "$(INSTALLLIBS)" != ""; then \
124 it="$(INSTALLLIBS)" ; \
125 $(SHELL) $(top_srcdir)/mkinstalldirs $(libdir) ; \
126 $(INSTALL) $(INSTALLLIBS) $(libdir) ; \
128 echo "installing $$i in $(libdir)"; \
129 $(RANLIB) $(libdir)/$$i ; \
131 $(LIB_LDCONFIG_CMD) ; \
134 installucdlibs: $(INSTALLUCDLIBS)
135 @if test "$(INSTALLUCDLIBS)" != ""; then \
136 it="$(INSTALLUCDLIBS)" ; \
137 $(SHELL) $(top_srcdir)/mkinstalldirs $(libdir) ; \
138 $(INSTALL) $(INSTALLUCDLIBS) $(libdir) ; \
140 echo "installing $$i in $(libdir)"; \
141 $(RANLIB) $(libdir)/$$i ; \
143 $(LIB_LDCONFIG_CMD) ; \
147 @if test "$(SUBDIRS)" != ""; then \
150 echo "making installlibs in `pwd`/$$i"; \
151 ( cd $$i ; $(MAKE) installlibs) ; \
152 if test $$? != 0 ; then \
159 # normal bin binaries
161 # set INSTALLBINPROGS to a list of things to install in each makefile.
163 installbin: installlocalbin installsubdirbin
165 installlocalbin: $(INSTALLBINPROGS)
166 @if test "$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" != " "; then \
167 $(SHELL) $(top_srcdir)/mkinstalldirs $(bindir) ; \
168 it="$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" ; \
169 $(INSTALL) $(INSTALLBINPROGS) $(INSTALLBINSCRIPTS) $(bindir) ; \
171 echo "installing $$i in $(bindir)"; \
176 @if test "$(SUBDIRS)" != ""; then \
179 echo "making installbin in `pwd`/$$i"; \
180 ( cd $$i ; $(MAKE) installbin) ; \
181 if test $$? != 0 ; then \
190 # set INSTALLSBINPROGS to a list of things to install in each makefile.
192 installsbin: installlocalsbin installsubdirsbin
194 installlocalsbin: $(INSTALLSBINPROGS)
195 @if test "$(INSTALLSBINPROGS)" != ""; then \
196 it="$(INSTALLSBINPROGS)" ; \
197 $(SHELL) $(top_srcdir)/mkinstalldirs $(sbindir) ; \
198 $(INSTALL) $(INSTALLSBINPROGS) $(sbindir) ; \
200 echo "installing $$i in $(sbindir)"; \
205 @if test "$(SUBDIRS)" != ""; then \
208 echo "making installsbin in `pwd`/$$i"; \
209 ( cd $$i ; $(MAKE) installsbin) ; \
210 if test $$? != 0 ; then \
217 # general make install target for subdirs
220 @if test "$(SUBDIRS)" != ""; then \
223 echo "making install in `pwd`/$$i"; \
224 ( cd $$i ; $(MAKE) install) ; \
225 if test $$? != 0 ; then \
234 clean: cleansubdirs $(OTHERCLEANTODOS)
235 rm -f core ${OBJS} ${LOBJS} $(STANDARDCLEANTARGETS) $(OTHERCLEANTARGETS)
239 @if test "$(SUBDIRS)" != ""; then \
242 echo "making clean in `pwd`/$$i"; \
243 ( cd $$i ; $(MAKE) clean) ; \
244 if test $$? != 0 ; then \
254 # wacky dependency building.
257 @if test -f Makefile.depend ; then \
258 makedepend `echo $(CPPFLAGS) | sed 's/-f[-a-z]*//g'` -o .lo $(srcdir)/*.c $(srcdir)/*/*.c ; \
262 nosysdepend: nosysdependdirs
263 @if test -f Makefile.depend ; then \
264 makedepend `echo $(CPPFLAGS) | sed 's/-f[-a-z]*//g'` -o .lo $(srcdir)/*.c $(srcdir)/*/*.c ; \
265 perl -n -i.bak $(top_srcdir)/makenosysdepend.pl Makefile ; \
268 distdepend: nosysdepend distdependdirs
269 @if test -f Makefile.depend ; then \
270 perl $(top_srcdir)/makefileindepend.pl ; \
274 @if test "$(SUBDIRS)" != ""; then \
277 echo "making depend in `pwd`/$$i"; \
278 ( cd $$i ; $(MAKE) depend) ; \
279 if test $$? != 0 ; then \
286 @if test "$(SUBDIRS)" != ""; then \
289 echo "making nosysdepend in `pwd`/$$i"; \
290 ( cd $$i ; $(MAKE) nosysdepend) ; \
291 if test $$? != 0 ; then \
298 @if test "$(SUBDIRS)" != ""; then \
301 echo "making distdepend in `pwd`/$$i"; \
302 ( cd $$i ; $(MAKE) distdepend) ; \
303 if test $$? != 0 ; then \
309 # These aren't real targets, let gnu's make know that.
310 .PHONY: clean cleansubdirs lint \
311 install installprogs installheaders installlibs \
312 installbin installsbin installsubdirs \
313 all subdirs standardall \
314 depend nosysdepend distdepend dependdirs nosysdependdirs distdependdirs