]>
Commit | Line | Data |
---|---|---|
eeecce05 | 1 | # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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) |
064af421 BP |
13 | AM_CPPFLAGS += -I $(top_srcdir)/include |
14 | AM_CPPFLAGS += -I $(top_srcdir)/lib | |
611d30ce | 15 | AM_CPPFLAGS += -I $(top_builddir)/lib |
064af421 BP |
16 | |
17 | AM_CFLAGS = -Wstrict-prototypes | |
d161c099 | 18 | AM_CFLAGS += $(WARNING_FLAGS) |
064af421 BP |
19 | |
20 | if NDEBUG | |
21 | AM_CPPFLAGS += -DNDEBUG | |
22 | AM_CFLAGS += -fomit-frame-pointer | |
064af421 BP |
23 | endif |
24 | ||
b02e1154 GS |
25 | if WIN32 |
26 | psep=";" | |
27 | else | |
28 | psep=":" | |
29 | endif | |
853d1083 BP |
30 | # PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo |
31 | # files. Creating .py[co] works OK for any given version of Open | |
32 | # vSwitch, but it causes trouble if you switch from a version with | |
33 | # foo/__init__.py into an (older) version with plain foo.py, since | |
34 | # foo/__init__.pyc will cause Python to ignore foo.py. | |
9b4a5392 | 35 | if INCLUDE_PYTHON_COMPAT |
b02e1154 | 36 | run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$(top_srcdir)/python/compat$(psep)$$PYTHONPATH |
9b4a5392 | 37 | else |
b02e1154 | 38 | run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH |
9b4a5392 AA |
39 | endif |
40 | run_python += PYTHONDONTWRITEBYTECODE=yes $(PYTHON) | |
41 | ||
853d1083 | 42 | |
22c79496 | 43 | ALL_LOCAL = |
d879a707 | 44 | BUILT_SOURCES = |
064af421 | 45 | CLEANFILES = |
15b619e2 | 46 | CLEAN_LOCAL = |
064af421 | 47 | DISTCLEANFILES = |
79982e90 | 48 | PYCOV_CLEAN_FILES = build-aux/check-structs,cover |
4cdb08c0 | 49 | EXTRA_DIST = \ |
13465541 | 50 | BUILD.Windows \ |
4cdb08c0 | 51 | CodingStyle \ |
d31f1109 | 52 | DESIGN \ |
c483d489 | 53 | FAQ \ |
f6eb6b20 | 54 | INSTALL \ |
6494ea4c | 55 | INSTALL.Debian \ |
6dcf2bc3 | 56 | INSTALL.Fedora \ |
6cdd6a87 | 57 | INSTALL.KVM \ |
8a984481 | 58 | INSTALL.Libvirt \ |
c434706a | 59 | INSTALL.RHEL \ |
c2d1694f | 60 | INSTALL.SSL \ |
9678a9b6 | 61 | INSTALL.XenServer \ |
4cdb08c0 | 62 | INSTALL.userspace \ |
98f61d42 | 63 | IntegrationGuide \ |
4cdb08c0 | 64 | NOTICE \ |
bea97716 | 65 | OPENFLOW-1.1+ \ |
bc34d060 | 66 | PORTING \ |
81a114e5 | 67 | README-OFTest \ |
4cdb08c0 | 68 | README-gcov \ |
a6ae068b | 69 | README-lisp \ |
4cdb08c0 BP |
70 | REPORTING-BUGS \ |
71 | SubmittingPatches \ | |
3c34dd48 | 72 | WHY-OVS \ |
0027492d | 73 | boot.sh \ |
c9b94429 | 74 | build-aux/cccl \ |
6ca37677 | 75 | build-aux/sodepends.pl \ |
94512c4a | 76 | build-aux/soexpand.pl \ |
6ca37677 BP |
77 | $(MAN_FRAGMENTS) \ |
78 | $(MAN_ROOTS) | |
064af421 BP |
79 | bin_PROGRAMS = |
80 | sbin_PROGRAMS = | |
81 | bin_SCRIPTS = | |
87103e1f | 82 | DIST_HOOKS = |
064af421 | 83 | dist_man_MANS = |
3b12adda | 84 | dist_pkgdata_DATA = |
064af421 BP |
85 | dist_pkgdata_SCRIPTS = |
86 | dist_sbin_SCRIPTS = | |
b2df0225 | 87 | dist_scripts_SCRIPTS = |
429ebf21 | 88 | dist_scripts_DATA = |
b2df0225 | 89 | INSTALL_DATA_LOCAL = |
44852fdf | 90 | UNINSTALL_LOCAL = |
064af421 | 91 | man_MANS = |
0027492d | 92 | MAN_FRAGMENTS = |
6ca37677 | 93 | MAN_ROOTS = |
c3bb4bd7 | 94 | noinst_DATA = |
064af421 | 95 | noinst_HEADERS = |
38b7a52b | 96 | lib_LTLIBRARIES = |
045b2e5c | 97 | noinst_man_MANS = |
064af421 BP |
98 | noinst_PROGRAMS = |
99 | noinst_SCRIPTS = | |
00732bf5 | 100 | OVSIDL_BUILT = |
9c16ed64 | 101 | pkgdata_DATA = |
b2df0225 | 102 | sbin_SCRIPTS = |
43bb5f82 | 103 | scripts_SCRIPTS = |
429ebf21 | 104 | scripts_DATA = |
c3bb4bd7 | 105 | SUFFIXES = |
15b619e2 | 106 | check_DATA = |
064af421 | 107 | |
43bb5f82 BP |
108 | scriptsdir = $(pkgdatadir)/scripts |
109 | ||
9741af79 BP |
110 | # This ensures that files added to EXTRA_DIST are always distributed, |
111 | # even if they are inside an Automake if...endif conditional block that is | |
112 | # disabled by some particular "configure" run. For more information, see: | |
113 | # http://article.gmane.org/gmane.comp.sysutils.automake.general/10891 | |
114 | noinst_HEADERS += $(EXTRA_DIST) | |
115 | ||
064af421 | 116 | ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */' |
cbaa4ffe | 117 | ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n' |
064af421 | 118 | |
c3bb4bd7 | 119 | SUFFIXES += .in |
064af421 | 120 | .in: |
94512c4a | 121 | $(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \ |
3b135da3 | 122 | sed \ |
064af421 | 123 | -e 's,[@]PKIDIR[@],$(PKIDIR),g' \ |
3b135da3 | 124 | -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ |
f973f2af | 125 | -e 's,[@]DBDIR[@],$(DBDIR),g' \ |
3b135da3 BP |
126 | -e 's,[@]PERL[@],$(PERL),g' \ |
127 | -e 's,[@]PYTHON[@],$(PYTHON),g' \ | |
064af421 | 128 | -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ |
3b135da3 BP |
129 | -e 's,[@]VERSION[@],$(VERSION),g' \ |
130 | -e 's,[@]localstatedir[@],$(localstatedir),g' \ | |
064af421 | 131 | -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ |
3b135da3 | 132 | -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ |
43bb5f82 BP |
133 | -e 's,[@]bindir[@],$(bindir),g' \ |
134 | -e 's,[@]sbindir[@],$(sbindir),g' \ | |
d879a707 | 135 | -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \ |
436f27dd | 136 | -e 's,[@]ovsdbmonitordir[@],$(ovsdbmonitordir),g' \ |
3b135da3 | 137 | > $@.tmp |
00961f7c | 138 | @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \ |
3b135da3 BP |
139 | echo chmod +x $@.tmp; \ |
140 | chmod +x $@.tmp; \ | |
141 | fi | |
142 | mv $@.tmp $@ | |
064af421 | 143 | |
79982e90 EJ |
144 | .PHONY: clean-pycov |
145 | clean-pycov: | |
146 | cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES) | |
147 | CLEAN_LOCAL += clean-pycov | |
148 | ||
87103e1f BP |
149 | # If we're checked out from a Git repository, make sure that every |
150 | # file that is in Git is distributed. | |
b4e1bf8b BP |
151 | # |
152 | # We only enable this check when GNU make is in use because the | |
153 | # Makefile in datapath/linux, needed to get the list of files to | |
154 | # distribute, requires GNU make extensions. | |
155 | if GNU_MAKE | |
39376d06 BP |
156 | ALL_LOCAL += dist-hook-git |
157 | dist-hook-git: distfiles | |
158 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \ | |
159 | (cd datapath && $(MAKE) distfiles); \ | |
160 | (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \ | |
161 | sort -u > all-distfiles; \ | |
162 | (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \ | |
163 | sort -u > all-gitfiles; \ | |
164 | comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \ | |
165 | if test -s missing-distfiles; then \ | |
166 | echo "The distribution is missing the following files:"; \ | |
167 | cat missing-distfiles; \ | |
168 | exit 1; \ | |
169 | fi; \ | |
87103e1f | 170 | fi |
39376d06 BP |
171 | CLEANFILES += all-distfiles all-gitfiles missing-distfiles |
172 | # The following is based on commands for the Automake "distdir" target. | |
173 | distfiles: Makefile | |
174 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | |
175 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | |
176 | list='$(DISTFILES)'; \ | |
177 | for file in $$list; do echo $$file; done | \ | |
178 | sed -e "s|^$$srcdirstrip/||;t" \ | |
179 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@ | |
180 | CLEANFILES += distfiles | |
b4e1bf8b BP |
181 | endif |
182 | .PHONY: dist-hook-git | |
87103e1f | 183 | |
9e4ba008 BP |
184 | # Check that every .c file includes <config.h>. |
185 | ALL_LOCAL += config-h-check | |
186 | config-h-check: | |
187 | @cd $(srcdir); \ | |
188 | if test -e .git && (git --version) >/dev/null 2>&1 && \ | |
b411e5c3 | 189 | git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \ |
fedbc4d6 | 190 | grep -vE '^datapath|^lib/sflow|^third-party'`; \ |
9e4ba008 BP |
191 | then \ |
192 | echo "See above for list of violations of the rule that"; \ | |
193 | echo "every C source file must #include <config.h>."; \ | |
194 | exit 1; \ | |
195 | fi | |
196 | .PHONY: config-h-check | |
197 | ||
34582733 AS |
198 | # Check for printf() type modifiers that MSVC doesn't support. |
199 | ALL_LOCAL += printf-check | |
200 | printf-check: | |
201 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ | |
202 | git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files $(srcdir) | grep '\.[ch]$$'`; \ | |
203 | then \ | |
204 | echo "See above for list of violations of the rule that"; \ | |
205 | echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \ | |
206 | echo "forbidden. See CodingStyle for replacements."; \ | |
207 | exit 1; \ | |
208 | fi | |
209 | .PHONY: printf-check | |
210 | ||
1514b275 BP |
211 | # Check that certain data structures are always declared "static". |
212 | ALL_LOCAL += static-check | |
213 | static-check: | |
db5ce514 | 214 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ |
1514b275 | 215 | git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \ |
db5ce514 BP |
216 | then \ |
217 | echo "See above for list of violations of the rule that "; \ | |
1514b275 | 218 | echo "certain data structures must always be 'static'"; \ |
db5ce514 BP |
219 | exit 1; \ |
220 | fi | |
1514b275 | 221 | .PHONY: static-check |
db5ce514 | 222 | |
4958e3ee BP |
223 | # Check that assert.h is not used outside a whitelist of files. |
224 | ALL_LOCAL += check-assert-h-usage | |
225 | check-assert-h-usage: | |
226 | @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ | |
227 | (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \ | |
92fa2e92 | 228 | $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \ |
4958e3ee BP |
229 | then \ |
230 | echo "Files listed above unexpectedly #include <""assert.h"">."; \ | |
231 | echo "Please use ovs_assert (from util.h) instead of assert."; \ | |
232 | exit 1; \ | |
233 | fi | |
234 | .PHONY: check-assert-h-usage | |
235 | ||
6a3e30f3 BP |
236 | ALL_LOCAL += thread-safety-check |
237 | thread-safety-check: | |
238 | @if test -e '$(srcdir)'/.git && (git --version) >/dev/null 2>&1 && \ | |
239 | grep -n -f '$(srcdir)'/build-aux/thread-safety-blacklist \ | |
240 | `git ls-files '$(srcdir)' | grep '\.[ch]$$' \ | |
241 | | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` \ | |
242 | | $(EGREP) -v ':[ ]*/?\*'; \ | |
243 | then \ | |
244 | echo "See above for list of calls to functions that are"; \ | |
245 | echo "blacklisted due to thread safety issues"; \ | |
246 | exit 1; \ | |
247 | fi | |
248 | EXTRA_DIST += build-aux/thread-safety-blacklist | |
249 | ||
0027492d BP |
250 | if HAVE_GROFF |
251 | ALL_LOCAL += manpage-check | |
1261619f BP |
252 | manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS) |
253 | @error=false; \ | |
254 | for manpage in $?; do \ | |
186ef5c1 | 255 | 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 |
256 | if grep warning: $@.tmp; then error=:; fi; \ |
257 | rm -f $@.tmp; \ | |
0027492d | 258 | done; \ |
1261619f | 259 | if $$error; then exit 1; else echo touch $@; touch $@; fi |
0027492d BP |
260 | CLEANFILES += manpage-check |
261 | endif | |
262 | ||
6ca37677 BP |
263 | include $(srcdir)/manpages.mk |
264 | $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl | |
265 | @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp | |
266 | @if cmp -s $(@F).tmp $@; then \ | |
267 | touch $@; \ | |
268 | rm -f $(@F).tmp; \ | |
269 | else \ | |
270 | mv $(@F).tmp $@; \ | |
271 | fi | |
272 | CLEANFILES += manpage-dep-check | |
273 | ||
87103e1f | 274 | dist-hook: $(DIST_HOOKS) |
22c79496 | 275 | all-local: $(ALL_LOCAL) |
15b619e2 | 276 | clean-local: $(CLEAN_LOCAL) |
b2df0225 | 277 | install-data-local: $(INSTALL_DATA_LOCAL) |
44852fdf BP |
278 | uninstall-local: $(UNINSTALL_LOCAL) |
279 | .PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL) | |
87103e1f | 280 | |
3a14d239 BP |
281 | modules_install: |
282 | if LINUX_ENABLED | |
283 | cd datapath/linux && $(MAKE) modules_install | |
284 | endif | |
285 | ||
ed1be787 | 286 | include m4/automake.mk |
064af421 | 287 | include lib/automake.mk |
8cd4882f | 288 | include ofproto/automake.mk |
064af421 BP |
289 | include utilities/automake.mk |
290 | include tests/automake.mk | |
291 | include include/automake.mk | |
292 | include third-party/automake.mk | |
293 | include debian/automake.mk | |
294 | include vswitchd/automake.mk | |
f85f8ebb | 295 | include ovsdb/automake.mk |
c434706a | 296 | include rhel/automake.mk |
064af421 | 297 | include xenserver/automake.mk |
0be6140a | 298 | include python/automake.mk |
6c88547d | 299 | include python/compat/automake.mk |
eeecce05 | 300 | include tutorial/automake.mk |
add17b69 | 301 | include vtep/automake.mk |