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