-
Notifications
You must be signed in to change notification settings - Fork 82
/
Makefile.in
277 lines (250 loc) · 12.5 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# Warning: this file must be usable by regular make
# (unlike the Makefiles in subdirectories).
SHELL = @SHELL@
@SUBMAKE@
PACKAGE = click
VERSION = @CLICK_VERSION@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
top_builddir = .
subdir = .
conf_auxdir = @conf_auxdir@
AUTOCONF = @AUTOCONF@
PERL = @PERL@
INSTALL = @INSTALL@
INSTALL_IF_CHANGED = @INSTALL_IF_CHANGED@
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DATA_IF_CHANGED = $(INSTALL_IF_CHANGED) -m 644
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
EXTRA_PROVIDES =
PROVISIONS = @provisions@ $(EXTRA_PROVIDES)
prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
clickincludedir = $(includedir)/click
nicschedulerincludedir = $(includedir)/nicscheduler
netincludedir = $(includedir)/clicknet
toolincludedir = $(includedir)/clicktool
bindir = @bindir@
datarootdir = @datarootdir@
datadir = @datadir@
clickdatadir = $(datadir)/click
CLICK_BUILDTOOL = bin/click-buildtool
CLICK_COMPILE = bin/click-compile
ELEMENTMAP = share/click/elementmap.xml
DRIVERS = @DRIVERS@
OTHER_TARGETS = @OTHER_TARGETS@
ALL_TARGETS = $(DRIVERS) $(OTHER_TARGETS)
INSTALL_TARGETS = @INSTALL_TARGETS@
CLEAN_TARGETS = @CLEAN_TARGETS@
all: $(ALL_TARGETS) Makefile
bsdmodule: Makefile $(CLICK_BUILDTOOL) stamp-h
@cd bsdmodule && $(MAKE) all
linuxmodule: Makefile $(CLICK_BUILDTOOL) stamp-h
@cd linuxmodule && $(MAKE) all
ns: Makefile $(CLICK_BUILDTOOL) stamp-h
@cd ns && $(MAKE) all
userlevel: Makefile $(CLICK_BUILDTOOL) $(CLICK_COMPILE) stamp-h
@cd userlevel && $(MAKE) all
minios: Makefile $(CLICK_BUILDTOOL) $(CLICK_COMPILE) stamp-h
@cd minios && $(MAKE) all
tools: Makefile stamp-h
@cd tools && $(MAKE) all
install-bsdmodule: Makefile $(CLICK_BUILDTOOL) stamp-h installch
@cd bsdmodule && $(MAKE) install
install-linuxmodule: Makefile $(CLICK_BUILDTOOL) stamp-h installch
@cd linuxmodule && $(MAKE) install
install-ns: Makefile $(CLICK_BUILDTOOL) stamp-h installch
@cd ns && $(MAKE) install
install-userlevel: Makefile $(CLICK_BUILDTOOL) stamp-h installch
@cd userlevel && $(MAKE) install
install-tools: Makefile $(CLICK_BUILDTOOL) stamp-h installch
@cd tools && $(MAKE) install
clean-bsdmodule:
@cd bsdmodule && $(MAKE) clean
clean-linuxmodule:
@cd linuxmodule && $(MAKE) clean
clean-ns:
@cd ns && $(MAKE) clean
clean-userlevel:
@cd userlevel && $(MAKE) clean
clean-lto:
find . -name \*.ll -type f -print0 | xargs -0 rm -f
find . -name \*.bc -type f -print0 | xargs -0 rm -f
find . -name \*.resolution.txt -type f -print0 | xargs -0 rm -f
clean-embed:
@cd userlevel && $(MAKE) clean-embed
clean-minios:
@cd minios && $(MAKE) clean
clean-tools:
@cd tools && $(MAKE) clean
install: $(INSTALL_TARGETS) install-local install-doc install-local-include
install-local: $(ELEMENTMAP) $(CLICK_BUILDTOOL) $(CLICK_COMPILE) \
share/click/config.mk share/click/pkg-config.mk installch
$(mkinstalldirs) $(DESTDIR)$(bindir)
$(INSTALL_IF_CHANGED) $(CLICK_BUILDTOOL) $(DESTDIR)$(bindir)/click-buildtool
$(INSTALL_IF_CHANGED) $(CLICK_COMPILE) $(DESTDIR)$(bindir)/click-compile
$(INSTALL_IF_CHANGED) $(srcdir)/click-mkelemmap $(DESTDIR)$(bindir)/click-mkelemmap
$(INSTALL_IF_CHANGED) $(top_srcdir)/test/testie $(DESTDIR)$(bindir)/testie
$(INSTALL_IF_CHANGED) $(top_srcdir)/test/clicktest $(DESTDIR)$(bindir)/clicktest
$(mkinstalldirs) $(DESTDIR)$(clickdatadir)
$(INSTALL) $(mkinstalldirs) $(DESTDIR)$(clickdatadir)/mkinstalldirs
$(INSTALL_DATA) $(ELEMENTMAP) $(DESTDIR)$(clickdatadir)/elementmap.xml
$(INSTALL_DATA_IF_CHANGED) share/click/config.mk $(DESTDIR)$(clickdatadir)/config.mk
$(INSTALL_DATA_IF_CHANGED) share/click/pkg-config.mk $(DESTDIR)$(clickdatadir)/pkg-config.mk
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/share/click/pkg-Makefile $(DESTDIR)$(clickdatadir)/pkg-Makefile
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/share/click/pkg-userlevel.mk $(DESTDIR)$(clickdatadir)/pkg-userlevel.mk
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/share/click/pkg-linuxmodule.mk $(DESTDIR)$(clickdatadir)/pkg-linuxmodule.mk
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/share/click/pkg-linuxmodule-26.mk $(DESTDIR)$(clickdatadir)/pkg-linuxmodule-26.mk
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/share/click/pkg-bsdmodule.mk $(DESTDIR)$(clickdatadir)/pkg-bsdmodule.mk
(cd $(top_srcdir); pwd) > $(DESTDIR)$(clickdatadir)/srcdir
/bin/rm -rf $(DESTDIR)$(clickdatadir)/src
/bin/ln -s "`cd $(top_srcdir); pwd`" $(DESTDIR)$(clickdatadir)/src
install-doc: $(ELEMENTMAP)
@cd doc && $(MAKE) install
install-man: $(ELEMENTMAP)
@-for d in $(ALL_TARGETS) doc; do (cd $$d && $(MAKE) install-man); done
install-local-include: stamp-h installch
$(mkinstalldirs) $(DESTDIR)$(clickincludedir)
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/include/click/*.h $(DESTDIR)$(clickincludedir)
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/include/click/*.hh $(DESTDIR)$(clickincludedir)
$(mkinstalldirs) $(DESTDIR)$(nicschedulerincludedir)
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/vendor/nicscheduler/*.hh $(DESTDIR)$(nicschedulerincludedir)
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/include/click/*.cc $(DESTDIR)$(clickincludedir)
$(INSTALL_DATA_IF_CHANGED) $(top_builddir)/include/click/*.h $(DESTDIR)$(clickincludedir)
$(mkinstalldirs) $(DESTDIR)$(clickincludedir)/flow
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/include/click/flow/*.hh $(DESTDIR)$(clickincludedir)/flow
$(mkinstalldirs) $(DESTDIR)$(clickincludedir)/standard
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/include/click/standard/*.hh $(DESTDIR)$(clickincludedir)/standard
$(mkinstalldirs) $(DESTDIR)$(netincludedir)
$(INSTALL_DATA_IF_CHANGED) $(srcdir)/include/clicknet/*.h $(DESTDIR)$(netincludedir)
install-include: install-local-include
@for d in $(ALL_TARGETS); do (cd $$d && $(MAKE) install-include) || exit 1; done
install-lib:
@if echo $(ALL_TARGETS) | grep userlevel >/dev/null 2>&1; then cd userlevel && $(MAKE) install-lib; fi
@if echo $(ALL_TARGETS) | grep tools >/dev/null 2>&1; then cd tools && $(MAKE) install-lib; fi
uninstall: $(ELEMENTMAP)
@for d in $(ALL_TARGETS) doc; do (cd $$d && $(MAKE) uninstall) || exit 1; done
@$(MAKE) uninstall-local uninstall-local-include
uninstall-local:
/bin/rm -f $(DESTDIR)$(bindir)/click-buildtool $(DESTDIR)$(bindir)/click-compile $(DESTDIR)$(bindir)/click-mkelemmap $(DESTDIR)$(bindir)/testie $(DESTDIR)$(bindir)/clicktest $(DESTDIR)$(clickdatadir)/elementmap.xml $(DESTDIR)$(clickdatadir)/srcdir $(DESTDIR)$(clickdatadir)/src $(DESTDIR)$(clickdatadir)/config.mk $(DESTDIR)$(clickdatadir)/mkinstalldirs
/bin/rm -f $(DESTDIR)$(clickdatadir)/pkg-config.mk $(DESTDIR)$(clickdatadir)/pkg-userlevel.mk $(DESTDIR)$(clickdatadir)/pkg-linuxmodule.mk $(DESTDIR)$(clickdatadir)/pkg-linuxmodule-26.mk $(DESTDIR)$(clickdatadir)/pkg-bsdmodule.mk $(DESTDIR)$(clickdatadir)/pkg-Makefile
uninstall-local-include:
cd $(srcdir)/include/click; for i in *.h *.hh *.cc; do /bin/rm -f $(DESTDIR)$(clickincludedir)/$$i; done
cd $(top_builddir)/include/click; for i in *.h; do /bin/rm -f $(DESTDIR)$(clickincludedir)/$$i; done
cd $(srcdir)/include/click/standard; for i in *.hh; do /bin/rm -f $(DESTDIR)$(clickincludedir)/standard/$$i; done
cd $(srcdir)/include/clicknet; for i in *.h; do /bin/rm -f $(DESTDIR)$(netincludedir)/$$i; done
for i in $(clickincludedir)/standard $(clickincludedir) $(netincludedir); do if test -d $(DESTDIR)$$i; then /bin/rmdir $(DESTDIR)$$i; fi; done
elemlist elemlists: $(CLICK_BUILDTOOL)
@for d in $(DRIVERS); do (cd $$d && $(MAKE) elemlist) || exit 1; done
MKELEMMAPFLAGS =
FINDELEMFLAGS = @FINDELEMFLAGS@
$(ELEMENTMAP): $(CLICK_BUILDTOOL) $(srcdir)/click-mkelemmap always
echo $(DRIVERS) @element_groups@ $(EXTRA_PROVIDES) | $(CLICK_BUILDTOOL) findelem -r "$(PROVISIONS) $(DRIVERS)" -p $(top_srcdir) $(FINDELEMFLAGS) | $(PERL) $(top_srcdir)/click-mkelemmap -r "$(PROVISIONS)" -t "$(DRIVERS)" -p $(top_srcdir) -Iinclude -s "`cd $(top_srcdir) && pwd`" $(MKELEMMAPFLAGS) > $(ELEMENTMAP)
always:
@:
$(CLICK_BUILDTOOL): $(srcdir)/click-buildtool.in config.status
cd $(top_builddir) && $(SHELL) ./config.status $@
@chmod +x $(CLICK_BUILDTOOL); touch $(CLICK_BUILDTOOL)
$(CLICK_COMPILE): $(srcdir)/click-compile.in config.status
cd $(top_builddir) && $(SHELL) ./config.status $@
@chmod +x $(CLICK_COMPILE); touch $(CLICK_COMPILE)
installch: $(srcdir)/installch.in config.status
cd $(top_builddir) && $(SHELL) ./config.status $@
@chmod +x installch; touch installch
share/click/config.mk: $(srcdir)/config.mk.in config.status
cd $(top_builddir) && $(SHELL) ./config.status $@
share/click/pkg-config.mk: $(srcdir)/share/click/pkg-config.mk.in config.status
cd $(top_builddir) && $(SHELL) ./config.status $@
$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/m4/click.m4
cd $(srcdir) && $(AUTOCONF)
config.status: $(srcdir)/configure
$(SHELL) $(srcdir)/configure @ac_configure_args@
Makefile: config.status $(srcdir)/Makefile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
config.h: stamp-h
stamp-h: $(srcdir)/config.h.in $(srcdir)/config-bsdmodule.h.in $(srcdir)/config-linuxmodule.h.in $(srcdir)/config-ns.h.in $(srcdir)/config-userlevel.h.in $(srcdir)/config-minios.h.in config.status
cd $(top_builddir) && $(SHELL) ./config.status
echo > stamp-h
check-filenames:
@a=`find . \( -name \*.cc -or -name \*.c \) -print | sed 's/.*\/\(.*\)\.c*$$/\1.o/' | grep -v 'elements\.o' | sort | uniq -d`; \
if test -z $$a; then echo OK; else echo "*** warning: duplicate object file names:"; echo "$$a"; fi
clean: $(CLEAN_TARGETS) clean-doc clean-local clean-cscope clean-lto clean-embed
clean-doc:
@cd doc && $(MAKE) clean
clean-local:
-rm -f $(ELEMENTMAP) conftest.*
distclean:
@-for d in @POSSIBLE_DRIVERS@ tools doc; do (cd $$d && $(MAKE) distclean); done
-rm -f Makefile config.status etc/libclick/Makefile
-rm -f include/click/config.h include/click/config-*.h include/click/pathvars.h
-rm -f config.cache config.log $(CLICK_BUILDTOOL) $(CLICK_COMPILE) stamp-h
-rm -f share/click/config.mk share/click/pkg-config.mk $(ELEMENTMAP)
-rm -f bin/click-buildtool bin/click-compile
-rm -f config.mk elementmap.xml etc/pkg-config.mk pkg-config.mk
-rm -f conftest.* installch
-rmdir bin
check: $(ALL_TARGETS) Makefile $(ELEMENTMAP)
$(top_srcdir)/test/clicktest -p $(top_builddir)/bin -p $(top_srcdir)/test \
$(if $V,-V,) CLICKPATH="`cd $(top_builddir); pwd`:" \
CLICKTEST_PREINSTALL=1 \
$(top_srcdir)/test
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
dist: distdir
tar czf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(srcdir)/configure
-rm -rf doc/click.info* doc/clicktest.1 $(srcdir)/doc/click.info* $(srcdir)/doc/clicktest.1
cd doc && $(MAKE) clicktest.1
cd $(srcdir)/etc/samplepackage && $(AUTOCONF)
-rm -rf $(distdir)
mkdir $(distdir)
chmod 777 $(distdir)
@echo Copying library, documentation, configuration, and driver files...
[ "$(srcdir)" = . ] || cp doc/clicktest.1 $(srcdir)/doc
@for file in `cat $(srcdir)/DISTFILES | grep .`; do \
if expr "$$file" : '.*:$$' >/dev/null 2>&1; then \
d=`echo $$file | sed 's/:$$//;s/^\.\///'`; \
elif test -d "$(srcdir)/$$d/$$file"; then \
mkdir $(distdir)/$$d/$$file; \
chmod 777 $(distdir)/$$d/$$file; \
else \
for f in `cd $(srcdir)/$$d && echo $$file`; do \
test -f "$(distdir)/$$d/$$f" \
|| ln $(srcdir)/$$d/$$f $(distdir)/$$d/$$f 2> /dev/null \
|| cp -p $(srcdir)/$$d/$$f $(distdir)/$$d/$$f \
|| echo "Could not copy $$d/$$f!" 1>&2; \
done; fi; \
done
@echo Copying element files...
@d=$(srcdir); \
for dir in `cd $$d && find elements -type d -print | grep -v 'exopc\|CVS'`; do \
mkdir $(distdir)/$$dir 2>/dev/null; \
chmod 777 $(distdir)/$$dir; \
for cfile in `cd $$d && find $$dir -maxdepth 1 \( -type f -and \( -name \[^,.]\*.cc -or -name \[^,.]\*.c -or -name \[^,.]\*.hh -or -name \[^,.]\*.h -or -name README \) \) -print`; do \
ln $$d/$$cfile $(distdir)/$$cfile; \
done; \
done
@echo Removing files not meant for distribution...
@if test -r $(srcdir)/NODIST; then \
for i in `cat $(srcdir)/NODIST`; do \
rm -rf $(distdir)/$$i; \
done; fi
@if grep -q 'Id:.*benjie' `find $(srcdir)/etc -maxdepth 1 -type f -print`; then \
echo 'ERROR: Benjie must be punished!'; exit 1; \
fi
@if test `grep 'CLICK_VERSION=' $(srcdir)/configure.in` != `grep 'CLICK_VERSION=' $(srcdir)/etc/libclick/lc-configure.in`; then \
echo 'ERROR: Bad libclick CLICK_VERSION!'; exit 1; \
fi
cscope: clean-cscope
ack -f --cpp > cscope.files
cscope -b -R -q -k
clean-cscope:
rm -rf cscope.*
.PHONY: all always elemlist elemlists \
bsdmodule linuxmodule ns userlevel minios tools \
install install-doc install-lib install-man install-local install-include install-local-include $(INSTALL_TARGETS) \
clean clean-doc clean-local $(CLEAN_TARGETS) distclean clean-cscope \
uninstall uninstall-local uninstall-local-include \
dist distdir check cscope