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