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