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
# installlibs handles local, ucd and subdir libs. need to do subdir libs
28
# before bins, sinze those libs may be needed for successful linking
29
install: installlocalheaders @installucdheaders@ \
31
installlocalbin installlocalsbin \
32
installsubdirs $(OTHERINSTALL)
34
uninstall: uninstalllibs uninstallbin uninstallsbin uninstallheaders \
35
uninstallsubdirs $(OTHERUNINSTALL)
37
installprogs: installbin installsbin
42
# set INSTALLHEADERS to a list of things to install in each makefile.
43
# set INSTALLBUILTHEADERS to a list of things to install from builddir
44
# set INSTALLSUBDIRHEADERS and INSTALLSUBDIR to subdirectory headers
45
# set INSTALLSUBDIRHEADERS2 and INSTALLSUBDIR2 to more subdirectory headers
46
# set INSTALLBUILTSUBDIRHEADERS and INSTALLBUILTSUBDIR to a list from builddir
48
installheaders: installlocalheaders @installucdheaders@ installsubdirheaders
51
@if test "$(INSTALLHEADERS)" != "" ; then \
52
echo creating directory $(includedir) ; \
53
it="$(INSTALLHEADERS)" ; \
54
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir) ; \
56
$(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$$i $(INSTALL_PREFIX)$(includedir) ; \
57
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)" ; \
60
@if test "$(INSTALLBUILTHEADERS)" != "" ; then \
61
echo creating directory $(includedir) ; \
62
it="$(INSTALLBUILTHEADERS)" ; \
63
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir) ; \
65
$(INSTALL_DATA) $$i $(INSTALL_PREFIX)$(includedir) ; \
66
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)" ; \
69
@if test "$(INCLUDESUBDIRHEADERS)" != "" ; then \
70
echo creating directory $(includedir)/$(INCLUDESUBDIR) ; \
71
it="$(INCLUDESUBDIRHEADERS)" ; \
72
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR) ; \
74
$(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$(INCLUDESUBDIR)/$$i $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR) ; \
75
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)" ; \
78
@if test "$(INCLUDESUBDIRHEADERS2)" != "" ; then \
79
echo creating directory $(includedir)/$(INCLUDESUBDIR2) ; \
80
it="$(INCLUDESUBDIRHEADERS2)" ; \
81
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2) ; \
83
$(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$(INCLUDESUBDIR2)/$$i $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2) ; \
84
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)" ; \
87
@if test "$(INSTALLBUILTSUBDIRHEADERS)" != "" ; then \
88
echo creating directory $(includedir)/$(INSTALLBUILTSUBDIR) ; \
89
it="$(INSTALLBUILTSUBDIRHEADERS)" ; \
90
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR) ; \
92
$(INSTALL_DATA) $$i $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR) ; \
93
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)" ; \
98
@if test "$(INSTALLUCDHEADERS)" != "" ; then \
99
echo creating directory $(ucdincludedir) ; \
100
it="$(INSTALLUCDHEADERS)" ; \
101
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(ucdincludedir) ; \
103
$(INSTALL_DATA) $(top_srcdir)/include/ucd-snmp/$$i $(INSTALL_PREFIX)$(ucdincludedir) ; \
104
echo "installing $$i in $(INSTALL_PREFIX)$(ucdincludedir)" ; \
109
@if test "$(INSTALLHEADERS)" != "" ; then \
110
it="$(INSTALLHEADERS)" ; \
112
rm -f $(INSTALL_PREFIX)$(includedir)/$$i ; \
113
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)" ; \
116
@if test "$(INSTALLBUILTHEADERS)" != "" ; then \
117
it="$(INSTALLBUILTHEADERS)" ; \
119
rm -f $(INSTALL_PREFIX)$(includedir)/`basename $$i` ; \
120
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)" ; \
123
@if test "$(INCLUDESUBDIRHEADERS)" != "" ; then \
124
it="$(INCLUDESUBDIRHEADERS)" ; \
126
rm -f $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)/$$i ; \
127
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)" ; \
130
@if test "$(INCLUDESUBDIRHEADERS2)" != "" ; then \
131
it="$(INCLUDESUBDIRHEADERS2)" ; \
133
rm -f $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)/$$i ; \
134
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)" ; \
137
@if test "$(INSTALLBUILTSUBDIRHEADERS)" != "" ; then \
138
it="$(INSTALLBUILTSUBDIRHEADERS)" ; \
140
rm -f $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)/`basename $$i` ; \
141
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)" ; \
148
# set INSTALLLIBS to a list of things to install in each makefile.
150
installlibs: installlocallibs @installucdlibs@ installsubdirlibs
152
installlocallibs: $(INSTALLLIBS)
153
@if test "$(INSTALLLIBS)" != ""; then \
154
it="$(INSTALLLIBS)" ; \
155
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) ; \
156
$(INSTALL) $(INSTALLLIBS) $(INSTALL_PREFIX)$(libdir) ; \
158
echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
159
$(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
161
$(LIB_LDCONFIG_CMD) ; \
164
installucdlibs: $(INSTALLUCDLIBS)
165
@if test "$(INSTALLUCDLIBS)" != ""; then \
166
it="$(INSTALLUCDLIBS)" ; \
167
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) ; \
168
$(INSTALL) $(INSTALLUCDLIBS) $(INSTALL_PREFIX)$(libdir) ; \
170
echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
171
$(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
173
$(LIB_LDCONFIG_CMD) ; \
177
@if test "$(SUBDIRS)" != ""; then \
180
echo "making installlibs in `pwd`/$$i"; \
181
( cd $$i ; $(MAKE) installlibs) ; \
182
if test $$? != 0 ; then \
189
@if test "$(INSTALLLIBS)" != ""; then \
190
it="$(INSTALLLIBS)" ; \
192
$(UNINSTALL) $(INSTALL_PREFIX)$(libdir)/$$i ; \
193
echo "removing $$i from $(INSTALL_PREFIX)$(libdir)"; \
198
# normal bin binaries
200
# set INSTALLBINPROGS to a list of things to install in each makefile.
202
installbin: installlocalbin installsubdirbin
204
installlocalbin: $(INSTALLBINPROGS)
205
@if test "$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" != " "; then \
206
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(bindir) ; \
207
it="$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" ; \
208
$(INSTALL) $(INSTALLBINPROGS) $(INSTALLBINSCRIPTS) $(INSTALL_PREFIX)$(bindir) ; \
210
echo "installing $$i in $(INSTALL_PREFIX)$(bindir)"; \
215
@if test "$(SUBDIRS)" != ""; then \
218
echo "making installbin in `pwd`/$$i"; \
219
( cd $$i ; $(MAKE) installbin) ; \
220
if test $$? != 0 ; then \
227
@if test "$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" != " "; then \
228
it="$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" ; \
230
$(UNINSTALL) $(INSTALL_PREFIX)$(bindir)/$$i ; \
231
echo "removing $$i from $(INSTALL_PREFIX)$(bindir)"; \
238
# set INSTALLSBINPROGS to a list of things to install in each makefile.
240
installsbin: installlocalsbin installsubdirsbin
242
installlocalsbin: $(INSTALLSBINPROGS)
243
@if test "$(INSTALLSBINPROGS)" != ""; then \
244
it="$(INSTALLSBINPROGS)" ; \
245
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(sbindir) ; \
246
$(INSTALL) $(INSTALLSBINPROGS) $(INSTALL_PREFIX)$(sbindir) ; \
248
echo "installing $$i in $(INSTALL_PREFIX)$(sbindir)"; \
253
@if test "$(SUBDIRS)" != ""; then \
256
echo "making installsbin in `pwd`/$$i"; \
257
( cd $$i ; $(MAKE) installsbin) ; \
258
if test $$? != 0 ; then \
265
@if test "$(INSTALLSBINPROGS)" != ""; then \
266
it="$(INSTALLSBINPROGS)" ; \
268
$(UNINSTALL) $(INSTALL_PREFIX)$(sbindir)/$$i ; \
269
echo "removing $$i from $(INSTALL_PREFIX)$(sbindir)"; \
274
# general make install target for subdirs
277
@if test "$(SUBDIRS)" != ""; then \
280
echo "making install in `pwd`/$$i"; \
281
( cd $$i ; $(MAKE) install) ; \
282
if test $$? != 0 ; then \
289
@if test "$(SUBDIRS)" != ""; then \
292
echo "making uninstall in `pwd`/$$i"; \
293
( cd $$i ; $(MAKE) uninstall) ; \
294
if test $$? != 0 ; then \
303
clean: cleansubdirs $(OTHERCLEANTODOS)
304
rm -f core ${OBJS} ${LOBJS} $(STANDARDCLEANTARGETS) $(OTHERCLEANTARGETS)
308
@if test "$(SUBDIRS)" != ""; then \
311
echo "making clean in `pwd`/$$i"; \
312
( cd $$i ; $(MAKE) clean) ; \
313
if test $$? != 0 ; then \
323
# wacky dependency building.
326
@if test -f Makefile.depend ; then \
327
makedepend `echo $(CPPFLAGS) | sed 's/-f[-a-z]*//g'` -o .lo $(srcdir)/*.c $(srcdir)/*/*.c ; \
331
nosysdepend: nosysdependdirs
332
@if test -f Makefile.depend ; then \
333
makedepend `echo $(CPPFLAGS) | sed 's/-f[-a-z]*//g'` -o .lo $(srcdir)/*.c $(srcdir)/*/*.c ; \
334
perl -n -i.bak $(top_srcdir)/makenosysdepend.pl Makefile ; \
337
distdepend: nosysdepend distdependdirs
338
@if test -f Makefile.depend ; then \
339
perl $(top_srcdir)/makefileindepend.pl ; \
343
@if test "$(SUBDIRS)" != ""; then \
346
echo "making depend in `pwd`/$$i"; \
347
( cd $$i ; $(MAKE) depend) ; \
348
if test $$? != 0 ; then \
355
@if test "$(SUBDIRS)" != ""; then \
358
echo "making nosysdepend in `pwd`/$$i"; \
359
( cd $$i ; $(MAKE) nosysdepend) ; \
360
if test $$? != 0 ; then \
367
@if test "$(SUBDIRS)" != ""; then \
370
echo "making distdepend in `pwd`/$$i"; \
371
( cd $$i ; $(MAKE) distdepend) ; \
372
if test $$? != 0 ; then \
378
# These aren't real targets, let gnu's make know that.
379
.PHONY: clean cleansubdirs lint \
380
install installprogs installheaders installlibs \
381
installbin installsbin installsubdirs \
382
all subdirs standardall \
383
depend nosysdepend distdepend dependdirs nosysdependdirs distdependdirs