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