]>
Commit | Line | Data |
---|---|---|
7868fbc6 | 1 | # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. |
a14bc59f BP |
2 | # |
3 | # Copying and distribution of this file, with or without modification, | |
4 | # are permitted in any medium without royalty provided the copyright | |
5 | # notice and this notice are preserved. This file is offered as-is, | |
6 | # without warranty of any kind. | |
7 | ||
064af421 BP |
8 | AUTOMAKE_OPTIONS = foreign subdir-objects |
9 | ACLOCAL_AMFLAGS = -I m4 | |
10 | SUBDIRS = datapath | |
11 | ||
064af421 | 12 | AM_CPPFLAGS = $(SSL_CFLAGS) |
cf06c2e9 | 13 | AM_LDFLAGS = $(SSL_LDFLAGS) |
95626395 | 14 | AM_LDFLAGS += $(OVS_LDFLAGS) |
e42dfc72 AS |
15 | |
16 | if WIN32 | |
17 | AM_CPPFLAGS += -I $(top_srcdir)/include/windows | |
c803536e | 18 | AM_CPPFLAGS += -I $(top_srcdir)/datapath-windows/include |
94887cf4 | 19 | AM_CPPFLAGS += $(PTHREAD_INCLUDES) |
b0e1bce5 | 20 | AM_CPPFLAGS += $(MSVC_CFLAGS) |
94887cf4 | 21 | AM_LDFLAGS += $(PTHREAD_LDFLAGS) |
e42dfc72 AS |
22 | endif |
23 | ||
064af421 | 24 | AM_CPPFLAGS += -I $(top_srcdir)/include |
837eefc7 | 25 | AM_CPPFLAGS += -I $(top_builddir)/include |
064af421 | 26 | AM_CPPFLAGS += -I $(top_srcdir)/lib |
611d30ce | 27 | AM_CPPFLAGS += -I $(top_builddir)/lib |
064af421 | 28 | |
8605a29b PK |
29 | AM_CPPFLAGS += $(SSL_INCLUDES) |
30 | ||
064af421 | 31 | AM_CFLAGS = -Wstrict-prototypes |
d161c099 | 32 | AM_CFLAGS += $(WARNING_FLAGS) |
95626395 | 33 | AM_CFLAGS += $(OVS_CFLAGS) |
064af421 BP |
34 | |
35 | if NDEBUG | |
36 | AM_CPPFLAGS += -DNDEBUG | |
37 | AM_CFLAGS += -fomit-frame-pointer | |
064af421 BP |
38 | endif |
39 | ||
b02e1154 GS |
40 | if WIN32 |
41 | psep=";" | |
42 | else | |
43 | psep=":" | |
44 | endif | |
853d1083 BP |
45 | # PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo |
46 | # files. Creating .py[co] works OK for any given version of Open | |
47 | # vSwitch, but it causes trouble if you switch from a version with | |
48 | # foo/__init__.py into an (older) version with plain foo.py, since | |
49 | # foo/__init__.pyc will cause Python to ignore foo.py. | |
9b4a5392 | 50 | if INCLUDE_PYTHON_COMPAT |
b02e1154 | 51 | run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$(top_srcdir)/python/compat$(psep)$$PYTHONPATH |
9b4a5392 | 52 | else |
b02e1154 | 53 | run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH |
9b4a5392 AA |
54 | endif |
55 | run_python += PYTHONDONTWRITEBYTECODE=yes $(PYTHON) | |
56 | ||
853d1083 | 57 | |
22c79496 | 58 | ALL_LOCAL = |
d879a707 | 59 | BUILT_SOURCES = |
064af421 | 60 | CLEANFILES = |
15b619e2 | 61 | CLEAN_LOCAL = |
064af421 | 62 | DISTCLEANFILES = |
79982e90 | 63 | PYCOV_CLEAN_FILES = build-aux/check-structs,cover |
4cdb08c0 | 64 | EXTRA_DIST = \ |
bee83872 | 65 | CONTRIBUTING \ |
4cdb08c0 | 66 | CodingStyle \ |
d31f1109 | 67 | DESIGN \ |
c483d489 | 68 | FAQ \ |
f6eb6b20 | 69 | INSTALL \ |
6494ea4c | 70 | INSTALL.Debian \ |
8a9562d2 | 71 | INSTALL.DPDK \ |
6dcf2bc3 | 72 | INSTALL.Fedora \ |
6cdd6a87 | 73 | INSTALL.KVM \ |
8a984481 | 74 | INSTALL.Libvirt \ |
0f3df203 | 75 | INSTALL.NetBSD \ |
c434706a | 76 | INSTALL.RHEL \ |
c2d1694f | 77 | INSTALL.SSL \ |
9678a9b6 | 78 | INSTALL.XenServer \ |
4cdb08c0 | 79 | INSTALL.userspace \ |
c803536e | 80 | INSTALL.Windows \ |
98f61d42 | 81 | IntegrationGuide \ |
4cdb08c0 | 82 | NOTICE \ |
bea97716 | 83 | OPENFLOW-1.1+ \ |
bc34d060 | 84 | PORTING \ |
a6ae068b | 85 | README-lisp \ |
4cdb08c0 | 86 | REPORTING-BUGS \ |
84f7a527 | 87 | TODO \ |
826bc7b6 TG |
88 | .travis.yml \ |
89 | .travis/build.sh \ | |
90 | .travis/prepare.sh \ | |
3c34dd48 | 91 | WHY-OVS \ |
0027492d | 92 | boot.sh \ |
c9b94429 | 93 | build-aux/cccl \ |
6ca37677 | 94 | build-aux/sodepends.pl \ |
94512c4a | 95 | build-aux/soexpand.pl \ |
6ca37677 BP |
96 | $(MAN_FRAGMENTS) \ |
97 | $(MAN_ROOTS) | |
064af421 BP |
98 | bin_PROGRAMS = |
99 | sbin_PROGRAMS = | |
100 | bin_SCRIPTS = | |
87103e1f | 101 | DIST_HOOKS = |
064af421 | 102 | dist_man_MANS = |
3b12adda | 103 | dist_pkgdata_DATA = |
064af421 BP |
104 | dist_pkgdata_SCRIPTS = |
105 | dist_sbin_SCRIPTS = | |
b2df0225 | 106 | dist_scripts_SCRIPTS = |
429ebf21 | 107 | dist_scripts_DATA = |
b2df0225 | 108 | INSTALL_DATA_LOCAL = |
44852fdf | 109 | UNINSTALL_LOCAL = |
064af421 | 110 | man_MANS = |
0027492d | 111 | MAN_FRAGMENTS = |
6ca37677 | 112 | MAN_ROOTS = |
c3bb4bd7 | 113 | noinst_DATA = |
064af421 | 114 | noinst_HEADERS = |
38b7a52b | 115 | lib_LTLIBRARIES = |
045b2e5c | 116 | noinst_man_MANS = |
064af421 BP |
117 | noinst_PROGRAMS = |
118 | noinst_SCRIPTS = | |
00732bf5 | 119 | OVSIDL_BUILT = |
9c16ed64 | 120 | pkgdata_DATA = |
b2df0225 | 121 | sbin_SCRIPTS = |
43bb5f82 | 122 | scripts_SCRIPTS = |
429ebf21 | 123 | scripts_DATA = |
c3bb4bd7 | 124 | SUFFIXES = |
15b619e2 | 125 | check_DATA = |
064af421 | 126 | |
43bb5f82 BP |
127 | scriptsdir = $(pkgdatadir)/scripts |
128 | ||
9741af79 BP |
129 | # This ensures that files added to EXTRA_DIST are always distributed, |
130 | # even if they are inside an Automake if...endif conditional block that is | |
131 | # disabled by some particular "configure" run. For more information, see: | |
132 | # http://article.gmane.org/gmane.comp.sysutils.automake.general/10891 | |
133 | noinst_HEADERS += $(EXTRA_DIST) | |
134 | ||
064af421 | 135 | ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */' |
cbaa4ffe | 136 | ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n' |
064af421 | 137 | |
c3bb4bd7 | 138 | SUFFIXES += .in |
064af421 | 139 | .in: |
ef44aa50 | 140 | $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \ |
3b135da3 | 141 | sed \ |
064af421 | 142 | -e 's,[@]PKIDIR[@],$(PKIDIR),g' \ |
3b135da3 | 143 | -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ |
f973f2af | 144 | -e 's,[@]DBDIR[@],$(DBDIR),g' \ |
3b135da3 BP |
145 | -e 's,[@]PERL[@],$(PERL),g' \ |
146 | -e 's,[@]PYTHON[@],$(PYTHON),g' \ | |
064af421 | 147 | -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ |
3b135da3 BP |
148 | -e 's,[@]VERSION[@],$(VERSION),g' \ |
149 | -e 's,[@]localstatedir[@],$(localstatedir),g' \ | |
064af421 | 150 | -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ |
3b135da3 | 151 | -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ |
43bb5f82 BP |
152 | -e 's,[@]bindir[@],$(bindir),g' \ |
153 | -e 's,[@]sbindir[@],$(sbindir),g' \ | |
d879a707 | 154 | -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \ |
3b135da3 | 155 | > $@.tmp |
00961f7c | 156 | @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \ |
3b135da3 BP |
157 | chmod +x $@.tmp; \ |
158 | fi | |
ef44aa50 | 159 | $(AM_V_at) mv $@.tmp $@ |
064af421 | 160 | |
79982e90 EJ |
161 | .PHONY: clean-pycov |
162 | clean-pycov: | |
163 | cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES) | |
164 | CLEAN_LOCAL += clean-pycov | |
165 | ||
87103e1f BP |
166 | # If we're checked out from a Git repository, make sure that every |
167 | # file that is in Git is distributed. | |
b4e1bf8b BP |
168 | # |
169 | # We only enable this check when GNU make is in use because the | |
170 | # Makefile in datapath/linux, needed to get the list of files to | |
171 | # distribute, requires GNU make extensions. | |
172 | if GNU_MAKE | |
39376d06 BP |
173 | ALL_LOCAL += dist-hook-git |
174 | dist-hook-git: distfiles | |
175 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \ | |
176 | (cd datapath && $(MAKE) distfiles); \ | |
177 | (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \ | |
a6da6967 | 178 | LC_ALL=C sort -u > all-distfiles; \ |
39376d06 | 179 | (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \ |
a6da6967 BP |
180 | LC_ALL=C sort -u > all-gitfiles; \ |
181 | LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \ | |
39376d06 BP |
182 | if test -s missing-distfiles; then \ |
183 | echo "The distribution is missing the following files:"; \ | |
184 | cat missing-distfiles; \ | |
185 | exit 1; \ | |
186 | fi; \ | |
87103e1f | 187 | fi |
39376d06 BP |
188 | CLEANFILES += all-distfiles all-gitfiles missing-distfiles |
189 | # The following is based on commands for the Automake "distdir" target. | |
190 | distfiles: Makefile | |
191 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | |
192 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | |
193 | list='$(DISTFILES)'; \ | |
194 | for file in $$list; do echo $$file; done | \ | |
195 | sed -e "s|^$$srcdirstrip/||;t" \ | |
a6da6967 BP |
196 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \ |
197 | LC_ALL=C sort -u > $@ | |
39376d06 | 198 | CLEANFILES += distfiles |
b4e1bf8b BP |
199 | endif |
200 | .PHONY: dist-hook-git | |
87103e1f | 201 | |
9e4ba008 BP |
202 | # Check that every .c file includes <config.h>. |
203 | ALL_LOCAL += config-h-check | |
204 | config-h-check: | |
205 | @cd $(srcdir); \ | |
206 | if test -e .git && (git --version) >/dev/null 2>&1 && \ | |
b411e5c3 | 207 | git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \ |
c803536e | 208 | grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows'`; \ |
9e4ba008 BP |
209 | then \ |
210 | echo "See above for list of violations of the rule that"; \ | |
211 | echo "every C source file must #include <config.h>."; \ | |
212 | exit 1; \ | |
213 | fi | |
214 | .PHONY: config-h-check | |
215 | ||
34582733 AS |
216 | # Check for printf() type modifiers that MSVC doesn't support. |
217 | ALL_LOCAL += printf-check | |
218 | printf-check: | |
8faeab72 DDP |
219 | @cd $(srcdir); \ |
220 | if test -e .git && (git --version) >/dev/null 2>&1 && \ | |
221 | git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \ | |
3b3f8857 | 222 | grep -vE '^datapath|^lib/sflow|^third-party'`; \ |
34582733 AS |
223 | then \ |
224 | echo "See above for list of violations of the rule that"; \ | |
225 | echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \ | |
226 | echo "forbidden. See CodingStyle for replacements."; \ | |
227 | exit 1; \ | |
228 | fi | |
229 | .PHONY: printf-check | |
230 | ||
1514b275 BP |
231 | # Check that certain data structures are always declared "static". |
232 | ALL_LOCAL += static-check | |
233 | static-check: | |
db5ce514 | 234 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ |
1514b275 | 235 | git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \ |
db5ce514 BP |
236 | then \ |
237 | echo "See above for list of violations of the rule that "; \ | |
1514b275 | 238 | echo "certain data structures must always be 'static'"; \ |
db5ce514 BP |
239 | exit 1; \ |
240 | fi | |
1514b275 | 241 | .PHONY: static-check |
db5ce514 | 242 | |
4958e3ee BP |
243 | # Check that assert.h is not used outside a whitelist of files. |
244 | ALL_LOCAL += check-assert-h-usage | |
245 | check-assert-h-usage: | |
246 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ | |
247 | (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \ | |
92fa2e92 | 248 | $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \ |
4958e3ee BP |
249 | then \ |
250 | echo "Files listed above unexpectedly #include <""assert.h"">."; \ | |
251 | echo "Please use ovs_assert (from util.h) instead of assert."; \ | |
252 | exit 1; \ | |
253 | fi | |
254 | .PHONY: check-assert-h-usage | |
255 | ||
6a3e30f3 BP |
256 | ALL_LOCAL += thread-safety-check |
257 | thread-safety-check: | |
8faeab72 DDP |
258 | @cd $(srcdir); \ |
259 | if test -e .git && (git --version) >/dev/null 2>&1 && \ | |
260 | grep -n -f build-aux/thread-safety-blacklist \ | |
261 | `git ls-files | grep '\.[ch]$$' \ | |
ca3d034b | 262 | | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \ |
6a3e30f3 BP |
263 | | $(EGREP) -v ':[ ]*/?\*'; \ |
264 | then \ | |
265 | echo "See above for list of calls to functions that are"; \ | |
266 | echo "blacklisted due to thread safety issues"; \ | |
267 | exit 1; \ | |
268 | fi | |
269 | EXTRA_DIST += build-aux/thread-safety-blacklist | |
270 | ||
0027492d BP |
271 | if HAVE_GROFF |
272 | ALL_LOCAL += manpage-check | |
1261619f BP |
273 | manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS) |
274 | @error=false; \ | |
275 | for manpage in $?; do \ | |
186ef5c1 | 276 | LANG=en_US.UTF-8 groff -w mac -w delim -w escape -w input -w missing -w tab -T utf8 -man -p -z $$manpage >$@.tmp 2>&1; \ |
1261619f BP |
277 | if grep warning: $@.tmp; then error=:; fi; \ |
278 | rm -f $@.tmp; \ | |
0027492d | 279 | done; \ |
be09aa10 EJ |
280 | if $$error; then exit 1; else touch $@; fi |
281 | $(AM_V_GEN) touch -c $@ | |
0027492d BP |
282 | CLEANFILES += manpage-check |
283 | endif | |
284 | ||
6ca37677 BP |
285 | include $(srcdir)/manpages.mk |
286 | $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl | |
287 | @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp | |
288 | @if cmp -s $(@F).tmp $@; then \ | |
289 | touch $@; \ | |
290 | rm -f $(@F).tmp; \ | |
291 | else \ | |
292 | mv $(@F).tmp $@; \ | |
293 | fi | |
294 | CLEANFILES += manpage-dep-check | |
295 | ||
bd9d7025 AS |
296 | if VSTUDIO_DDK |
297 | ALL_LOCAL += ovsext_make | |
298 | ovsext_make: datapath-windows/ovsext.sln | |
299 | MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="$(VSTUDIO_CONFIG)" | |
300 | ||
301 | CLEAN_LOCAL += ovsext_clean | |
302 | ovsext_clean: datapath-windows/ovsext.sln | |
303 | MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="$(VSTUDIO_CONFIG)" | |
304 | endif | |
305 | ||
87103e1f | 306 | dist-hook: $(DIST_HOOKS) |
22c79496 | 307 | all-local: $(ALL_LOCAL) |
15b619e2 | 308 | clean-local: $(CLEAN_LOCAL) |
b2df0225 | 309 | install-data-local: $(INSTALL_DATA_LOCAL) |
44852fdf BP |
310 | uninstall-local: $(UNINSTALL_LOCAL) |
311 | .PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL) | |
87103e1f | 312 | |
3a14d239 BP |
313 | modules_install: |
314 | if LINUX_ENABLED | |
315 | cd datapath/linux && $(MAKE) modules_install | |
316 | endif | |
317 | ||
ed1be787 | 318 | include m4/automake.mk |
064af421 | 319 | include lib/automake.mk |
8cd4882f | 320 | include ofproto/automake.mk |
064af421 BP |
321 | include utilities/automake.mk |
322 | include tests/automake.mk | |
323 | include include/automake.mk | |
324 | include third-party/automake.mk | |
325 | include debian/automake.mk | |
326 | include vswitchd/automake.mk | |
f85f8ebb | 327 | include ovsdb/automake.mk |
c434706a | 328 | include rhel/automake.mk |
064af421 | 329 | include xenserver/automake.mk |
0be6140a | 330 | include python/automake.mk |
6c88547d | 331 | include python/compat/automake.mk |
eeecce05 | 332 | include tutorial/automake.mk |
add17b69 | 333 | include vtep/automake.mk |
c803536e | 334 | include datapath-windows/automake.mk |
c640e3ce | 335 | include datapath-windows/include/automake.mk |