]> git.proxmox.com Git - mirror_ovs.git/blame - Makefile.am
nroff: Fix the escape of '.'.
[mirror_ovs.git] / Makefile.am
CommitLineData
f0664242 1# Copyright (C) 2007-2015 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)
95626395 14AM_LDFLAGS += $(OVS_LDFLAGS)
e42dfc72
AS
15
16if WIN32
17AM_CPPFLAGS += -I $(top_srcdir)/include/windows
c803536e 18AM_CPPFLAGS += -I $(top_srcdir)/datapath-windows/include
94887cf4 19AM_CPPFLAGS += $(PTHREAD_INCLUDES)
b0e1bce5 20AM_CPPFLAGS += $(MSVC_CFLAGS)
94887cf4 21AM_LDFLAGS += $(PTHREAD_LDFLAGS)
e42dfc72
AS
22endif
23
064af421 24AM_CPPFLAGS += -I $(top_srcdir)/include
837eefc7 25AM_CPPFLAGS += -I $(top_builddir)/include
064af421 26AM_CPPFLAGS += -I $(top_srcdir)/lib
611d30ce 27AM_CPPFLAGS += -I $(top_builddir)/lib
064af421 28
8605a29b
PK
29AM_CPPFLAGS += $(SSL_INCLUDES)
30
064af421 31AM_CFLAGS = -Wstrict-prototypes
d161c099 32AM_CFLAGS += $(WARNING_FLAGS)
95626395 33AM_CFLAGS += $(OVS_CFLAGS)
064af421 34
58397e6c
KT
35if DPDK_NETDEV
36AM_CFLAGS += -D_FILE_OFFSET_BITS=64
37endif
38
064af421
BP
39if NDEBUG
40AM_CPPFLAGS += -DNDEBUG
41AM_CFLAGS += -fomit-frame-pointer
064af421
BP
42endif
43
b02e1154
GS
44if WIN32
45psep=";"
46else
47psep=":"
48endif
853d1083
BP
49# PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
50# files. Creating .py[co] works OK for any given version of Open
51# vSwitch, but it causes trouble if you switch from a version with
52# foo/__init__.py into an (older) version with plain foo.py, since
53# foo/__init__.pyc will cause Python to ignore foo.py.
9b4a5392 54if INCLUDE_PYTHON_COMPAT
b02e1154 55run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$(top_srcdir)/python/compat$(psep)$$PYTHONPATH
9b4a5392 56else
b02e1154 57run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH
9b4a5392
AA
58endif
59run_python += PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
60
853d1083 61
22c79496 62ALL_LOCAL =
d879a707 63BUILT_SOURCES =
064af421 64CLEANFILES =
15b619e2 65CLEAN_LOCAL =
064af421 66DISTCLEANFILES =
79982e90 67PYCOV_CLEAN_FILES = build-aux/check-structs,cover
4441a01c
BP
68
69# A list of Markdown-formatted documentation that will automatically be
70# included in the "make dist-docs" output.
71docs = \
d8a24927 72 appveyor.yml \
542cc9bb
TG
73 CONTRIBUTING.md \
74 CodingStyle.md \
75 DESIGN.md \
76 FAQ.md \
77 INSTALL.md \
78 INSTALL.Debian.md \
79 INSTALL.Docker.md \
80 INSTALL.DPDK.md \
81 INSTALL.Fedora.md \
82 INSTALL.KVM.md \
83 INSTALL.Libvirt.md \
84 INSTALL.NetBSD.md \
85 INSTALL.RHEL.md \
86 INSTALL.SSL.md \
87 INSTALL.XenServer.md \
88 INSTALL.userspace.md \
89 INSTALL.Windows.md \
90 IntegrationGuide.md \
542cc9bb
TG
91 OPENFLOW-1.1+.md \
92 PORTING.md \
d25e2f57 93 README.md \
542cc9bb 94 README-lisp.md \
a36de779 95 README-native-tunneling.md \
542cc9bb 96 REPORTING-BUGS.md \
f0664242 97 SECURITY.md \
542cc9bb 98 TODO.md \
4441a01c
BP
99 WHY-OVS.md
100EXTRA_DIST = \
101 $(docs) \
102 NOTICE \
826bc7b6
TG
103 .travis.yml \
104 .travis/build.sh \
105 .travis/prepare.sh \
0027492d 106 boot.sh \
c9b94429 107 build-aux/cccl \
4441a01c 108 build-aux/dist-docs \
6ca37677 109 build-aux/sodepends.pl \
94512c4a 110 build-aux/soexpand.pl \
a4e3c495 111 build-aux/xml2nroff \
6ca37677 112 $(MAN_FRAGMENTS) \
1ce96d2a 113 $(MAN_ROOTS) \
b56b2566 114 Vagrantfile
064af421
BP
115bin_PROGRAMS =
116sbin_PROGRAMS =
117bin_SCRIPTS =
87103e1f 118DIST_HOOKS =
064af421 119dist_man_MANS =
3b12adda 120dist_pkgdata_DATA =
064af421
BP
121dist_pkgdata_SCRIPTS =
122dist_sbin_SCRIPTS =
b2df0225 123dist_scripts_SCRIPTS =
429ebf21 124dist_scripts_DATA =
b2df0225 125INSTALL_DATA_LOCAL =
44852fdf 126UNINSTALL_LOCAL =
064af421 127man_MANS =
0027492d 128MAN_FRAGMENTS =
6ca37677 129MAN_ROOTS =
c3bb4bd7 130noinst_DATA =
064af421 131noinst_HEADERS =
38b7a52b 132lib_LTLIBRARIES =
045b2e5c 133noinst_man_MANS =
064af421
BP
134noinst_PROGRAMS =
135noinst_SCRIPTS =
00732bf5 136OVSIDL_BUILT =
9c16ed64 137pkgdata_DATA =
b2df0225 138sbin_SCRIPTS =
43bb5f82 139scripts_SCRIPTS =
2c9907cd 140completion_SCRIPTS =
429ebf21 141scripts_DATA =
c3bb4bd7 142SUFFIXES =
15b619e2 143check_DATA =
08d42548 144check_SCRIPTS =
81696de0 145pkgconfig_DATA =
064af421 146
43bb5f82 147scriptsdir = $(pkgdatadir)/scripts
2c9907cd 148completiondir = $(sysconfdir)/bash_completion.d
81696de0 149pkgconfigdir = $(libdir)/pkgconfig
43bb5f82 150
9741af79
BP
151# This ensures that files added to EXTRA_DIST are always distributed,
152# even if they are inside an Automake if...endif conditional block that is
153# disabled by some particular "configure" run. For more information, see:
154# http://article.gmane.org/gmane.comp.sysutils.automake.general/10891
155noinst_HEADERS += $(EXTRA_DIST)
156
064af421 157ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
cbaa4ffe 158ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n'
064af421 159
c3bb4bd7 160SUFFIXES += .in
064af421 161.in:
ef44aa50 162 $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
3b135da3 163 sed \
064af421 164 -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
3b135da3 165 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
f973f2af 166 -e 's,[@]DBDIR[@],$(DBDIR),g' \
3b135da3
BP
167 -e 's,[@]PERL[@],$(PERL),g' \
168 -e 's,[@]PYTHON[@],$(PYTHON),g' \
064af421 169 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
3b135da3
BP
170 -e 's,[@]VERSION[@],$(VERSION),g' \
171 -e 's,[@]localstatedir[@],$(localstatedir),g' \
064af421 172 -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
3b135da3 173 -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
43bb5f82
BP
174 -e 's,[@]bindir[@],$(bindir),g' \
175 -e 's,[@]sbindir[@],$(sbindir),g' \
6901639b 176 -e 's,[@]abs_builddir[@],$(abs_builddir),g' \
d879a707 177 -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \
3b135da3 178 > $@.tmp
00961f7c 179 @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \
3b135da3
BP
180 chmod +x $@.tmp; \
181 fi
ef44aa50 182 $(AM_V_at) mv $@.tmp $@
064af421 183
79982e90
EJ
184.PHONY: clean-pycov
185clean-pycov:
186 cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES)
187CLEAN_LOCAL += clean-pycov
188
87103e1f
BP
189# If we're checked out from a Git repository, make sure that every
190# file that is in Git is distributed.
b4e1bf8b
BP
191#
192# We only enable this check when GNU make is in use because the
193# Makefile in datapath/linux, needed to get the list of files to
194# distribute, requires GNU make extensions.
195if GNU_MAKE
39376d06
BP
196ALL_LOCAL += dist-hook-git
197dist-hook-git: distfiles
198 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
199 (cd datapath && $(MAKE) distfiles); \
200 (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \
a6da6967 201 LC_ALL=C sort -u > all-distfiles; \
39376d06 202 (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \
a6da6967
BP
203 LC_ALL=C sort -u > all-gitfiles; \
204 LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \
39376d06 205 if test -s missing-distfiles; then \
4207d631 206 echo "The following files are in git but not the distribution:"; \
39376d06
BP
207 cat missing-distfiles; \
208 exit 1; \
209 fi; \
87103e1f 210 fi
39376d06
BP
211CLEANFILES += all-distfiles all-gitfiles missing-distfiles
212# The following is based on commands for the Automake "distdir" target.
213distfiles: Makefile
214 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
215 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
216 list='$(DISTFILES)'; \
217 for file in $$list; do echo $$file; done | \
218 sed -e "s|^$$srcdirstrip/||;t" \
a6da6967
BP
219 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \
220 LC_ALL=C sort -u > $@
39376d06 221CLEANFILES += distfiles
b4e1bf8b
BP
222endif
223.PHONY: dist-hook-git
87103e1f 224
9e4ba008
BP
225# Check that every .c file includes <config.h>.
226ALL_LOCAL += config-h-check
227config-h-check:
228 @cd $(srcdir); \
229 if test -e .git && (git --version) >/dev/null 2>&1 && \
b411e5c3 230 git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \
c803536e 231 grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows'`; \
9e4ba008
BP
232 then \
233 echo "See above for list of violations of the rule that"; \
234 echo "every C source file must #include <config.h>."; \
235 exit 1; \
236 fi
237.PHONY: config-h-check
238
34582733
AS
239# Check for printf() type modifiers that MSVC doesn't support.
240ALL_LOCAL += printf-check
241printf-check:
8faeab72
DDP
242 @cd $(srcdir); \
243 if test -e .git && (git --version) >/dev/null 2>&1 && \
244 git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \
3b3f8857 245 grep -vE '^datapath|^lib/sflow|^third-party'`; \
34582733
AS
246 then \
247 echo "See above for list of violations of the rule that"; \
248 echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \
542cc9bb 249 echo "forbidden. See CodingStyle.md for replacements."; \
34582733
AS
250 exit 1; \
251 fi
252.PHONY: printf-check
253
1514b275
BP
254# Check that certain data structures are always declared "static".
255ALL_LOCAL += static-check
256static-check:
db5ce514 257 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
1514b275 258 git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \
db5ce514
BP
259 then \
260 echo "See above for list of violations of the rule that "; \
1514b275 261 echo "certain data structures must always be 'static'"; \
db5ce514
BP
262 exit 1; \
263 fi
1514b275 264.PHONY: static-check
db5ce514 265
4958e3ee
BP
266# Check that assert.h is not used outside a whitelist of files.
267ALL_LOCAL += check-assert-h-usage
268check-assert-h-usage:
269 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
270 (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \
92fa2e92 271 $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \
4958e3ee
BP
272 then \
273 echo "Files listed above unexpectedly #include <""assert.h"">."; \
274 echo "Please use ovs_assert (from util.h) instead of assert."; \
275 exit 1; \
276 fi
277.PHONY: check-assert-h-usage
278
64746850
BP
279# Check that LITTLE_ENDIAN and BIG_ENDIAN are not used unless BYTE_ORDER is
280# also mentioned. (<endian.h> always defines the former two constants. They
281# must be compared to BYTE_ORDER to get the machine's correct endianness. But
282# it is better to use WORDS_BIGENDIAN.)
283ALL_LOCAL += check-endian
284check-endian:
285 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
286 (cd $(srcdir) && git --no-pager grep -l -E \
287 -e 'BIG_ENDIAN|LITTLE_ENDIAN' --and --not -e 'BYTE_ORDER' | \
288 $(EGREP) -v '^datapath/'); \
289 then \
290 echo "See above for list of files that misuse LITTLE""_ENDIAN"; \
291 echo "or BIG""_ENDIAN. Please use WORDS_BIGENDIAN instead."; \
292 exit 1; \
293 fi
294.PHONY: check-endian
295
6a3e30f3
BP
296ALL_LOCAL += thread-safety-check
297thread-safety-check:
8faeab72
DDP
298 @cd $(srcdir); \
299 if test -e .git && (git --version) >/dev/null 2>&1 && \
300 grep -n -f build-aux/thread-safety-blacklist \
301 `git ls-files | grep '\.[ch]$$' \
ca3d034b 302 | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \
6a3e30f3
BP
303 | $(EGREP) -v ':[ ]*/?\*'; \
304 then \
305 echo "See above for list of calls to functions that are"; \
306 echo "blacklisted due to thread safety issues"; \
307 exit 1; \
308 fi
309EXTRA_DIST += build-aux/thread-safety-blacklist
310
0027492d
BP
311if HAVE_GROFF
312ALL_LOCAL += manpage-check
1261619f
BP
313manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS)
314 @error=false; \
315 for manpage in $?; do \
186ef5c1 316 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
317 if grep warning: $@.tmp; then error=:; fi; \
318 rm -f $@.tmp; \
0027492d 319 done; \
be09aa10
EJ
320 if $$error; then exit 1; else touch $@; fi
321 $(AM_V_GEN) touch -c $@
0027492d
BP
322CLEANFILES += manpage-check
323endif
324
6ca37677
BP
325include $(srcdir)/manpages.mk
326$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
327 @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
328 @if cmp -s $(@F).tmp $@; then \
329 touch $@; \
330 rm -f $(@F).tmp; \
331 else \
332 mv $(@F).tmp $@; \
333 fi
334CLEANFILES += manpage-dep-check
335
bd9d7025
AS
336if VSTUDIO_DDK
337ALL_LOCAL += ovsext_make
338ovsext_make: datapath-windows/ovsext.sln
d183efc2
AS
339 MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8$(VSTUDIO_CONFIG)"
340 MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8.1$(VSTUDIO_CONFIG)"
bd9d7025
AS
341
342CLEAN_LOCAL += ovsext_clean
343ovsext_clean: datapath-windows/ovsext.sln
d183efc2
AS
344 MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8$(VSTUDIO_CONFIG)"
345 MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8.1$(VSTUDIO_CONFIG)"
bd9d7025
AS
346endif
347
87103e1f 348dist-hook: $(DIST_HOOKS)
22c79496 349all-local: $(ALL_LOCAL)
15b619e2 350clean-local: $(CLEAN_LOCAL)
b2df0225 351install-data-local: $(INSTALL_DATA_LOCAL)
44852fdf
BP
352uninstall-local: $(UNINSTALL_LOCAL)
353.PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL)
87103e1f 354
3a14d239
BP
355modules_install:
356if LINUX_ENABLED
357 cd datapath/linux && $(MAKE) modules_install
358endif
359
4441a01c
BP
360dist-docs:
361 VERSION=$(VERSION) $(srcdir)/build-aux/dist-docs $(srcdir) $(docs)
362.PHONY: dist-docs
363
8c254406 364include Documentation/automake.mk
ed1be787 365include m4/automake.mk
064af421 366include lib/automake.mk
8cd4882f 367include ofproto/automake.mk
064af421
BP
368include utilities/automake.mk
369include tests/automake.mk
370include include/automake.mk
371include third-party/automake.mk
372include debian/automake.mk
373include vswitchd/automake.mk
f85f8ebb 374include ovsdb/automake.mk
c434706a 375include rhel/automake.mk
064af421 376include xenserver/automake.mk
0be6140a 377include python/automake.mk
6c88547d 378include python/compat/automake.mk
eeecce05 379include tutorial/automake.mk
add17b69 380include vtep/automake.mk
c803536e 381include datapath-windows/automake.mk
c640e3ce 382include datapath-windows/include/automake.mk
d183efc2 383include windows/automake.mk
fe36184b 384include ovn/automake.mk