]>
Commit | Line | Data |
---|---|---|
f0664242 | 1 | # Copyright (C) 2007-2015 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 |
4441a01c BP |
64 | |
65 | # A list of Markdown-formatted documentation that will automatically be | |
66 | # included in the "make dist-docs" output. | |
67 | docs = \ | |
542cc9bb TG |
68 | CONTRIBUTING.md \ |
69 | CodingStyle.md \ | |
70 | DESIGN.md \ | |
71 | FAQ.md \ | |
72 | INSTALL.md \ | |
73 | INSTALL.Debian.md \ | |
74 | INSTALL.Docker.md \ | |
75 | INSTALL.DPDK.md \ | |
76 | INSTALL.Fedora.md \ | |
77 | INSTALL.KVM.md \ | |
78 | INSTALL.Libvirt.md \ | |
79 | INSTALL.NetBSD.md \ | |
80 | INSTALL.RHEL.md \ | |
81 | INSTALL.SSL.md \ | |
82 | INSTALL.XenServer.md \ | |
83 | INSTALL.userspace.md \ | |
84 | INSTALL.Windows.md \ | |
85 | IntegrationGuide.md \ | |
542cc9bb TG |
86 | OPENFLOW-1.1+.md \ |
87 | PORTING.md \ | |
d25e2f57 | 88 | README.md \ |
542cc9bb | 89 | README-lisp.md \ |
a36de779 | 90 | README-native-tunneling.md \ |
542cc9bb | 91 | REPORTING-BUGS.md \ |
f0664242 | 92 | SECURITY.md \ |
542cc9bb | 93 | TODO.md \ |
4441a01c BP |
94 | WHY-OVS.md |
95 | EXTRA_DIST = \ | |
96 | $(docs) \ | |
97 | NOTICE \ | |
826bc7b6 TG |
98 | .travis.yml \ |
99 | .travis/build.sh \ | |
100 | .travis/prepare.sh \ | |
0027492d | 101 | boot.sh \ |
c9b94429 | 102 | build-aux/cccl \ |
4441a01c | 103 | build-aux/dist-docs \ |
6ca37677 | 104 | build-aux/sodepends.pl \ |
94512c4a | 105 | build-aux/soexpand.pl \ |
6ca37677 | 106 | $(MAN_FRAGMENTS) \ |
1ce96d2a | 107 | $(MAN_ROOTS) \ |
b56b2566 | 108 | Vagrantfile |
064af421 BP |
109 | bin_PROGRAMS = |
110 | sbin_PROGRAMS = | |
111 | bin_SCRIPTS = | |
87103e1f | 112 | DIST_HOOKS = |
064af421 | 113 | dist_man_MANS = |
3b12adda | 114 | dist_pkgdata_DATA = |
064af421 BP |
115 | dist_pkgdata_SCRIPTS = |
116 | dist_sbin_SCRIPTS = | |
b2df0225 | 117 | dist_scripts_SCRIPTS = |
429ebf21 | 118 | dist_scripts_DATA = |
b2df0225 | 119 | INSTALL_DATA_LOCAL = |
44852fdf | 120 | UNINSTALL_LOCAL = |
064af421 | 121 | man_MANS = |
0027492d | 122 | MAN_FRAGMENTS = |
6ca37677 | 123 | MAN_ROOTS = |
c3bb4bd7 | 124 | noinst_DATA = |
064af421 | 125 | noinst_HEADERS = |
38b7a52b | 126 | lib_LTLIBRARIES = |
045b2e5c | 127 | noinst_man_MANS = |
064af421 BP |
128 | noinst_PROGRAMS = |
129 | noinst_SCRIPTS = | |
00732bf5 | 130 | OVSIDL_BUILT = |
9c16ed64 | 131 | pkgdata_DATA = |
b2df0225 | 132 | sbin_SCRIPTS = |
43bb5f82 | 133 | scripts_SCRIPTS = |
429ebf21 | 134 | scripts_DATA = |
c3bb4bd7 | 135 | SUFFIXES = |
15b619e2 | 136 | check_DATA = |
81696de0 | 137 | pkgconfig_DATA = |
064af421 | 138 | |
43bb5f82 | 139 | scriptsdir = $(pkgdatadir)/scripts |
81696de0 | 140 | pkgconfigdir = $(libdir)/pkgconfig |
43bb5f82 | 141 | |
9741af79 BP |
142 | # This ensures that files added to EXTRA_DIST are always distributed, |
143 | # even if they are inside an Automake if...endif conditional block that is | |
144 | # disabled by some particular "configure" run. For more information, see: | |
145 | # http://article.gmane.org/gmane.comp.sysutils.automake.general/10891 | |
146 | noinst_HEADERS += $(EXTRA_DIST) | |
147 | ||
064af421 | 148 | ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */' |
cbaa4ffe | 149 | ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n' |
064af421 | 150 | |
c3bb4bd7 | 151 | SUFFIXES += .in |
064af421 | 152 | .in: |
ef44aa50 | 153 | $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \ |
3b135da3 | 154 | sed \ |
064af421 | 155 | -e 's,[@]PKIDIR[@],$(PKIDIR),g' \ |
3b135da3 | 156 | -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ |
f973f2af | 157 | -e 's,[@]DBDIR[@],$(DBDIR),g' \ |
3b135da3 BP |
158 | -e 's,[@]PERL[@],$(PERL),g' \ |
159 | -e 's,[@]PYTHON[@],$(PYTHON),g' \ | |
064af421 | 160 | -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ |
3b135da3 BP |
161 | -e 's,[@]VERSION[@],$(VERSION),g' \ |
162 | -e 's,[@]localstatedir[@],$(localstatedir),g' \ | |
064af421 | 163 | -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ |
3b135da3 | 164 | -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ |
43bb5f82 BP |
165 | -e 's,[@]bindir[@],$(bindir),g' \ |
166 | -e 's,[@]sbindir[@],$(sbindir),g' \ | |
d879a707 | 167 | -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \ |
3b135da3 | 168 | > $@.tmp |
00961f7c | 169 | @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \ |
3b135da3 BP |
170 | chmod +x $@.tmp; \ |
171 | fi | |
ef44aa50 | 172 | $(AM_V_at) mv $@.tmp $@ |
064af421 | 173 | |
79982e90 EJ |
174 | .PHONY: clean-pycov |
175 | clean-pycov: | |
176 | cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES) | |
177 | CLEAN_LOCAL += clean-pycov | |
178 | ||
87103e1f BP |
179 | # If we're checked out from a Git repository, make sure that every |
180 | # file that is in Git is distributed. | |
b4e1bf8b BP |
181 | # |
182 | # We only enable this check when GNU make is in use because the | |
183 | # Makefile in datapath/linux, needed to get the list of files to | |
184 | # distribute, requires GNU make extensions. | |
185 | if GNU_MAKE | |
39376d06 BP |
186 | ALL_LOCAL += dist-hook-git |
187 | dist-hook-git: distfiles | |
188 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \ | |
189 | (cd datapath && $(MAKE) distfiles); \ | |
190 | (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \ | |
a6da6967 | 191 | LC_ALL=C sort -u > all-distfiles; \ |
39376d06 | 192 | (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \ |
a6da6967 BP |
193 | LC_ALL=C sort -u > all-gitfiles; \ |
194 | LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \ | |
39376d06 BP |
195 | if test -s missing-distfiles; then \ |
196 | echo "The distribution is missing the following files:"; \ | |
197 | cat missing-distfiles; \ | |
198 | exit 1; \ | |
199 | fi; \ | |
87103e1f | 200 | fi |
39376d06 BP |
201 | CLEANFILES += all-distfiles all-gitfiles missing-distfiles |
202 | # The following is based on commands for the Automake "distdir" target. | |
203 | distfiles: Makefile | |
204 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | |
205 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | |
206 | list='$(DISTFILES)'; \ | |
207 | for file in $$list; do echo $$file; done | \ | |
208 | sed -e "s|^$$srcdirstrip/||;t" \ | |
a6da6967 BP |
209 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \ |
210 | LC_ALL=C sort -u > $@ | |
39376d06 | 211 | CLEANFILES += distfiles |
b4e1bf8b BP |
212 | endif |
213 | .PHONY: dist-hook-git | |
87103e1f | 214 | |
9e4ba008 BP |
215 | # Check that every .c file includes <config.h>. |
216 | ALL_LOCAL += config-h-check | |
217 | config-h-check: | |
218 | @cd $(srcdir); \ | |
219 | if test -e .git && (git --version) >/dev/null 2>&1 && \ | |
b411e5c3 | 220 | git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \ |
c803536e | 221 | grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows'`; \ |
9e4ba008 BP |
222 | then \ |
223 | echo "See above for list of violations of the rule that"; \ | |
224 | echo "every C source file must #include <config.h>."; \ | |
225 | exit 1; \ | |
226 | fi | |
227 | .PHONY: config-h-check | |
228 | ||
34582733 AS |
229 | # Check for printf() type modifiers that MSVC doesn't support. |
230 | ALL_LOCAL += printf-check | |
231 | printf-check: | |
8faeab72 DDP |
232 | @cd $(srcdir); \ |
233 | if test -e .git && (git --version) >/dev/null 2>&1 && \ | |
234 | git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \ | |
3b3f8857 | 235 | grep -vE '^datapath|^lib/sflow|^third-party'`; \ |
34582733 AS |
236 | then \ |
237 | echo "See above for list of violations of the rule that"; \ | |
238 | echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \ | |
542cc9bb | 239 | echo "forbidden. See CodingStyle.md for replacements."; \ |
34582733 AS |
240 | exit 1; \ |
241 | fi | |
242 | .PHONY: printf-check | |
243 | ||
1514b275 BP |
244 | # Check that certain data structures are always declared "static". |
245 | ALL_LOCAL += static-check | |
246 | static-check: | |
db5ce514 | 247 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ |
1514b275 | 248 | git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \ |
db5ce514 BP |
249 | then \ |
250 | echo "See above for list of violations of the rule that "; \ | |
1514b275 | 251 | echo "certain data structures must always be 'static'"; \ |
db5ce514 BP |
252 | exit 1; \ |
253 | fi | |
1514b275 | 254 | .PHONY: static-check |
db5ce514 | 255 | |
4958e3ee BP |
256 | # Check that assert.h is not used outside a whitelist of files. |
257 | ALL_LOCAL += check-assert-h-usage | |
258 | check-assert-h-usage: | |
259 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ | |
260 | (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \ | |
92fa2e92 | 261 | $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \ |
4958e3ee BP |
262 | then \ |
263 | echo "Files listed above unexpectedly #include <""assert.h"">."; \ | |
264 | echo "Please use ovs_assert (from util.h) instead of assert."; \ | |
265 | exit 1; \ | |
266 | fi | |
267 | .PHONY: check-assert-h-usage | |
268 | ||
64746850 BP |
269 | # Check that LITTLE_ENDIAN and BIG_ENDIAN are not used unless BYTE_ORDER is |
270 | # also mentioned. (<endian.h> always defines the former two constants. They | |
271 | # must be compared to BYTE_ORDER to get the machine's correct endianness. But | |
272 | # it is better to use WORDS_BIGENDIAN.) | |
273 | ALL_LOCAL += check-endian | |
274 | check-endian: | |
275 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ | |
276 | (cd $(srcdir) && git --no-pager grep -l -E \ | |
277 | -e 'BIG_ENDIAN|LITTLE_ENDIAN' --and --not -e 'BYTE_ORDER' | \ | |
278 | $(EGREP) -v '^datapath/'); \ | |
279 | then \ | |
280 | echo "See above for list of files that misuse LITTLE""_ENDIAN"; \ | |
281 | echo "or BIG""_ENDIAN. Please use WORDS_BIGENDIAN instead."; \ | |
282 | exit 1; \ | |
283 | fi | |
284 | .PHONY: check-endian | |
285 | ||
6a3e30f3 BP |
286 | ALL_LOCAL += thread-safety-check |
287 | thread-safety-check: | |
8faeab72 DDP |
288 | @cd $(srcdir); \ |
289 | if test -e .git && (git --version) >/dev/null 2>&1 && \ | |
290 | grep -n -f build-aux/thread-safety-blacklist \ | |
291 | `git ls-files | grep '\.[ch]$$' \ | |
ca3d034b | 292 | | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \ |
6a3e30f3 BP |
293 | | $(EGREP) -v ':[ ]*/?\*'; \ |
294 | then \ | |
295 | echo "See above for list of calls to functions that are"; \ | |
296 | echo "blacklisted due to thread safety issues"; \ | |
297 | exit 1; \ | |
298 | fi | |
299 | EXTRA_DIST += build-aux/thread-safety-blacklist | |
300 | ||
0027492d BP |
301 | if HAVE_GROFF |
302 | ALL_LOCAL += manpage-check | |
1261619f BP |
303 | manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS) |
304 | @error=false; \ | |
305 | for manpage in $?; do \ | |
186ef5c1 | 306 | 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 |
307 | if grep warning: $@.tmp; then error=:; fi; \ |
308 | rm -f $@.tmp; \ | |
0027492d | 309 | done; \ |
be09aa10 EJ |
310 | if $$error; then exit 1; else touch $@; fi |
311 | $(AM_V_GEN) touch -c $@ | |
0027492d BP |
312 | CLEANFILES += manpage-check |
313 | endif | |
314 | ||
6ca37677 BP |
315 | include $(srcdir)/manpages.mk |
316 | $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl | |
317 | @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp | |
318 | @if cmp -s $(@F).tmp $@; then \ | |
319 | touch $@; \ | |
320 | rm -f $(@F).tmp; \ | |
321 | else \ | |
322 | mv $(@F).tmp $@; \ | |
323 | fi | |
324 | CLEANFILES += manpage-dep-check | |
325 | ||
bd9d7025 AS |
326 | if VSTUDIO_DDK |
327 | ALL_LOCAL += ovsext_make | |
328 | ovsext_make: datapath-windows/ovsext.sln | |
329 | MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="$(VSTUDIO_CONFIG)" | |
330 | ||
331 | CLEAN_LOCAL += ovsext_clean | |
332 | ovsext_clean: datapath-windows/ovsext.sln | |
333 | MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="$(VSTUDIO_CONFIG)" | |
334 | endif | |
335 | ||
87103e1f | 336 | dist-hook: $(DIST_HOOKS) |
22c79496 | 337 | all-local: $(ALL_LOCAL) |
15b619e2 | 338 | clean-local: $(CLEAN_LOCAL) |
b2df0225 | 339 | install-data-local: $(INSTALL_DATA_LOCAL) |
44852fdf BP |
340 | uninstall-local: $(UNINSTALL_LOCAL) |
341 | .PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL) | |
87103e1f | 342 | |
3a14d239 BP |
343 | modules_install: |
344 | if LINUX_ENABLED | |
345 | cd datapath/linux && $(MAKE) modules_install | |
346 | endif | |
347 | ||
4441a01c BP |
348 | dist-docs: |
349 | VERSION=$(VERSION) $(srcdir)/build-aux/dist-docs $(srcdir) $(docs) | |
350 | .PHONY: dist-docs | |
351 | ||
ed1be787 | 352 | include m4/automake.mk |
064af421 | 353 | include lib/automake.mk |
8cd4882f | 354 | include ofproto/automake.mk |
064af421 BP |
355 | include utilities/automake.mk |
356 | include tests/automake.mk | |
357 | include include/automake.mk | |
358 | include third-party/automake.mk | |
359 | include debian/automake.mk | |
360 | include vswitchd/automake.mk | |
f85f8ebb | 361 | include ovsdb/automake.mk |
c434706a | 362 | include rhel/automake.mk |
064af421 | 363 | include xenserver/automake.mk |
0be6140a | 364 | include python/automake.mk |
6c88547d | 365 | include python/compat/automake.mk |
eeecce05 | 366 | include tutorial/automake.mk |
add17b69 | 367 | include vtep/automake.mk |
c803536e | 368 | include datapath-windows/automake.mk |
c640e3ce | 369 | include datapath-windows/include/automake.mk |