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