]> git.proxmox.com Git - mirror_ovs.git/blame - Makefile.am
doc: Convert README-native-tunneling to rST
[mirror_ovs.git] / Makefile.am
CommitLineData
8a988976 1# Copyright (C) 2007-2016 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
8AUTOMAKE_OPTIONS = foreign subdir-objects
9ACLOCAL_AMFLAGS = -I m4
10SUBDIRS = datapath
11
064af421 12AM_CPPFLAGS = $(SSL_CFLAGS)
cf06c2e9 13AM_LDFLAGS = $(SSL_LDFLAGS)
95626395 14AM_LDFLAGS += $(OVS_LDFLAGS)
e42dfc72
AS
15
16if WIN32
17AM_CPPFLAGS += -I $(top_srcdir)/include/windows
c803536e 18AM_CPPFLAGS += -I $(top_srcdir)/datapath-windows/include
94887cf4 19AM_CPPFLAGS += $(PTHREAD_INCLUDES)
b0e1bce5 20AM_CPPFLAGS += $(MSVC_CFLAGS)
94887cf4 21AM_LDFLAGS += $(PTHREAD_LDFLAGS)
1cb3649c 22AM_LDFLAGS += $(MSVC64_LDFLAGS)
e42dfc72
AS
23endif
24
064af421 25AM_CPPFLAGS += -I $(top_srcdir)/include
837eefc7 26AM_CPPFLAGS += -I $(top_builddir)/include
064af421 27AM_CPPFLAGS += -I $(top_srcdir)/lib
611d30ce 28AM_CPPFLAGS += -I $(top_builddir)/lib
064af421 29
8605a29b
PK
30AM_CPPFLAGS += $(SSL_INCLUDES)
31
064af421 32AM_CFLAGS = -Wstrict-prototypes
d161c099 33AM_CFLAGS += $(WARNING_FLAGS)
95626395 34AM_CFLAGS += $(OVS_CFLAGS)
064af421 35
58397e6c
KT
36if DPDK_NETDEV
37AM_CFLAGS += -D_FILE_OFFSET_BITS=64
38endif
39
064af421
BP
40if NDEBUG
41AM_CPPFLAGS += -DNDEBUG
42AM_CFLAGS += -fomit-frame-pointer
064af421
BP
43endif
44
b02e1154
GS
45if WIN32
46psep=";"
47else
48psep=":"
49endif
853d1083
BP
50# PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
51# files. Creating .py[co] works OK for any given version of Open
52# vSwitch, but it causes trouble if you switch from a version with
53# foo/__init__.py into an (older) version with plain foo.py, since
54# foo/__init__.pyc will cause Python to ignore foo.py.
e23812fc
BP
55run_python = \
56 PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \
57 PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
853d1083 58
22c79496 59ALL_LOCAL =
d879a707 60BUILT_SOURCES =
064af421 61CLEANFILES =
15b619e2 62CLEAN_LOCAL =
064af421 63DISTCLEANFILES =
79982e90 64PYCOV_CLEAN_FILES = build-aux/check-structs,cover
4441a01c 65
731ee6a9
SF
66# A list of Markdown- or reStructuredText-formatted documentation that will
67# automatically be included in the "make dist-docs" output.
4441a01c 68docs = \
542cc9bb 69 CONTRIBUTING.md \
d124a408 70 CodingStyle.rst \
542cc9bb 71 DESIGN.md \
c4977b6a 72 DocumentationStyle.rst \
542cc9bb 73 FAQ.md \
aff0c4a2 74 INSTALL.rst \
4a9d9b5b 75 INSTALL.Debian.rst \
a58c1a63 76 INSTALL.Docker.rst \
e5bac8f7 77 INSTALL.DPDK-ADVANCED.md \
167703d6 78 INSTALL.DPDK.rst \
542cc9bb 79 INSTALL.Fedora.md \
7668f7cc 80 INSTALL.KVM.rst \
542cc9bb
TG
81 INSTALL.Libvirt.md \
82 INSTALL.NetBSD.md \
83 INSTALL.RHEL.md \
9b897c91 84 INSTALL.SELinux.md \
542cc9bb 85 INSTALL.SSL.md \
716b9b44 86 INSTALL.XenServer.rst \
8eb443d4 87 INSTALL.userspace.rst \
889e567b 88 INSTALL.Windows.rst \
2567fb84 89 IntegrationGuide.rst \
2eb98b60 90 MAINTAINERS.rst \
542cc9bb 91 OPENFLOW-1.1+.md \
7f907848 92 PORTING.rst \
b1fe1c94 93 README.rst \
c780fc1b 94 README-lisp.rst \
5273d85f 95 README-native-tunneling.rst \
8b609338 96 REPORTING-BUGS.rst \
c1b93c19 97 SECURITY.rst \
223908d6 98 WHY-OVS.rst
4441a01c
BP
99EXTRA_DIST = \
100 $(docs) \
101 NOTICE \
826bc7b6 102 .travis.yml \
40a75bbf
LR
103 .travis/linux-build.sh \
104 .travis/linux-prepare.sh \
105 .travis/osx-build.sh \
106 .travis/osx-prepare.sh \
12c96b8a 107 appveyor.yml \
0027492d 108 boot.sh \
c9b94429 109 build-aux/cccl \
abc67c1e 110 build-aux/cksum-schema-check \
39916858 111 build-aux/calculate-schema-cksum \
4441a01c 112 build-aux/dist-docs \
6ca37677 113 build-aux/sodepends.pl \
94512c4a 114 build-aux/soexpand.pl \
a4e3c495 115 build-aux/xml2nroff \
6ca37677 116 $(MAN_FRAGMENTS) \
1ce96d2a 117 $(MAN_ROOTS) \
ef9c432c
WT
118 Vagrantfile \
119 Vagrantfile-FreeBSD
064af421
BP
120bin_PROGRAMS =
121sbin_PROGRAMS =
122bin_SCRIPTS =
87103e1f 123DIST_HOOKS =
064af421 124dist_man_MANS =
3b12adda 125dist_pkgdata_DATA =
064af421
BP
126dist_pkgdata_SCRIPTS =
127dist_sbin_SCRIPTS =
b2df0225 128dist_scripts_SCRIPTS =
429ebf21 129dist_scripts_DATA =
b2df0225 130INSTALL_DATA_LOCAL =
44852fdf 131UNINSTALL_LOCAL =
064af421 132man_MANS =
0027492d 133MAN_FRAGMENTS =
6ca37677 134MAN_ROOTS =
c3bb4bd7 135noinst_DATA =
064af421 136noinst_HEADERS =
38b7a52b 137lib_LTLIBRARIES =
045b2e5c 138noinst_man_MANS =
064af421
BP
139noinst_PROGRAMS =
140noinst_SCRIPTS =
00732bf5 141OVSIDL_BUILT =
9c16ed64 142pkgdata_DATA =
b2df0225 143sbin_SCRIPTS =
43bb5f82 144scripts_SCRIPTS =
2c9907cd 145completion_SCRIPTS =
429ebf21 146scripts_DATA =
c3bb4bd7 147SUFFIXES =
15b619e2 148check_DATA =
08d42548 149check_SCRIPTS =
81696de0 150pkgconfig_DATA =
115d8719 151FLAKE8_PYFILES =
064af421 152
43bb5f82 153scriptsdir = $(pkgdatadir)/scripts
2c9907cd 154completiondir = $(sysconfdir)/bash_completion.d
81696de0 155pkgconfigdir = $(libdir)/pkgconfig
43bb5f82 156
9741af79
BP
157# This ensures that files added to EXTRA_DIST are always distributed,
158# even if they are inside an Automake if...endif conditional block that is
159# disabled by some particular "configure" run. For more information, see:
160# http://article.gmane.org/gmane.comp.sysutils.automake.general/10891
161noinst_HEADERS += $(EXTRA_DIST)
162
064af421 163ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
cbaa4ffe 164ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n'
064af421 165
c3bb4bd7 166SUFFIXES += .in
064af421 167.in:
ef44aa50 168 $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
3b135da3 169 sed \
064af421 170 -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
3b135da3 171 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
f973f2af 172 -e 's,[@]DBDIR[@],$(DBDIR),g' \
3b135da3
BP
173 -e 's,[@]PERL[@],$(PERL),g' \
174 -e 's,[@]PYTHON[@],$(PYTHON),g' \
064af421 175 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
3b135da3
BP
176 -e 's,[@]VERSION[@],$(VERSION),g' \
177 -e 's,[@]localstatedir[@],$(localstatedir),g' \
064af421 178 -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
3b135da3 179 -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
43bb5f82
BP
180 -e 's,[@]bindir[@],$(bindir),g' \
181 -e 's,[@]sbindir[@],$(sbindir),g' \
6901639b 182 -e 's,[@]abs_builddir[@],$(abs_builddir),g' \
d879a707 183 -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \
3b135da3 184 > $@.tmp
00961f7c 185 @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \
3b135da3
BP
186 chmod +x $@.tmp; \
187 fi
ef44aa50 188 $(AM_V_at) mv $@.tmp $@
064af421 189
99635791
BP
190SUFFIXES += .xml
191%: %.xml
192 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/xml2nroff $< > $@.tmp \
8a988976 193 -I $(srcdir) \
99635791
BP
194 --version=$(VERSION) \
195 PKIDIR='$(PKIDIR)' \
196 LOGDIR='$(LOGDIR)' \
197 DBDIR='$(DBDIR)' \
198 PERL='$(PERL)' \
199 PYTHON='$(PYTHON)' \
200 RUNDIR='$(RUNDIR)' \
201 VERSION='$(VERSION)' \
202 localstatedir='$(localstatedir)' \
203 pkgdatadir='$(pkgdatadir)' \
204 sysconfdir='$(sysconfdir)' \
205 bindir='$(bindir)' \
206 sbindir='$(sbindir)'
207 $(AM_v_at)mv $@.tmp $@
208
79982e90
EJ
209.PHONY: clean-pycov
210clean-pycov:
211 cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES)
212CLEAN_LOCAL += clean-pycov
213
87103e1f
BP
214# If we're checked out from a Git repository, make sure that every
215# file that is in Git is distributed.
b4e1bf8b
BP
216#
217# We only enable this check when GNU make is in use because the
218# Makefile in datapath/linux, needed to get the list of files to
219# distribute, requires GNU make extensions.
220if GNU_MAKE
39376d06
BP
221ALL_LOCAL += dist-hook-git
222dist-hook-git: distfiles
223 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
224 (cd datapath && $(MAKE) distfiles); \
225 (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \
a6da6967 226 LC_ALL=C sort -u > all-distfiles; \
39376d06 227 (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \
a6da6967
BP
228 LC_ALL=C sort -u > all-gitfiles; \
229 LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \
39376d06 230 if test -s missing-distfiles; then \
4207d631 231 echo "The following files are in git but not the distribution:"; \
39376d06
BP
232 cat missing-distfiles; \
233 exit 1; \
234 fi; \
87103e1f 235 fi
39376d06
BP
236CLEANFILES += all-distfiles all-gitfiles missing-distfiles
237# The following is based on commands for the Automake "distdir" target.
238distfiles: Makefile
239 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
240 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
241 list='$(DISTFILES)'; \
242 for file in $$list; do echo $$file; done | \
243 sed -e "s|^$$srcdirstrip/||;t" \
a6da6967
BP
244 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \
245 LC_ALL=C sort -u > $@
39376d06 246CLEANFILES += distfiles
b4e1bf8b
BP
247endif
248.PHONY: dist-hook-git
87103e1f 249
9e4ba008
BP
250# Check that every .c file includes <config.h>.
251ALL_LOCAL += config-h-check
252config-h-check:
253 @cd $(srcdir); \
254 if test -e .git && (git --version) >/dev/null 2>&1 && \
b411e5c3 255 git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \
c63b04d6 256 grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows|^python'`; \
9e4ba008
BP
257 then \
258 echo "See above for list of violations of the rule that"; \
259 echo "every C source file must #include <config.h>."; \
260 exit 1; \
261 fi
262.PHONY: config-h-check
263
34582733
AS
264# Check for printf() type modifiers that MSVC doesn't support.
265ALL_LOCAL += printf-check
266printf-check:
8faeab72
DDP
267 @cd $(srcdir); \
268 if test -e .git && (git --version) >/dev/null 2>&1 && \
269 git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \
3b3f8857 270 grep -vE '^datapath|^lib/sflow|^third-party'`; \
34582733
AS
271 then \
272 echo "See above for list of violations of the rule that"; \
273 echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \
d124a408 274 echo "forbidden. See CodingStyle.rst for replacements."; \
34582733
AS
275 exit 1; \
276 fi
277.PHONY: printf-check
278
1514b275
BP
279# Check that certain data structures are always declared "static".
280ALL_LOCAL += static-check
281static-check:
db5ce514 282 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
1514b275 283 git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \
db5ce514
BP
284 then \
285 echo "See above for list of violations of the rule that "; \
1514b275 286 echo "certain data structures must always be 'static'"; \
db5ce514
BP
287 exit 1; \
288 fi
1514b275 289.PHONY: static-check
db5ce514 290
4958e3ee
BP
291# Check that assert.h is not used outside a whitelist of files.
292ALL_LOCAL += check-assert-h-usage
293check-assert-h-usage:
294 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
295 (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \
92fa2e92 296 $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \
4958e3ee
BP
297 then \
298 echo "Files listed above unexpectedly #include <""assert.h"">."; \
299 echo "Please use ovs_assert (from util.h) instead of assert."; \
300 exit 1; \
301 fi
302.PHONY: check-assert-h-usage
303
64746850
BP
304# Check that LITTLE_ENDIAN and BIG_ENDIAN are not used unless BYTE_ORDER is
305# also mentioned. (<endian.h> always defines the former two constants. They
306# must be compared to BYTE_ORDER to get the machine's correct endianness. But
307# it is better to use WORDS_BIGENDIAN.)
308ALL_LOCAL += check-endian
309check-endian:
310 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
311 (cd $(srcdir) && git --no-pager grep -l -E \
312 -e 'BIG_ENDIAN|LITTLE_ENDIAN' --and --not -e 'BYTE_ORDER' | \
313 $(EGREP) -v '^datapath/'); \
314 then \
315 echo "See above for list of files that misuse LITTLE""_ENDIAN"; \
316 echo "or BIG""_ENDIAN. Please use WORDS_BIGENDIAN instead."; \
317 exit 1; \
318 fi
319.PHONY: check-endian
320
6a3e30f3
BP
321ALL_LOCAL += thread-safety-check
322thread-safety-check:
8faeab72
DDP
323 @cd $(srcdir); \
324 if test -e .git && (git --version) >/dev/null 2>&1 && \
325 grep -n -f build-aux/thread-safety-blacklist \
326 `git ls-files | grep '\.[ch]$$' \
ca3d034b 327 | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \
6a3e30f3
BP
328 | $(EGREP) -v ':[ ]*/?\*'; \
329 then \
330 echo "See above for list of calls to functions that are"; \
331 echo "blacklisted due to thread safety issues"; \
332 exit 1; \
333 fi
334EXTRA_DIST += build-aux/thread-safety-blacklist
c9172561 335.PHONY: thread-safety-check
6a3e30f3 336
0027492d
BP
337if HAVE_GROFF
338ALL_LOCAL += manpage-check
1261619f
BP
339manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS)
340 @error=false; \
341 for manpage in $?; do \
186ef5c1 342 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
343 if grep warning: $@.tmp; then error=:; fi; \
344 rm -f $@.tmp; \
0027492d 345 done; \
be09aa10
EJ
346 if $$error; then exit 1; else touch $@; fi
347 $(AM_V_GEN) touch -c $@
0027492d
BP
348CLEANFILES += manpage-check
349endif
350
115d8719
RB
351if HAVE_FLAKE8
352ALL_LOCAL += flake8-check
007ec24d 353# http://flake8.readthedocs.org/en/latest/warnings.html
f3068bff
RB
354# All warnings explicitly selected or ignored should be listed below.
355#
356# E***, W*** -- warnings from pep8
357# E121 continuation line under-indented for hanging indent (only from flake8 v2.0)
358# E123 closing bracket does not match indentation of opening bracket's line
359# E125 continuation line with same indent as next logical line (only from flake8 v2.0)
360# E126 continuation line over-indented for hanging indent
361# E127 continuation line over-indented for visual indent
362# E128 continuation line under-indented for visual indent
363# E129 visually indented line with same indent as next logical line
364# E131 continuation line unaligned for hanging indent
365# W503 line break before binary operator
366# F*** -- warnings native to flake8
367# F811 redefinition of unused <name> from line <N> (only from flake8 v2.0)
007ec24d
NS
368# D*** -- warnings from flake8-docstrings plugin
369# H*** -- warnings from flake8 hacking plugin (custom style checks beyond PEP8)
f3068bff 370# H231 Python 3.x incompatible 'except x,y:' construct
56ec0611 371# H232 Python 3.x incompatible octal 077 should be written as 0o77
8ea171ab 372# H233 Python 3.x incompatible use of print operator
03756304 373# H238 old style class declaration, use new style (inherit from `object`)
115d8719 374flake8-check: $(FLAKE8_PYFILES)
490bafe8
RB
375 $(AM_V_GEN) if flake8 $^ --select=H231,H232,H233,H238 ${FLAKE8_FLAGS} && \
376 flake8 $^ --ignore=E121,E123,E125,E126,E127,E128,E129,E131,W503,F811,D,H ${FLAKE8_FLAGS}; then \
377 touch $@; else exit 1; fi
115d8719 378endif
968eec59 379CLEANFILES += flake8-check
115d8719 380
6ca37677
BP
381include $(srcdir)/manpages.mk
382$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
383 @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
384 @if cmp -s $(@F).tmp $@; then \
385 touch $@; \
386 rm -f $(@F).tmp; \
387 else \
388 mv $(@F).tmp $@; \
389 fi
390CLEANFILES += manpage-dep-check
391
bd9d7025 392if VSTUDIO_DDK
e02b8fb0
AS
393ALL_LOCAL += ovsext
394ovsext: datapath-windows/ovsext.sln $(srcdir)/datapath-windows/include/OvsDpInterface.h
395 MSBuild.exe //maxcpucount datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8$(VSTUDIO_CONFIG)"
396 MSBuild.exe //maxcpucount datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8.1$(VSTUDIO_CONFIG)"
bd9d7025
AS
397
398CLEAN_LOCAL += ovsext_clean
399ovsext_clean: datapath-windows/ovsext.sln
e02b8fb0
AS
400 MSBuild.exe //maxcpucount datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8$(VSTUDIO_CONFIG)"
401 MSBuild.exe //maxcpucount datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8.1$(VSTUDIO_CONFIG)"
bd9d7025 402endif
e02b8fb0 403.PHONY: ovsext
bd9d7025 404
30b79363
BB
405clang-analyze: clean
406 @which clang scan-build >/dev/null 2>&1 || \
407 (echo "Unable to find clang/scan-build, Install clang,clang-analyzer packages"; exit 1)
408 @$(MKDIR_P) "$(srcdir)/tests/clang-analyzer-results"
409 @scan-build -o $(srcdir)/tests/clang-analyzer-results --use-cc=$(CC) $(MAKE)
410.PHONY: clang-analyze
411
87103e1f 412dist-hook: $(DIST_HOOKS)
22c79496 413all-local: $(ALL_LOCAL)
15b619e2 414clean-local: $(CLEAN_LOCAL)
b2df0225 415install-data-local: $(INSTALL_DATA_LOCAL)
44852fdf
BP
416uninstall-local: $(UNINSTALL_LOCAL)
417.PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL)
87103e1f 418
3a14d239
BP
419modules_install:
420if LINUX_ENABLED
421 cd datapath/linux && $(MAKE) modules_install
422endif
423
4441a01c 424dist-docs:
6b304335 425 VERSION=$(VERSION) MAKE='$(MAKE)' $(srcdir)/build-aux/dist-docs $(srcdir) $(docs)
4441a01c
BP
426.PHONY: dist-docs
427
8c254406 428include Documentation/automake.mk
ed1be787 429include m4/automake.mk
064af421 430include lib/automake.mk
8cd4882f 431include ofproto/automake.mk
064af421
BP
432include utilities/automake.mk
433include tests/automake.mk
434include include/automake.mk
435include third-party/automake.mk
436include debian/automake.mk
437include vswitchd/automake.mk
f85f8ebb 438include ovsdb/automake.mk
c434706a 439include rhel/automake.mk
064af421 440include xenserver/automake.mk
0be6140a 441include python/automake.mk
eeecce05 442include tutorial/automake.mk
add17b69 443include vtep/automake.mk
c803536e 444include datapath-windows/automake.mk
c640e3ce 445include datapath-windows/include/automake.mk
d183efc2 446include windows/automake.mk
fe36184b 447include ovn/automake.mk
9b897c91 448include selinux/automake.mk