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