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