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